Hi, Now I have drawn the rectangle. One more query, Before drawing a rectangle, I want to clear/remove the rectangles, if any. How to do it? Thanks. Sveen Atle Frenvik (Geomatikk IKT) [via OSGeo.org] wrote: Re: [OpenLayers-Users] draw rectangle over the map On 07/02/2010 10:58 AM, Iswaria wrote: > Hi all, > > In this link http://openlayers.org/dev/examples/custom-control.html , the > rectangle we draw by pressing the shift key disappears, as soon as we > complete drawing the rectangle. > > I want to display the rectangle, what user has drawn. > > What should be done to display the rectangle. > > Thanks, > Iswaria > It seems to me like the box handler returns a set of pixels describing the box, and that the code added gets the coordinates for this. I guess a simlpe approach is the use the coordinates and construct a polygon geometry and then add this as a feature to a vector layer on the map, and then apply a style to make it look like the box. -atle -- Atle Frenvik Sveen Utvikler Geomatikk IKT AS tlf: 45 27 86 89 [hidden email] _______________________________________________ Users mailing list [hidden email] http://openlayers.org/mailman/listinfo/users View message @ http://osgeo-org.1803224.n2.nabble.com/draw-rectangle-over-the-map-tp5246929p5246953.html To unsubscribe from draw rectangle over the map, click here . -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/draw-rectangle-over-the-map-tp5246929p5247067.html Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
