<div dir="ltr">I use a different method for getting the polygons as a text string, keep in mind this is for catching all polygons in the given layer and not for a selected or recently drawn polygon.<br><br><span style="color: rgb(0, 153, 0);">//put in your map init() function</span><br>
wkt = new OpenLayers.Format.WKT();<br><br><span style="color: rgb(0, 153, 0);">//Put this where you desire it to be and modify as necessary</span><br>for (var i=0;i<vectors.features.length;i++) {<br> <span style="color: rgb(0, 153, 0);">//if (selFeatureID == vectors.features[i].id) {}</span><br>
var str = wkt.write(vectors.features[i]);<br> ajaxSendParams += "&bdySegment="+escape(str);<br>}<br><br><br><br><br clear="all">--<br>Nathan Gerber<br>
<br><br><div class="gmail_quote">On Thu, Sep 11, 2008 at 7:31 AM, Bijoy <span dir="ltr"><<a href="mailto:bijoya@rediff.co.in">bijoya@rediff.co.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hey GeoUser,<br>
<br>
Instead of using getComponentsString(), I use toString()... and, I get the<br>
result... but the format is different. Might have to do some string<br>
manipulation... However, this is good to go for now...<br>
<br>
Thanks man!!<br>
<BIJOY><br>
<div class="Ih2E3d"><br>
<br>
Bijoy wrote:<br>
><br>
> Hi GeoUser,<br>
><br>
> I tried it as shown below:-<br>
> function check(obj){<br>
> var points = vectors.features[0].geometry.getComponentsString(); //<br>
> where vectors is myVectorLayer<br>
> alert(points);<br>
> polycontrol.deactivate();<br>
> }<br>
> It doesn't work. I get error like "this.components[i].toShortString is not<br>
> a function" in the<br>
> OpenLayers.Util.applyDefaults(geometry,t...sh(this.components[i].toShortString());}<br>
><br>
> It seems so close... and yet so far... :)<br>
> <BIJOY><br>
><br>
><br>
><br>
><br>
> GeoUser wrote:<br>
>><br>
>> Try with something like this:<br>
>><br>
>> var points = myVectorLayer.features[0].geometry.getComponentsString();<br>
>><br>
>> does it work for you?<br>
>><br>
><br>
><br>
<br>
--<br>
</div>View this message in context: <a href="http://www.nabble.com/How-do-I-get-my-polygon-coordinates--tp19413142p19432872.html" target="_blank">http://www.nabble.com/How-do-I-get-my-polygon-coordinates--tp19413142p19432872.html</a><br>
<div><div></div><div class="Wj3C7c">Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>