[OpenLayers-Users] Correct dateline wrapping or correct map bounds, but not both?

Jani Patokallio jpatokal at iki.fi
Mon Jun 29 21:48:07 EDT 2009


David Zwarg wrote:
> I was coming across a very similar problem to yours.  I needed to
> represent networks that spanned the IDL, with points and lines.
> (http://www.sourcemap.org/beta/stage/index.php/objects/object-105)  
> The way that I got around the wrapping was to add points and lines as
> multi-point and multi-line geometry collections.  1 geometry would lie
> within the bounds of the coordinate system (-180 to 180, in your case
> below), and the other geometries would be -x and +x * 360.  For
> example, mapping 0, 51.47722 (Greenwich, UK), would place points at
> -360, 0, and 360.  One could extend this as many times as necessary,
> based on the aspect and maxExtent of the map.
Yes, I'm already doing this as well, and it works fine for vectors.  See
this message for a minor optimization that renders the alternate
geometries only when necessary:
http://openlayers.org/pipermail/users/2009-February/010513.html

But the problem I'm having this time is different: depending on the
exact dimensions of the map div, there is sometimes a gap of pure white
(well, blue) up to 100px or so wide at the position of the date line,
between Russia and Alaska.  This will not happen if you have a fixed map
width though.

Cheers,
-jani




More information about the Users mailing list