lib/jekyll-maps/google_map.html in jekyll-maps-1.0.1 vs lib/jekyll-maps/google_map.html in jekyll-maps-1.0.2
- old
+ new
@@ -25,19 +25,17 @@
bounds = new google.maps.LatLngBounds(),
markers = locations.map(function (location) {
var position = new google.maps.LatLng(location.latitude, location.longitude);
var marker = new google.maps.Marker({
position: position,
- map: map,
- title: location.title,
- url: location.url
+ title: location.title,
+ url: location.url,
+ map: map
});
marker.addListener('click', function () {
- if (this.url) {
- window.location.href = this.url;
- }
+ window.location.href = this.url
});
bounds.extend(position);
return marker;
});
@@ -48,11 +46,8 @@
});
map.fitBounds(bounds);
},
};
}());
-
- window.onload = function () {
- jekyllMaps.loadScript('https://googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js');
- jekyllMaps.loadScript('http://maps.googleapis.com/maps/api/js?callback=jekyllMaps.initialize');
- };
</script>
+<script src='https://googlemaps.github.io/js-marker-clusterer/src/markerclusterer.js'></script>
+<script src='https://maps.googleapis.com/maps/api/js?callback=jekyllMaps.initialize'></script>