[OpenLayers-Users] MultiPolygons

Brad Spencer brad at cubewerx.com.au
Tue Oct 27 08:40:33 EDT 2009


Ok, found out that if you just force two LinearRing geometries into the same
polygon object you get two polygons that are fused together as it were. No
need to use MultiPolygon!

 

var parcel01= new OpenLayers.Geometry.LinearRing(pointList01);

var parcel02 = new OpenLayers.Geometry.LinearRing(pointList02);

var polygonFeature = new OpenLayers.Feature.Vector( new
OpenLayers.Geometry.Polygon([parcel01, parcel02]));

 

At least it does what I want.

 

Cheers,

 

Brad.

 

From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of Brad Spencer
Sent: Tuesday, October 27, 2009 5:52 PM
To: openlayers users
Subject: [OpenLayers-Users] MultiPolygons

 

List,

 

I cannot see any examples of this so thought someone may have done the and
can help me.

 

Its not clear how to make a multiPolygon vector object. I can create
individual polygons no problem but how for example would you generate two
concentric circles  as a single polygon with no lines joining the two
circles? This would be is the same as a donut shape.

 

Cheers,

 

Brad Spencer

NuMaps

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091027/489a73a9/attachment.html


More information about the Users mailing list