[OpenLayers-Users] Drawing a polygon and retrieving it's geometric information

Ivan Grcic igrcic at gmail.com
Mon Feb 16 04:16:22 EST 2009


...or even better looak at featureAdded @
http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Control/DrawFeature-js.html

Cheers

On Mon, Feb 16, 2009 at 9:51 AM, Ivan Grcic <igrcic at gmail.com> wrote:
> Hi,
>
> double click closes polygon, and after that:
>
> vlayer.onFeatureInsert=function(feat){alert(feat.geometry)};
>
> Cheers,
> Ivan
>
> On Mon, Feb 16, 2009 at 12:17 AM, Bradley McLain
> <bradley_mclain at debortoliwines.com> wrote:
>> Hi all,
>>
>> What i would like to do is be able to draw a polygon on a map and then click
>> a button and have the geometric co-ordinates of that polygon displayed.
>>
>> I have been using a vector layer in association with the DrawFeature
>> control.
>>
>>  polygonEditor = new OpenLayers.Control.DrawFeature(vlayer,
>> OpenLayers.Handler.Polygon);
>> polygonEditor.activate();
>>
>> This draws the shape nicely however i have been unable to work out how to
>> close this shape when done and then extract the information about it.
>>
>> Brad
>>
>>
>> --
>> Bradley Mclain
>> Systems Administrator Trainee
>> De Bortoli Wines Pty limited
>> De Bortoli Rd, BILBUL NSW  2680
>> e:  bradley_mclain at debortoliwines.com
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
>
>
> --
> Ivan Grcic
>



-- 
Ivan Grcic



More information about the Users mailing list