how can i get the coordinates value on drawing of polygon at each mouse click , actually i want to store each coordinates i clicked  during vector drawing.<br><br> currently i use this for vector drawing controls but at time of drawing i cannot get the coordinates at each point i clicked during drawing.<br>
<br>    controls = {<br>        point: new OpenLayers.Control.DrawFeature(vectors,<br>                                OpenLayers.Handler.Point),<br>        line: new OpenLayers.Control.DrawFeature(vectors,<br>                                OpenLayers.Handler.Path),<br>
        polygon: new OpenLayers.Control.DrawFeature(vectors,<br>                                OpenLayers.Handler.Polygon),<br>        drag: new OpenLayers.Control.DragFeature(vectors),<br>       select: select,<br>        regular: new OpenLayers.Control.DrawFeature(vectors,<br>
                            OpenLayers.Handler.RegularPolygon,<br>                            { handlerOptions: { sides: 5} }),<br>        modify: new OpenLayers.Control.ModifyFeature(vectors)<br>           };<br><br>    for (var key in controls) {<br>
        map.addControl(controls[key]);<br>    }<br><br>and for reading mouse i use : <br>    map.addControl(new OpenLayers.Control.MousePosition({element:document.getElementById(&quot;longlats&quot;), numdigits:3}));<br><br>
if it is in navigation only mode i can read and store mouse click as :<br>OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {<br>    defaultHandlerOptions: {<br>        &#39;single&#39;: true,<br>        &#39;pixelTolerance&#39;: 0 //,       // &#39;stopSingle&#39;: false    <br>
    },<br>    initialize: function(options) {<br>        this.handlerOptions = OpenLayers.Util.extend(<br>                        {}, this.defaultHandlerOptions<br>                    );<br>        OpenLayers.Control.prototype.initialize.apply(<br>
                        this, arguments<br>                    );<br>        this.handler = new OpenLayers.Handler.Click(<br>                        this, { &#39;click&#39;: this.trigger }, this.handlerOptions<br>                    );<br>
    },<br>    trigger: function(e) {<br>        var lonlat = map.getLonLatFromViewPortPx(e.xy);<br>        var pos = &quot;Longitude: &quot; + lonlat.lon + &quot; E, &lt;br/&gt;Latitude: &quot; + lonlat.lat + &quot;N&quot;;        // alert(&quot;You clicked near &quot; + lonlat.lat + &quot; N, &quot; +lonlat.lon + &quot; E&quot;);//OpenLayers.Util.getElement(&quot;longval&quot;).innerHTML = pos;<br>
        document.data1.longval.value = lonlat.lon;<br>        document.data1.latval.value = lonlat.lat;<br><br>but i don&#39;t got idea how can i combine these all to function together while drawing vector point, line and polygon<br>
<br><br>/nabin,<br>