[OpenLayers-Users] How obtain the vertex in openlayer

Arnd Wippermann arnd.wippermann at web.de
Thu Oct 8 17:32:09 EDT 2009


Hi,
 
this is the way to get the vertexes of a polygon feature:
var theVertexes = thePolygonFeature.geometry.components[0].components;
 
for(var i=0;i<theVertexes.length;i++)
    ... theVertexes[i];
 
 
or use vectorLayer.features[0].geometry, that returns the wkt string for the
polygon feature
 
POLYGON((-1487158.8221094 -2661231.5764062,1878516.406875
-2504688.5425,3209132.1950781 -6653078.9410156,-1174072.7542969
-6300857.1147266,-1487158.8221094 -2661231.5764062))
 
Arnd

  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von fsalas
Gesendet: Donnerstag, 8. Oktober 2009 23:07
An: users at openlayers.org
Betreff: [OpenLayers-Users] How obtain the vertex in openlayer


       Hi, 
 
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.
 
I use this
.
.
.
.
var drawpolygon = new OpenLayers.Control.DrawFeature(
                polygonLayer, OpenLayers.Handler.Polygon,
                {displayClass: 'olControlDrawFeaturePolygon'}
            );
 
  panel.addControls([new OpenLayers.Control.Navigation(), drawpolygon]);
..
.
.
.
 
************************************************************* This is the
Sql for postgis **************************
SELECT  cod,tipo,empresa,the_geom
FROM sennal 
WHERE sennal.the_geom && GeomFromText('POLYGON((-85.47677 23.56344,-82.31771
23.51950,-82.33468 21.03659,-85.47677 23.56344))',4267) and tipo = 'FV';
*********************************************************
How implement this ?
 
 
Regards , salas
 
 
 
 
 
 
var drawpolygon = new OpenLayers.Control.DrawFeature(
                polygonLayer, OpenLayers.Handler.Polygon,
                {displayClass: 'olControlDrawFeaturePolygon'}
            );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091008/39ac8204/attachment.html


More information about the Users mailing list