This repository has been archived by the owner on Jun 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 772
Marker cluster using geojson #138
Comments
I'm very much interested in this as well. |
map.data.loadGeoJson('locate.json' + param, null, function(features) {
// group items / cluster
var markers = features.map(function(feature) {
var g = feature.getGeometry();
var marker = new google.maps.Marker({
'position': g.get(0),
'data' : feature
});
return marker;
});
// create a new marker cluster
var markerCluster = new MarkerClusterer(map, markers, {
imagePath: 'https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m',
gridSize: 15,
zoomOnClick: false
});
// add event listener to the cluster
google.maps.event.addListener(markerCluster, 'clusterclick', function (cluster) {
// handle clickevent
});
}); https://googlemaps.github.io/js-marker-clusterer/docs/reference.html |
Hi Everyone, for some reason this did not work for me but if I added this as as style then it worked. I wanted to mention it just in case it helps anyone else because it was driving me crazy.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there any way to implement marker cluster using geojson data layer? This JS supports only those markers which are created by
google.maps.Marker
objects.The text was updated successfully, but these errors were encountered: