[OpenLayers-Users] Drawing "Area of Interest" rectangle

Armin Burger armin.burger at gmx.net
Sun Mar 7 12:48:27 EST 2010


Hi all

I'm looking for a possibility for a tool that allows a user to draw a 
rectangle on the map that is used as area of interest for a spatial 
query. The rectangle should persist on the map so the user still sees 
for which region he was searching.

I tried a Control.DrawFeature with a Handler.Box. This draws a rectangle 
but it disappears after drawing.

If I use the Handler RegularPolygon then I have not found how to limit 
the drawing to a straight rectangle (I got just a square that a user can 
still turn). In addition, this drawing is added to a layer and this 
layer is visible in the LayerSwitcher. Is there a possibility to avoid 
the drawing layer being added to the Switcher?

Thanks in advance for any hints or pointing me to an example.

Armin



More information about the Users mailing list