2015-11-01 26 views
0

我想在包含室內地圖的Google地圖上添加圖層。 然後在包含室內地圖的圖層上添加包含緯度和經度的傳入事件作爲標記。使用MarkerClusterGroup在傳單中以前創建的圖層上添加標記時標記位置會累加

至於現在我設法對谷歌地圖

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); 

然後,我添加標記動態到layerGroupIndoor如下的頂部添加的層。

layerGroupIndoor.addLayer(markerObject); 

但是當標記位置都在附近(例如:2個標記是在附近)的小葉給出了一個新的平均位置,如下所示。

enter image description here

任何建議,爲可視化標記,因爲它是什麼?

最好的問候,

回答

相關問題