Skip to content
This repository was archived by the owner on Jun 16, 2019. It is now read-only.
This repository was archived by the owner on Jun 16, 2019. It is now read-only.

clustering not working on zoomout #149

Description

@sunderkasajal1203

The total data that needs to be renderd is 100000. I am sending data in patches of 10000 and concating it to display a final single cluster of 100000 markers which works correctly. But after zoomin when i click on zoomout it again forms patches of 10000 each on every zoom_changed event and overlaps by forming clusters of 10000 each instead of forming one single cluster.

//This is the code//
var mapDiv = document.getElementById('newmap');
map = new google.maps.Map(mapDiv, {
center: new google.maps.LatLng(latitude, longitude),
zoom: zoom,
panControl: true,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions:
{
position: google.maps.ControlPosition.LEFT_TOP,

         },
        streetViewControl: true,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    });

var new_arr=new Array();
function addMarker1(locations,outletname,outletData)
{
var markers1 = locations.map(function(location, i)
{
return new google.maps.Marker
({
position: location,
});
});

              var markerCluster = new MarkerClusterer(map, new_arr,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
              new_arr=new_arr.concat(markers1);
              markerCluster.resetViewport();
              markerCluster.clearMarkers();
              markers = [];
              markerCluster.removeMarker(new_arr);
              markerCluster.addMarkers(new_arr);
              markerCluster.redraw();

}
// this is sending location in patches of 10000 each//
addMarker1(j,outletname,outletData);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions