0

I am using OpenLayers 2.13.1 to display Zip-areas. I have a PostGIS database with multi-polygons, that I show on a map. The user can select/deselected them.

Some polygons have an area (I think they are called donut holes?) cut out, like the example below. When the large polygon is selected, it shows the hole in the middle even when the smaller polygon that is underneath it, is selected (as seen on image 2.). It looks like its a bug, because the polygon is transparent, but still I can't see the polygon underneath.

Also the small polygon in the middle can't be selected/deselected at all.

The first problem is the biggest, the other can be solved with a simple workaround.

Image1: Area 7722 and 7721 are selected, but 7721 looks like it isn't Image1: Area 7722 and 7721 are selected, but 7721 looks like it isn't Image2: Area 7722 is deselected. Now you can see that area 7721 is Image2: Area 7722 is deselected. Now you can see that area 7721 is

UPDATE:

I created an basic JSFiddle example here. You cannot select the polygons, but the center of the colored polygon has another one over / under it that should be gray as well.

Hope someone can point me in the right direction...

1

Sometimes the solution is simple. It seems the Canvas and VML renders don't work well with holes. I switched back to SVG render and it works fine now.

So the simple solution is to remove this line :

 renderers: ['Canvas', 'VML']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.