how to make a clustering of map marker

How to create map marker clustering after zooming in in a marker for example upon intial load of map you can see marker of usa, china and india and when i zoom in on the marker of india it will show the marker for the cities or province of india then when I zoom out the marker of cities of india will slowly disappear and return to the markers of usa,china and india


3 Replies

DP Deepaa Pragaasam Syncfusion Team December 26, 2017 11:36 AM UTC

Hi Kyle, 

We have analyzed your query and prepared sample for the same. In the sample initially the markers are loaded for the single country(USA) and on zooming the markers for the inner states are added  
[JS] 
  <div style="min-height:435px" id="maps"></div> 
         $("#maps").ejMap({ 
    markerSelected:"markerSelected", 
}); 
   $(window).on('mousewheel', function (event) { 
                var map = $("#maps").data("ejMap");              
                   if (window.zoomedLevel == 1) { 
                       map.model.layers[0].markers = initalDataSource; 
                       map.model.layers[0].markerTemplate = "template" 
                   } 
                   else {                
                //marker datasource loaded for inner states 
                        map.model.layers[0].markers = dataSource; 
                        map.model.layers[0].markerTemplate = "template1"; 
                   } 
                 map.refresh(); 
                  if ((window.latitude && window.longitude) !== undefined) 
                       $("#maps").ejMap("navigateTo", window.latitude, window.longitude, window.zoomedLevel); 
                    
                  }); 


Initial Map rendered 
 

Map after zooming 
 

We have attached the sample for your reference 

 


Please let us know if you have any concerns 

Regards, 
Deepaa. 



KO Kyle Oliveros December 28, 2017 04:03 AM UTC


Hi Deepaa

can you make the JS sample as an HTML not as aspx? 


Thanks


SK Sanjith Kesavan Syncfusion Team January 2, 2018 10:06 AM UTC

Hi Kyle, 

Thanks for your reply. We have modified the sample as per your requirement. Please find the sample from below link. 

Sample link: Sample 

Thanks, 
Sanjith. 


Loader.
Up arrow icon