Closed ianrenton closed 2 months ago
The Repeating Marker Layer comes up occasionally as the solution to this, however it does not interact well with the Overlapping Marker Spiderfier plugin that we use. Work is ongoing in the repeating-marker-layer
branch to address this, but it is proving difficult. See #29.
Might be easiest just to manually wrap the markers' longitudes if user geolocation is known. If no geolocation is available, we keep a Greenwich-Meridian-centric view and have all markers shown as -180 to +180 longitude. Once geolocation is available, all marker icon longitudes become wrapped to 180 degrees either side of the user's longitude, even if that goes >180 or <-180.
This lets Leaflet wrap properly, and avoids the extra complications of interaction with the Spiderfier.
This won't give you the ability to scroll more than one Earth horizontally without losing the markers, but should be good enough for now.
The only bug I can see with this is the great circle line; while the distance and bearing is correctly calculated, the line itself is drawn assuming only -180<x<180 longitudes are in use:
Fixed the great circle line drawing, should be enough to call this issue resolved now.
Currently, Field Spotter uses a very Grenwich-Meridian-centric idea of the world, and the global set of markers is shown only once, between -180 and +180 longitude.
This works fine for me in the UK but for others around the world, it presents a problem. For an Australian user for example, all the spots are to the west of them, even ones in the Americas which would be better shown to the east. The great circle line also shows the "long path" rather than the short when a spot is clicked.
We need to find a way to display the spots appropriately regardless of where the user is in the world.