[OpenLayers-Users] Accessing the events of DrawFeature and ModifyFeature to calculate area

Albert Ang bluesky003 at gmail.com
Thu Feb 18 04:28:24 EST 2010


Dear all,

I need assistance in using the events of DrawFeature and ModifyFeature. Can
anyone provide some examples? I use the DrawFeature and ModifyFeature as
following but need guidance on how to use the events of DrawFeature
(featureadded) and ModifyFeatures (featuremodified). Basically I like to use
the feature.geometry.getGeodesicArea() function to calculate area
dynamically when an user draws a polygon or when he modifies the polygon.

controls = {
                dpolygon: new OpenLayers.Control.DrawFeature(aoi,
                            OpenLayers.Handler.Polygon, drawOptions),
                modify: new OpenLayers.Control.ModifyFeature(aoi,
                                                             modifyOptions),
              selectVector: new OpenLayers.Control.SelectFeature(aoi,
wktOptions)
}

Thank you in advance.

Albert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100218/7c85921b/attachment.html


More information about the Users mailing list