Open GoogleCodeExporter opened 8 years ago
[deleted comment]
create the marker cluster after the markers have been added to the map, not
before. try this :
$(function() {
$('#map_canvas').gmap({'center': '37.4419, -122.1419','zoom': 5, 'disableDefaultUI':true}).bind('init', function(evt, map) {
$.getJSON('json/demo.json', function(data){
$.each(data.markers, function(i, marker){
$('#map_canvas').gmap('addMarker', {
'position': new google.maps.LatLng(marker.latitude, marker.longitude)
}).click(function(){
$('#map_canvas').gmap('openInfoWindow', {
'content': marker.content
},this);
});
});
$('#map_canvas').gmap('set', 'MarkerClusterer', new MarkerClusterer($('#map_canvas').gmap('get', 'map'), $('#map_canvas').gmap('get', 'markers')));
});
});
});
Original comment by alankila...@gmail.com
on 22 May 2014 at 6:21
Original issue reported on code.google.com by
virus30y...@gmail.com
on 18 Jan 2014 at 2:43