<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=171440221-10102009>Hi Salas,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=171440221-10102009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=171440221-10102009>use something like this to get your 
vertices:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=171440221-10102009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>function 
findRectangleFeaturAadded(feature) 
<BR>{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp; var GeomFromText = 
feature.geometry;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; var Msg = 
GeomFromText + "\n";<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; var 
theVertexes = GeomFromText.components[0].components;<BR>&nbsp;&nbsp;&nbsp; 
for(var i=0;i&lt;theVertexes.length;i++)<BR>&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; Msg 
+= theVertexes[i].x + ", " + theVertexes[i].y + "\n";<BR>&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; 
alert(Msg);<BR>}<BR>&nbsp;<BR>findRectangleFeaturAadded(features); </FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>with this as output:</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>POLYGON((796109.5644078 6668910.3633327,796223.32420378 
6668942.9087861,796219.44263594 6668874.8320578,796171.37091113 
6668860.7986972,796109.5644078 6668910.3633327))<BR>796109.5644078, 
6668910.3633327<BR>796223.32420378, 6668942.9087861<BR>796219.44263594, 
6668874.8320578<BR>796171.37091113, 6668860.7986972<BR>796109.5644078, 
6668910.3633327</FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>To build your sql you can pass feature.geometry instead of 
the polygon vertices.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>Your second question I don't 
understand.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>Perhaps add </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>featureAdded:&nbsp; function (feature){ 
findRectangleFeaturAadded(feature) }, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>to your control options. This should call 
findRectangleFeaturAadded after a feature is added.<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>Regards</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=171440221-10102009><FONT face=Arial 
color=#0000ff size=2>Arnd</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> fsalas [mailto:fsalas@geocuba.cu] 
<BR><B>Gesendet:</B> Samstag, 10. Oktober 2009 22:32<BR><B>An:</B> Arnd 
Wippermann<BR><B>Cc:</B> users@openlayers.org<BR><B>Betreff:</B> Re: 
[OpenLayers-Users] How obtain the vertex in openlayer<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Thanks , Arnd </FONT></DIV>
<DIV><FONT face=Arial size=2>I tested with</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>var findRectangle = new 
OpenLayers.Control.DrawFeature(polygonLayer,OpenLayers.Handler.RegularPolygon,{<BR>id: 
'defaultControl01',<BR>title: "Klikk eller dra ut firkant rundt objekt i kartet 
for å finne mer informasjon",<BR>handlerOptions: {sides: 4, irregular: 
true},<BR>displayClass: 'findRectangle'&nbsp; 
,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>displayClass: 
'olControlDrawFeaturePolygon'<BR>}<BR>);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;function findRectangleFeaturAadded(feature) 
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp; var theVertexes = polygonLayer.features[0].geometry;<BR>&nbsp; 
alert(theVertexes);<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>This function show the 4 vertex in this format 
<SPAN class=812002821-08102009><FONT face=Arial color=#0000ff 
size=2>POLYGON((-1487158.8221094 -2661231.5764062,1878516.406875 
-2504688.5425,3209132.1950781 -6653078.9410156,-1174072.7542969 
-6300857.1147266,-1487158.8221094 -2661231.5764062))</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff>My question is : How I can obtain each vertex for example 
vertice[0].lat , vertice[0].long, .........</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff>And my second question is .</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff>In this test only draw one poligon with 4 vertex , how I implement 
double click for a finish the draw&nbsp; polygon </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff>thanks , </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=812002821-08102009><FONT 
color=#0000ff>Regards Salas</FONT></SPAN></DIV>
<DIV><BR>&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=arnd.wippermann@web.de href="mailto:arnd.wippermann@web.de">Arnd 
  Wippermann</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=fsalas@geocuba.cu 
  href="mailto:fsalas@geocuba.cu">'fsalas'</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=users@openlayers.org 
  href="mailto:users@openlayers.org">users@openlayers.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, October 08, 2009 4:32 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> AW: [OpenLayers-Users] How 
  obtain the vertex in openlayer</DIV>
  <DIV><BR></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=812002821-08102009>Hi,</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=812002821-08102009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=812002821-08102009>this is the way to get the vertexes of&nbsp;a polygon 
  feature:</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var theVertexes 
  = thePolygonFeature.geometry.components[0].components;</FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>for(var 
  i=0;i&lt;theVertexes.length;i++)<BR>&nbsp;&nbsp;&nbsp; ... 
  theVertexes[i];</FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=812002821-08102009><FONT face=Arial 
  color=#0000ff size=2>or use </FONT></SPAN><SPAN class=812002821-08102009><FONT 
  face=Arial color=#0000ff size=2>vectorLayer.features[0].geometry, that returns 
  the wkt string for the polygon feature</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=812002821-08102009><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=812002821-08102009><FONT face=Arial 
  color=#0000ff size=2>POLYGON((-1487158.8221094 -2661231.5764062,1878516.406875 
  -2504688.5425,3209132.1950781 -6653078.9410156,-1174072.7542969 
  -6300857.1147266,-1487158.8221094 -2661231.5764062))</FONT></SPAN><FONT 
  face=Arial color=#0000ff size=2></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=812002821-08102009></SPAN><FONT face=Arial><FONT 
  color=#0000ff><FONT size=2>A<SPAN 
  class=812002821-08102009>rnd</SPAN></FONT></FONT></FONT><BR></DIV>
  <DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org 
  [mailto:users-bounces@openlayers.org] <B>Im Auftrag von 
  </B>fsalas<BR><B>Gesendet:</B> Donnerstag, 8. Oktober 2009 23:07<BR><B>An:</B> 
  users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] How obtain the 
  vertex in openlayer<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hi, 
  </FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I need obtain the list of the vertex of my 
  polygon becouse after that I need to pass this value to POLYGON parameters and 
  obtain all the objects inside the polygon.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I use this</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV>
  <DIV><FONT face=Arial size=2>var drawpolygon = new 
  OpenLayers.Control.DrawFeature(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  polygonLayer, 
  OpenLayers.Handler.Polygon,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  {displayClass: 
  'olControlDrawFeaturePolygon'}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  );</FONT></DIV></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp; panel.addControls([new 
  OpenLayers.Control.Navigation(), drawpolygon]);</FONT></DIV>
  <DIV><FONT face=Arial size=2>..</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2>.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial 
  size=2>************************************************************* This is 
  the Sql for postgis **************************</FONT></DIV>
  <DIV><FONT face=Arial size=2>SELECT&nbsp; cod,tipo,empresa,the_geom<BR>FROM 
  sennal <BR>WHERE sennal.the_geom &amp;&amp; GeomFromText('POLYGON((-85.47677 
  23.56344,-82.31771 23.51950,-82.33468 21.03659,-85.47677 23.56344))',4267) and 
  tipo = 
  'FV';<BR>*********************************************************</DIV></FONT>
  <DIV><FONT face=Arial size=2>How implement this ?</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Regards , salas</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>var drawpolygon = new 
  OpenLayers.Control.DrawFeature(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  polygonLayer, 
  OpenLayers.Handler.Polygon,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  {displayClass: 
  'olControlDrawFeaturePolygon'}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  );</FONT></DIV></BLOCKQUOTE></BODY></HTML>