本文介紹了如何旋轉leaflet.js 地圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在嘗試將地圖(或 tileLayer)旋轉 x 度.我的研究沒有產生任何不是真正骯臟的黑客的結果,并且在我的情況下不起作用.
I'm trying to rotate the map (or tileLayer) by x degrees. My research didn't produced any results that are not really dirty hacks and in my case doesn't work.
是否有原生的leaflet.js 方式來旋轉地圖?
Is there a native leaflet.js way of rotating the map ?
(css旋轉不影響鼠標移動)
(css rotate doesn't affect the mouse movement)
推薦答案
很抱歉,沒有辦法原生旋轉 Leaflet 地圖.您將需要其中一個丑陋的 hack 或從 Leaflet 切換并查看 Mapbox GL JS 或 Open Layers 3:
Sorry to say, there is no way of natively rotating a Leaflet map. You'll need one of those ugly hacks or switch away from Leaflet and take a look at Mapbox GL JS or Open Layers 3:
- http://www.mapbox.com/mapbox-gl-js/example/navigation/
- http://openlayers.org/en/latest/examples/rotation.html
這篇關于如何旋轉leaflet.js 地圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!