[OpenLayers-Users] Irregular polygons

Vitor Isaia vitorisaia at gmail.com
Tue Mar 2 09:13:45 EST 2010


Thanks a lot Sveen, it works.

Best regards,

Vitor.

On Tue, Mar 2, 2010 at 10:32 AM, Sveen Atle Frenvik (Geomatikk IKT) <
Atle.Frenvik.Sveen at geomatikk.no> wrote:

>  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:
>
> [image: 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 listUsers at openlayers.orghttp://openlayers.org/mailman/listinfo/users
>
>
>
> --
> Atle Frenvik Sveen
> GIS Konsulent
> Geomatikk IKT AS
> tlf: 45 27 86 89atle.frenvik.sveen at geomatikk.no
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100302/8e64f5e0/attachment.html


More information about the Users mailing list