Web-Map-Custom-Element icon indicating copy to clipboard operation
Web-Map-Custom-Element copied to clipboard

Setting class attribute on map-multipolygon does not work

Open prushforth opened this issue 3 years ago • 0 comments

If you set a class attribute on a <map-polygon> for instance, you are able to style it with a rule:

<map-style> .foo { fill: red }</map-style>
<map-polygon class="foo">...</map-polygon>

however doing so on a <map-multipolygon> has no effect:

<map-style> .foo {fill: red}</map-style>
<map-multipolygon class="foo">...</map-multipolygon>

This probably applies to all multi geometries, since they are represented in the DOM by an SVG <g> element.

A workaround / hack is to set the class attribute on all the child geometry elements, but it would be ideal to not have to do so.

prushforth avatar Oct 05 '22 16:10 prushforth