問(wèn)題描述
我正在嘗試將地圖(或 tileLayer)旋轉(zhuǎn) x 度.我的研究沒(méi)有產(chǎn)生任何不是真正骯臟的黑客的結(jié)果,并且在我的情況下不起作用.
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 方式來(lái)旋轉(zhuǎn)地圖?
Is there a native leaflet.js way of rotating the map ?
(css旋轉(zhuǎn)不影響鼠標(biāo)移動(dòng))
(css rotate doesn't affect the mouse movement)
推薦答案
很抱歉,沒(méi)有辦法原生旋轉(zhuǎn) Leaflet 地圖.您將需要其中一個(gè)丑陋的 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
這篇關(guān)于如何旋轉(zhuǎn)leaflet.js 地圖的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!