-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
70 lines (69 loc) · 2.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>Kuchenne Rewolucje Magdy Gessler</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<meta name="description" content="Mapa restuaracji po Kuchennych Rewolucjach Magdy Gessler">
<meta name="keywords" content="kuchenne rewolucje,magda gessler,przepisy magdy gessler,tvn,restuaracja,gotowanie,kuchnia">
<style>
#map {
height: 100%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
var infowindow = new google.maps.InfoWindow();
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 52, lng: 20},
zoom: 7
});
google.maps.event.addListener(map,'click',function() {
infowindow.close();
});
map.data.addListener('click', function(event) {
var homepageLinkOrText = createHomepageLinkOrText(event.feature);
var episodeLink = createEpisodeLink(event.feature);
infowindow.setContent("<div style='width:150px; text-align:center;'>" + homepageLinkOrText + "<br>" + episodeLink + "</div>");
infowindow.setPosition(event.feature.getGeometry().get());
infowindow.setOptions({pixelOffset: new google.maps.Size(0,-30)});
infowindow.open(map);
});
map.data.setStyle(function(feature) {
return {icon:feature.getProperty('icon')};
});
map.data.loadGeoJson('data.geojson');
}
function createHomepageLinkOrText(feature) {
var name = feature.getProperty("name");
var homepage = feature.getProperty("homepage");
if (homepage){
return "<a target='_blank' href='" + homepage + "'>" + name + "</a>";
}
return name;
}
function createEpisodeLink(feature) {
var url = feature.getProperty("url");
return "<a target='_blank' href='" + url + "'>obejrzyj odcinek</a>";
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDQ94E8qaA17lf_xIdrKf0TPbN--dE-2Fo&callback=initMap&language=pl®ion=PL" async defer></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46736742-2', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>