javascript - Marker locations accumilate when adding a marker on a previously created Layer in Leaflet using MarkerClusterGroup -


i want add layer on top of google maps contains indoor map. , add incoming events contains latitudes , longitudes markers on layer contains indoor map.

as managed add layer on top of google map

var imagebounds = new l.latlngbounds([p, q], [r, s]); var imageurl = 'assets/img/indoor.svg'; indoormap = l.imageoverlay(imageurl, imagebounds, {opacity: 0.7});  layergroupindoor = new l.markerclustergroup(); var overlay = {'beacons': layergroupindoor}; layergroupindoor.addlayer(indoormap); layergroupindoorcontrol = l.control.layers(null, overlay).addto(map); 

then added markers dynamically layergroupindoor follows.

layergroupindoor.addlayer(markerobject); 

but when marker locations nearby (eg: 2 markers nearby) leaflet gives new averaged location shown below.

enter image description here

any suggestion visualize markers is?

best regards,

i refer read me [1] , made following change , got un-cluster @ zoom level

layergroupindoor = new l.markerclustergroup({ disableclusteringatzoom: 16 }); 
  1. https://github.com/leaflet/leaflet.markercluster

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -