CloudMade/Leaflet — Issue #450: Date line issue for point features
Author: bpeng
Created: 2012-01-30 21:02:07+00:00
State: open

Hi

I am trying to show point features close to the Date line (e.g. -41.3, 172.1), when the map is moved (paned) to a position that the map.getCenter().lng becomes negative (e.g. -179), the points disappeared while the background map shows correctly:
http://dl.dropbox.com/u/5294551/leaflet.html

I have tried to reset the coordinates of the points by subtracting 360 using map.on('moveend' ):

pointMarker.setLatLng(new L.LatLng(pointMarker.getLatLng().lat, pointMarker.getLatLng().lng - 360));

But it doesn't work correctly, it seems the map bounds becomes (-175 ~ 158) and I couldn't figure out an algorithm to calculate the coordinate of the points in such situation (I can do that with OpenLayers).