Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leaflet/Mapbox Markers Don't Repeat After Scrolling Around the Atlas

Tags:

leaflet

mapbox

Screenshot from Mapbox docs: Mapbox screenshot

It seems as though Mapbox won't render given coordinates multiple times on the same map, even if the map is zoomed out far enough to view the same latitude and longitude pairing twice. Is there a way around this?

like image 807
Walter Roman Avatar asked Mar 11 '15 03:03

Walter Roman


1 Answers

Use the worldCopyJump option of L.mapbox.map (L.map):

With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.

Working example on Plunker: http://plnkr.co/edit/cbDNH6Rs5SbBKGY7LQGe?p=preview

Reference: http://leafletjs.com/reference.html#map-worldcopyjump

like image 177
iH8 Avatar answered Oct 18 '22 12:10

iH8