[OpenLayers-Users] check line intersection while polygon editing

G. Allegri giohappy at gmail.com
Thu May 8 12:37:52 EDT 2008


>  Not as far as I'm aware; however, there is geometry.intersects(), which
>  you might be able to use to loop through a polygon and test all the
>  segments of a line for intersection? I'm not entirely sure though.

I knew geometry.intersects()... I have to find an efficient way to use
it. I'll give a try using it inside the AddPoint function within
OpenLayers.Handler.Point, starting withh the Path Handler for
simplicity.
I think I will do the following:
1. Extract tha last segment from the Line Geometry collection.
2 . Create a clone of the Line and remove the last component from it.
3. Verify the Geometry.intersects() between the two.
This should avoi the use of a loop...



More information about the Users mailing list