[OpenLayers-Users] International date line and bounds [SEC=UNCLASSIFIED]

David Zwarg dzwarg+ol at azavea.com
Tue Jul 27 17:03:06 EDT 2010


Hello Piero,

You may have to adjust the coordinates to 'saddle' the IDL.  For example, a
rectangle with the coordinates:

170, 10  -------+------  -170, 10
   |            |            |
   |            |            |
   |           IDL           |
   |            |            |
   |            |            |
   |            |            |
170, -10  ------+------  -170, -10

May extend the "wrong way" around the globe.  If you manually adjust the
coordinates so they are all on the same side of the IDL, it will probably
work:

-190, 10  --------------  -170, 10
    |                         |
    |                         |
    |                         |
    |                         |
    |                         |
    |                         |
-190, -10  -------------  -170, -10

or:

170, 10  --------------  190, 10
   |                        |
   |                        |
   |                        |
   |                        |
   |                        |
   |                        |
170, -10  -------------  190, -10

Notice that in the last two examples, the X coordinates are either all
positive, or all negative. I have found this to work quite well; you can
even extend this to keep adding features to 'globes' that are beyond -180.
There is one thing to be wary of, though: when you do cross the date line,
the entire geometry will jump to the left or right by 1 globe
circumference.  I don't have a workaround for that, but you can trick OL by
adding features to the neighboring 'globes'.

-z

On Tue, Jul 27, 2010 at 7:03 AM, Piero Campa <piero.campa at gmail.com> wrote:
>
> Hi all,
> I'm drawing polygon over a Google base layer.
>
> Even though I set wrapDateLine to true in the Google base layer, the
Vector
> layer AND the temporary layer created by the RegularPolygon handler, still
> when I draw a polygon I cannot cross the IDL.
>
> Any idea guys?
> Thank you,
> Piero
>
> --
> View this message in context:
http://osgeo-org.1803224.n2.nabble.com/International-date-line-and-bounds-tp2541265p5341698.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users



--

David Zwarg
Software Developer at Azavea (formerly Avencia)

(215) 701-7718
dzwarg at azavea.com
http://www.azavea.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100727/ec7547b1/attachment.html


More information about the Users mailing list