本文介紹了Leaflet - 將控件放在 div 地圖之外的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我制作了以下應用程序:http://lae2.alwaysdata.net/carte/exppng/
I made the following app : http://lae2.alwaysdata.net/carte/exppng/
我想將我的兩個控件(leaflet-control-zoom 和leaflet-control-layers)放在 div 地圖之外.例如,我想在灰色區域內使用它們.
I'd like to put my two controls (leaflet-control-zoom and leaflet-control-layers) outside the div map. I'd want to use them inside the grey area for example.
我想知道這是否可能:我尋找了一些技巧,但我沒有找到任何東西......
I'd like to know if it's possible : I looked for some tricks but I didn't find anything...
如果可以,你能幫幫我嗎?
If it is could you help me ?
謝謝!
推薦答案
您可能會對以下帖子感興趣:
You would probably be interested in the following posts:
- 獲取Leaflet的當前比例值
- https://gis.stackexchange.com/questions/83942/display-a-control-zoom-bar-outside-map-container-in-leaflet
本質上:
document.getElementById("myNewContainerId").appendChild(
L.control.layers(base, overlays).onAdd(map)
);
外部來源:
- https://groups.google.com/forum/#!searchin/leaflet-js/control$20onadd/leaflet-js/rKMZX3PKFuI
- https://groups.google.com/forum/#!searchin/leaflet-js/control$20onadd/leaflet-js/rKMZX3PKFuI
這篇關于Leaflet - 將控件放在 div 地圖之外的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!