[OpenLayers-Users] Map wrapping?

Christopher Schmidt crschmidt at metacarta.com
Sat Mar 8 15:37:28 EST 2008


On Sat, Mar 08, 2008 at 03:33:29PM -0500, Ken Stuart wrote:
> The results might include vectors extending across the dateline, as
> well as placing custom point icons that overlie the dateline. Further,
> it's likely that we'd want to incorporate drag-boxes for zooming or
> annotations that cross it as well.
> 
> Are the dateline issues likely to interfere with those needs? 

Yes.

> Are they being worked on?

Nope.

(Note that these problems aren't solved in the Google Maps API, or any
other API that I'm aware of: Even Google Earth has problems with
wrapping the dateline and the poles.)  

Your best bet, in my opinion, is to project your coordinates such that
positions that wuold be less than 0 are 'wrapped' to the righthand side.
OpenLayers has no qualms about displaying data across a 180 degree
border -- so you simply take anything that's less than 0, add 360 to it,
and use that as your data. 

Obviously, this may be non-trivial, depending on your data, but it then
removes the dateline wrapping issues that one might run into, since
there is no longer a 'dateline' in any meaningful sense.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list