2
votes

Mapbox can continuously wrap tile layers such that you can scroll infinitely to the left and right over a repeating map of the world.

I have added a feature layer to a world map which displays some markers and, for some reason, this feature layer does not also wrap. The markers are only present on the original iteration of the world tiles layer.

I've tried using the noWrap: false options property that controls this characteristic on the tile layer when adding a feature layer, but it doesn't seem to have any effect.

Is there any way to do this?

2

2 Answers

2
votes

Use the worldCopyJump option

example:

var map = L.mapbox.map('map', 'your.mapid', {center: [lat, long],
                                                     zoom: 4,
                                                     worldCopyJump: true
                                                    });
0
votes

Not sure if I understand your question...

You can use

maxBounds: [[-90,-180],[90,180]]

for example

map = L.mapbox.map('map', '<some map id>',{minZoom: 0, maxZoom: 10, maxBounds: [[-90,-180],[90,180]]});

https://www.mapbox.com/mapbox.js/example/v1.0.0/maxbounds/