Is it possible to get information while editing EditLayer? For example, while tracking a polygon, I would like to get the number of vertices and show it on a label without having to go to the server before I finish the polygon. Also, is it possible to get the radius of a circle and show it on a label while tracking it without having to the server?
Information while editing EditLayer
Adolfo,
If you want to get vertices or radius of circle without having to go to the server side, you could do it on the client side using client events in the OnMapCreated function which has a parameter refer to the OpenLayers map object.
First you must get the EditLayer from the map using the bellowing code:
var editOverlay = olMap.getLayersByName(‘EditOverlay’);
and then register events on the vector layer:
editOverlay.events.on({ ‘featureselected’: featureSelected });
You can get more information about the events at the bellowing address,
dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Layer/Vector-js.html#OpenLayers.Layer.Vector.EVENT_TYPES
And last in the event handler, you could get the vertices or the radius or others.
Any more questions please let me know.
Thanks,
Howard