[OpenLayers-Users] draw rectangle over the map

Sveen Atle Frenvik (Geomatikk IKT) Atle.Frenvik.Sveen at geomatikk.no
Fri Jul 2 05:04:25 EDT 2010


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
atle.frenvik.sveen at geomatikk.no

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100702/43f3e41b/attachment.html


More information about the Users mailing list