I'm quite new to JS, so maybe my problem will be easy to solve, though I already spent many hours on it.
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.
Thanks in advance, Jonas
See the docs: Disable World Wrapping
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With