Badal,
All the features on client side are stored in an OpenLayers.Layer.Vector layer. You can get it on client like code below:
var layer = map.getLayer(“EditOverlay”);
var features = layer.features. // All the features drawn
The shapes are managed by different openLayers Controls. The drawControl are used to draw shapes and add them to the vector layer. The ModifyControl used to edit or delete the shape from map. Here are the definition of them:
this.paintControls = {
Point: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.Point, { id: 'Point' }),
Line: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.Path, { id: 'Line' }),
Polygon: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.Polygon, { id: 'Polygon' }),
Square: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.RegularPolygon, { id: 'Square' }),
Circle: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.RegularPolygon, optionsCircle),
Ellipse: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.RegularPolygon, optionsEllipse),
Rectangle: new OpenLayers.Control.DrawFeature(this.editOverlay, OpenLayers.Handler.RegularPolygon, optionsRectangle),
Modify: new OpenLayers.Control.ModifyFeature(this.editOverlay, optionsEdit),
Normal: null
};
If you want to know something about OpenLayers, Please get the detail from openlayers.org . I’m not very sure the meaning about “but condition is only one point/polygon shap available on the map”, can you detail the operation steps about it?
Thanks,
Johnny