Longitude Wrapping Revisted
See original GitHub issueI have a situation where I want to show the US and Australia, zoomed out. I have a marker in Australia using lat/lon: [-29.5, 143]. With the default view, the marker is not visible, because I assume leaflet thinks that the Australia in view has a longitude of -215 or so. Panning right brings it into view.
I’ve set worldCopyJump to true, and yes, if I pan left far enough from the initial view, the marker eventually shows. But then its confusing in that a small pan right/left shows/hides the marker, to the end user it seems confusing.
http://jsfiddle.net/dfaivre/JKFgD/
- The initial state of the fiddle should be an empty map, with the US and Australia in view.
- Pan the map west a few degrees. The map flashes, a marker appears
- Pan the map east a few degrees. The map flashes, the marker disappears.
- Change worldCopyJump to
false, re-run the fiddle - You should get an empty map.
- Pan east until you get to Australia again. The marker should now appear
It seems that the expected behavior would always show the marker.
Issue Analytics
- State:
- Created 10 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to handle antimeridian/longitude-wrapping? · Issue #3794
wrapLongitude can be used to wrap longitude though this only works when higher zoom levels. The documentation suggests "preprocess[ing] the ...
Read more >Re: Lat/Lon to Polar: Revisited
Or you can use just one Radar2DCoordinateSystem to the (Latitude, Longitude) reference ... If you use a CachingCoordinateSystem to wrap your Radar2DCS, ...
Read more >Huygens' clocks revisited - PMC - NCBI - NIH
This behaviour is now called anti-phase synchronization. This paper presents an analysis of the behaviour of a large class of coupled identical ...
Read more >MapQuest Reverse Geocoder Revisited | Stop Making Sense
Before moving into the story, let's revisit the code (from an earlier post). [Microsoft. ... latitude, longitude)) { try { //Fix the geocoding...
Read more >getFootprint output self-intersections - Orekit usage - Orekit
I've been writing some classes to calculate coverage and revisit in python, ... These appear to be wrapped around at -180/180 degrees of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is pretty hacky but the only way I could solve the problem in @dfaivre’s second comment was by making 4 markers like this: http://jsfiddle.net/u90L0oLq/
var positiveLng = ((180+lng) + 180); var negativeLng = ((-180+lng) - 180);
Is there a better way to do this? My map has 188 markers, I don’t want to render 564 if I don’t have to.
I am having the same problem as porkloin (and many others.) I have features, both point and polygon, that are retrieved as geojson. These are all features around the Pacific. With the map centered at +!3, -165, I see all the features in the Eastern pacific. If I drag the map east a touch, then the eastern Pacific features disappear and the western Pacific features appear. I have worldCopyJump:true, and I’ve tried (to the limits of my control) to use the work-around of setting longitude values to be outside the +/-180 box, to no avail.
This is a serious flaw and, sadly, will likely prevent me from using leaflet, as I am developing software for the National and Pacific tsunami warning centers. The Pacific is the primary view.