orfon / leaflet.sld Goto Github PK
View Code? Open in Web Editor NEWSLD styling for Leaflet geojson Layers
License: MIT License
SLD styling for Leaflet geojson Layers
License: MIT License
I think this is no longer a "proof of concept" since it works and it works really well. Obviously it could be improved. Maybe changing to beta will be better
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:FeatureTypeStylehow use this code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.