[OpenLayers-Users] Irregular polygons

Sveen Atle Frenvik (Geomatikk IKT) Atle.Frenvik.Sveen at geomatikk.no
Tue Mar 2 08:32:42 EST 2010


I guess you could use 

OpenLayers.?Geometry.?Polygon (http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html), but the doc says it is constructed from an array of OpenLayers.?Geometry.?LinearRings, so I guess the safe bet is to use:

var poly = new OpenLayers.?Geometry.?Polygon([OpenLayers.?Geometry.? LinearRing([OpenLayers.?Geometry.?Point(lon1,lat1),OpenLayers.?Geometry. ?Point(lon2,lat2),OpenLayers.?Geometry.?Point(lon3,lat3)]),etc]);


and then create a feature from the geometry using OpenLayers.?Feature.?Vector


-atle


On 03/02/2010 01:48 PM, Vitor Isaia wrote: 

	Dear list,
	
	I need OpenLayers to draw automatically irregular polygons, from sets of coordinates, that represent geofences.
	
	I already have, in my application, regular polygons (circles) drawn from coordinates, but I can't find a way to draw irregular ones, like this:
	
	 polygons.jpg<http://img195.imageshack.us/img195/6235/polygons.jpg> 
	
	http://img195.imageshack.us/img195/6235/polygons.jpg
	
	Any clue about how to do that?
	
	Thanks in advance.
	
	Vitor Isaia - Brazil
	
	
	
	_______________________________________________
	Users mailing list
	Users at openlayers.org
	http://openlayers.org/mailman/listinfo/users
	  



-- 
Atle Frenvik Sveen
GIS Konsulent
Geomatikk IKT AS
tlf: 45 27 86 89
atle.frenvik.sveen at geomatikk.no
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100302/38dfe64e/attachment.html


More information about the Users mailing list