Search code examples
javascriptangularjsionic-frameworkleafletangular-leaflet-directive

LeafletJS handle markers on continuous map


I am seeing one problem with the LeafletJS map that the map is continous (infinite) to East and West. Howerver, it does not handle marker positions right. When I set a marker and focus on the marker I for sure see it in the right place. But when I rotate the map 1x around it's axis and arrive at the very same position, the marker is not there.

This is a problem when someone in Los Angeles for instance pans west to see his marker in Sydney, Australia, the marker does not appear. He has to pan east all the way to see the marker. Any solution to this?


Solution

  • Enable the worldCopyJump option when you are creating your map.

    worldCopyJump

    Boolean false

    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.