[OpenLayers-Users] Circles

Lehtonen, Mika mika at digikartta.net
Tue Dec 2 09:10:02 EST 2008


Hi Kenny,

it depends on whether you want to draw a "circle" or construct it on 
other ways. If you want to draw a circle, you can do it by adding 
control for it.

circle = new OpenLayers.Control.DrawFeature(vlayer,
OpenLayers.Handler.RegularPolygon,
{handlerOptions: {sides: 40} });
map.addControl(circle);

I am not sure how to construct it by code but I guess you have to 
construct a geometry first:
http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html
and then a feature from it. Wiser men will tell you.

- mika -

Kenny kirjoitti:
> Hi Mika, Christopher, 
>
> I have been trying to do this for a while now and still haven’t figured it
> out, 
>
> Mika, would it be possible for you to show us an example? 
>
> Thanks 
>
> Kenny 
>
> -----Original Message----- 
>
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
> Behalf Of Lehtonen, Mika 
>
> Sent: 02 December 2008 03:34 PM 
>
> To: Heidt, Christopher M. 
>
> Cc: OpenLayers 
>
> Subject: Re: [OpenLayers-Users] Circles 
>
> Hi, 
>
> I've been using regular polygon for that (with like 40 sides). I don't 
>
> know if there's another way. 
>
> - mika - 
>
> Heidt, Christopher M. kirjoitti: 
>
>   
>
>   
>> Probably a dumb question, but how can I create a circle feature using 
>>     
>
>   
>> the api? 
>>     
>
>   
>
>   
>> I'm hoping you're not going to say I have to generate a bunch of 
>>     
>
>   
>> points an make a polygon :( 
>>     
>
>   
>
>   
>> ------------------------------------------------------------------------ 
>>     
>
>   
>
>   
>> _______________________________________________ 
>>     
>
>   
>> Users mailing list 
>>     
>
>   
>
>   
>> http://openlayers.org/mailman/listinfo/users 
>>     
>
>   
>
> _______________________________________________ 
>
> Users mailing list 
>
> Users at openlayers.org 
>
> http://openlayers.org/mailman/listinfo/users 
>
>
>   _____  
>
> I am using the Free version of SPAMfighter <http://www.spamfighter.com/len> 
> We are a community of 5.7 million users fighting spam.
> SPAMfighter has removed 9749 of my spam emails to date.
> The Professional version does not have this message
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   



More information about the Users mailing list