AW: [OpenLayers-Users] Identifying geometry type

Coup Coup tencoupons55 at yahoo.com
Thu Jul 7 08:21:42 EDT 2011


Thank you Arnd, that works.

For anyone's interest, a round-about way of distinguishing a point from a polygon is to check the number of points within it so this works (was backup plan):
yourSelectedLayer.features[0].geometry.getVertices().length

--- On Wed, 7/6/11, Arnd Wippermann <arnd.wippermann at web.de> wrote:

From: Arnd Wippermann <arnd.wippermann at web.de>
Subject: AW: [OpenLayers-Users] Identifying geometry type
To: "'Coup Coup'" <tencoupons55 at yahoo.com>
Cc: users at openlayers.org
Date: Wednesday, July 6, 2011, 1:43 PM



 
Hi,
 
that would be a possibility
yourSelectedLayer.features[0].geometry.CLASS_NAME
 
Arnd



Von: openlayers-users-bounces at lists.osgeo.org 
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Coup 
Coup
Gesendet: Mittwoch, 6. Juli 2011 22:25
An: 
openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] 
Identifying geometry type




  
  
    I have several layers on a map. In this case, I have a 
      single geometry on each layer. THe geometries are either Polygon, 
      MultiPolygon or Points.

I need to be able to identify the geometry 
      type so I can act accordingly when the layer is selected.

Does 
      anyone know how to identify the geometry 
type?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110707/8336b06a/attachment.html


More information about the Users mailing list