我对 JS 很陌生,所以也许我的问题很容易解决,尽管我已经花了很多时间在上面。
我将 Mapbox 与 leaflet api 一起使用,我想在缩小时禁用水平世界地图的重复。我已经探索了 maxBounds 属性,但并不令人满意,因为我想将 map 隐藏在边界之外。基本上,我想要这个结果 http://jsfiddle.net/zF6bf/但不是“ Canvas ”,我想要这张 map ,存储在 mapbox.com 上:cartogrph.hbem5mod
此外,我想禁用拖动和缩放处理程序,因此我正在寻找与以下兼容的解决方案:
// disable drag and zoom handlers
map.dragging.disable();
map.touchZoom.disable();
map.doubleClickZoom.disable();
map.scrollWheelZoom.disable();
// disable tap handler, if present.
if (map.tap) map.tap.disable();
谁能帮帮我?我会非常感激。
提前致谢, 乔纳斯
最佳答案
<script>
var map = L.mapbox.map('map','cartogrph.hbem5mod', {
// these options apply to the tile layer in the map
tileLayer: {
// this map option disables world wrapping. by default, it is false.
continuousWorld: false,
// this option disables loading tiles outside of the world bounds.
noWrap: true
}
}).setView([38, -102.0], 5);
</script>
关于javascript - 使用 mapbox 禁用世界地图的水平重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21985064/