Hey,

When viewing the map scaled out, you can see three versions of the world. If i put one marker in the center version, and one on the right version, you would think the system would put them all on the same part of the map when rendering them.

Looking at https://github.com/Leaflet/Leaflet/issues/1589, you need to tell LatLng objects to wrap() their coordinates.

The patch attached does this, although in some cases this may not be the desired response. Not sure how to handle it any other way.

Cheers,
Sam.

Comments

samhassell’s picture

Status: Active » Needs review
gcb’s picture

Issue summary: View changes
Status: Needs review » Fixed

Rolled into Dev. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

gcb’s picture

Version: 7.x-1.0-beta3 » 7.x-1.1
Category: Bug report » Feature request
Status: Closed (fixed) » Active

This should be configurable via the map config UI.

tauno’s picture

StatusFileSize
new2.4 KB

Added the ability to define the left and right parameters for Latlng.wrap().

milesw’s picture

One consequence of this (as it's been committed) is that it becomes impossible to show points on both sides of the dateline together. So points in Australia cannot be shown together with points in Hawaii -- they can only appear on separate sides of the world.

Normally you can accomplish this by adding 360 degrees to longitude. But when wrapping is forced for all points, this is no longer possible.