[OpenLayers-Users] Drawing and labelling a circle in OL 2.7

Andreas Hocevar ahocevar at opengeo.org
Wed Feb 10 03:47:48 EST 2010


Hi,

for drawing a circle you would use a DrawFeature control with a 
RegularPolygon handler. See 
http://www.openlayers.org/dev/examples/regular-polygons.html for an example.

Labeling features is possible, but requires at least OpenLayers 2.8. See 
http://www.openlayers.org/dev/examples/vector-features-with-text.html 
for an example.

Upgrading to a more recent version of OpenLayers should not cause you 
any big trouble.

Regards,
Andreas.

jbloc1878 at googlemail.com wrote:
> Hi does anyone have a code example of drawing a circle within open 
> layers 2.7? I was Reading through the open layers documentation but 
> cannot get it to work, also I am not sure if it is only for 2.8.
> 
> Also is it possible to label the circle with some text? Or any shape for 
> that matter polygon or line?
> 
> Thanks for any help in advance
> 
> Jay
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list