禁用带有地图框的世界地图的水平重复 [英] Disable horizontal repeating of world map with mapbox

查看:129
本文介绍了禁用带有地图框的世界地图的水平重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对JS还是很陌生,所以尽管我已经花了很多时间了,但是也许我的问题很容易解决.

I'm quite new to JS, so maybe my problem will be easy to solve, though I already spent many hours on it.

我正在将Mapbox与传单api一起使用,并且在缩小时我想禁用水平世界地图的重复.我已经研究过maxBounds属性,但是由于我想将地图隐藏在边界之外,因此并不令人满意.基本上,我希望得到此结果 http://jsfiddle.net/zF6bf/,而不是"canvas" ",我希望将此地图存储在mapbox.com上:cartogrph.hbem5mod

I'm using Mapbox with the leaflet api, and I would like to disable the repeating of horizontal world maps when zooming out. I already explored the maxBounds properties, but it is not satisfying, as I want to hide the map outside the bounds. Basically, I would like to have this result http://jsfiddle.net/zF6bf/ but instead of "canvas", I would like to have this map, stored on mapbox.com : cartogrph.hbem5mod

此外,我想禁用拖动和缩放处理程序,因此我正在寻找一种与以下各项兼容的解决方案:

Moreover, I would like to disable drag and zoom handlers, so I'm looking for a solution which would be compatible with the following:

// 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();

有人可以帮助我吗?我真的很棒.

Can anyone help me? I would be really greatful.

预先感谢, 乔纳斯(Jonas)

Thanks in advance, Jonas

推荐答案

请参阅文档: 查看全文

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