[OpenLayers-Users] Circles

Arnd Wippermann arnd.wippermann at web.de
Tue Dec 2 13:34:42 EST 2008


This is some code to create a regular polygon:

//Openlayers.Geometry.Point
var origin = {};
origin.x = map.getCenter().lon;
origin.y = map.getCenter().lat;

//create Regular Polygon Geometry
//OpenLayers.Geometry.Polygon.createRegularPolygon = function(origin,
radius, sides, rotation)
var objF = OpenLayers.Geometry.Polygon.createRegularPolygon(origin,
map.getExtent().getHeight()/20, 6, 90);

//create vector layer
var vlayer = new OpenLayers.Layer.Vector("Editable Vectors");
map.addLayer(vlayer);
//or use a existing vector layer
//var vlayer = map.layers[i]; //i - index of vector layer

//create feature
var theFeature = new OpenLayers.Feature.Vector(objF,null,null);

//add feature
vlayer.addFeatures(theFeature);

Arnd Wippermann 

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Kenny
Gesendet: Dienstag, 2. Dezember 2008 14:52
An: Users at openlayers.org
Betreff: Re: [OpenLayers-Users] Circles
Wichtigkeit: Hoch

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