Add worldCopyJumpCenter option to Map #6723
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Adds an option to Map.Drag to make worldCopyJump prefer a central longitude different to 0.
Rationale:
One of the simpler options to handle the issue of longitude wrapping is worldCopyJump, which avoids the need to duplicate or move markers.
For maps concerned principally with the Americas, Europe and the Atlantic between them, it works well: simply place all your markers with longitudes between -180 and 180 as usual, and worldCopyJump will keep things fairly sensible.
Unfortunately, for maps where the region of interest is the Pacific (i.e. crosses the antimeridian), it does not work as well: if we don't want to duplicate layers, we should place our markers in the longitude range [0,360] so that they can all be visible at once; but then worldCopyJump in its current incarnation is no longer useful, since it will jump us over to -180 if we pan too far east.
With this new option set to 180 and markers placed in the [0,360] range, everything works nicely.