orfon/Leaflet.SLD

getElementsByTagNameNS error

Opened this issue · 1 comments

Firstly, I have found Leaflet.SLD really useful, thank you.
However, there is a problem that I had to work around, when getElementsByTagNameNS does not find any nodes. In my case, I had a simple SLD, which is listed below. My work around was:

//console.log(tagName)
// amended below to deal with fact that getElements below does not return an array when null
if (tagName != "And" && tagName != "Or"){
return [].slice.call(element.getElementsByTagNameNS(namespaceMapping[ns], tagName));
} else {
return 0
}

My SLD, output direct from QGIS:

se:NamePA_Countries/se:Name se:NamePA_Countries/se:Name se:FeatureTypeStyle se:Rule se:NameSingle symbol/se:Name se:PolygonSymbolizer se:Fill #ff0000/se:SvgParameter /se:Fill se:Stroke #000000/se:SvgParameter 0.2/se:SvgParameter bevel/se:SvgParameter /se:Stroke /se:PolygonSymbolizer /se:Rule /se:FeatureTypeStyle

i'm glad you find it useful. i don't maintain this library anymore so feel free to fork & fix as you see fit 👍