All Projects → orfon → Leaflet.SLD

orfon / Leaflet.SLD

Licence: MIT license
SLD styling for Leaflet geojson Layers

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Proof of concept only

Leaflet.SLDStyler

Apply styling from 1.1.0 or 1.0 SLD-File to a GeoJSON layer.

Rules can be ORed or ANDed. The following comparisions are possible:

  • ogc:PropertyIsEqualTo
  • ogc:PropertyIsNotEqualTo
  • ogc:PropertyIsLessThan
  • ogc:PropertyIsGreaterThan
  • ogc:PropertyIsLessThanOrEqualTo
  • ogc:PropertyIsGreaterThanOrEqualTo

The following PolygonSymbolizer properties are applied:

  • stroke
  • stroke-width
  • stroke-opacity
  • fill-opacity
  • fill
  • stroke-opacity
  • stroke-dasharray
  • stroke-linejoin
  • stroke-linecap

Also see the unit tests for what is possible.

Example:

var SLDStyler = new L.SLDStyler(SLDXmlOrText);

var geojsonLayer = L.geoJson(jsonObject, {
   style: SLDStyler.getStyleFunction()
}).addTo(map);

To be done:

  • more styling properties and comparisions
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].