如何旋转leaflet.js地图 [英] how to rotate leaflet.js map

查看:843
本文介绍了如何旋转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贴图.您将需要这些丑陋的技巧之一,或者从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地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆