[OpenLayers-Trac] [OpenLayers] #3592: Cannot draw hole on multipolygon

OpenLayers trac-20090302 at openlayers.org
Fri Dec 2 09:37:32 EST 2011


#3592: Cannot draw hole on multipolygon
---------------------+------------------------------------------------------
 Reporter:  fradal   |       Owner:     
     Type:  bug      |      Status:  new
 Priority:  minor    |   Milestone:     
Component:  general  |     Version:     
 Keywords:           |       State:     
---------------------+------------------------------------------------------
 Something strange happens using the holeModifier key in a multipolygon
 geometry.

 To reproduce this bug:
 - open donut.js in the 2.11 examples folder
 - add multi: true option to handlerOptions:
   - replace this line (line 20)
     {handlerOptions: {holeModifier: "altKey"}}
   - with this
     {handlerOptions: {holeModifier: "altKey", multi: true}}
 - draw a polygon and close it (double click)
 - keep the alt key pressed and try to draw another polygon within the
 first drawn

 Nothing is drawn, and if you try to move the mouse out of the first
 polygon, the pointer remains inside the drawn polygon.

 Trying to understand the problem, I've noticed that addComponent return
 false because of this:
 OpenLayers.Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1)
 (Geometry/Collection.js : 160)
 probably because
 componentTypes: ["OpenLayers.Geometry.Polygon"],
 (Geometry/MultiPolygon.js)
 does not contain OpenLayers.Geometry.LinearRing

 I've tried to add LinearRing to componentTypes.
 The hole polygon is drawn, but it is not an hole, but another polygon.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3592>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list