Web-Map-Custom-Element
Web-Map-Custom-Element copied to clipboard
Setting class attribute on map-multipolygon does not work
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.