<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body text="#000000" bgcolor="#ffffff">
I guess you could use <br>
<br>
OpenLayers.​Geometry.​Polygon
(<a class="moz-txt-link-freetext" href="http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html">http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html</a>),
but the doc says it is constructed from an array of
OpenLayers.​Geometry.​LinearRings, so I guess the safe bet is to use:<br>
<br>
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]);<br>
<br>
<br>
and then create a feature from the geometry using
OpenLayers.​Feature.​Vector<br>
<br>
<br>
-atle<br>
<br>
<br>
On 03/02/2010 01:48 PM, Vitor Isaia wrote:
<blockquote
cite="mid:9b3248bc1003020448x417eab70l9d070781b3bead26@mail.gmail.com"
type="cite">Dear list,<br>
<br>
I need OpenLayers to draw automatically irregular polygons, from sets
of coordinates, that represent geofences.<br>
<br>
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:<br>
<br>
<img moz-do-not-send="true" title="polygons.jpg" alt="polygons.jpg"
src="http://img195.imageshack.us/img195/6235/polygons.jpg"><br>
<br>
<a moz-do-not-send="true"
href="http://img195.imageshack.us/img195/6235/polygons.jpg">http://img195.imageshack.us/img195/6235/polygons.jpg</a><br>
<br>
Any clue about how to do that?<br>
<br>
Thanks in advance.<br>
<br>
Vitor Isaia - Brazil<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Atle Frenvik Sveen
GIS Konsulent
Geomatikk IKT AS
tlf: 45 27 86 89
<a class="moz-txt-link-abbreviated" href="mailto:atle.frenvik.sveen@geomatikk.no">atle.frenvik.sveen@geomatikk.no</a></pre>
</body>
</html>