1

I need to change brightness in images of a Leaflet wms layer. There is several plugins to do it like Leaflet.TileLayer.GL, Leaflet.TileLayer.Colorizr, Leaflet.TileLayer.PixelFilter, but they only works with TileLayer, not WMS layers.

Can I do this using css?

1
  • The WMS way would be to supply your own SLD as part of the GetMap request.
    – nmtoken
    Commented Dec 22, 2017 at 21:43

1 Answer 1

3

Yes, is possible to do it using CSS3 and Jquery, see jsfidle: https://jsfiddle.net/ToniBCN/t5fr48w7/

<style>
 .brightness{
 -webkit-filter: brightness(200%); /* Safari */
 filter: brightness(200%);
}

var ortolyr = L.tileLayer.wms("https://geoserveis.icgc.cat/icc_mapesmultibase/utm/wms/service?",{layers: 'orto',format: 'image/jpeg',crs: crs25831}).addTo(map);
$(ortolyr.getContainer()).addClass('brightness');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.