multiple marker on exact same position on a leaflet map

你离开我真会死。 提交于 2019-12-06 20:20:43

问题


We use leafletJS to show maps with round about 100 markers. Some of these markers are located on exact the same position. Marker2 is above Marker1 so Marker1 isn't visible. Is there a way to rotate Markers in a way that you can see there are more then one marker?


回答1:


may be you should look at https://github.com/Leaflet/Leaflet.markercluster plugin here demo - http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html




回答2:


we had the same problem, follows the jsFiddle with the solution we found http://jsfiddle.net/atma_tecnologia/mgkuq0gf/2/

var marker1 = new google.maps.Marker({
  position: myLatLng,
  map: map,
  icon: {
    url: image,
    size: new google.maps.Size(134,130), //different sizes
  },
  zIndex: 2, //different overlays
  title: '1º marker',
});


来源:https://stackoverflow.com/questions/22168558/multiple-marker-on-exact-same-position-on-a-leaflet-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!