Closed jfoclpf closed 7 months ago
Found it :) null
was the trick, perhaps docs should be more clear
const layer = new GeoRasterLayer({
georaster: georaster,
opacity: 0.7,
pixelValuesToColorFn: vals => Math.round(vals[0]) < 1 ? null : '#ffffff',
resolution: 512 // optional parameter for adjusting display resolution
}).addTo(map)
again, congrats for the great work @DanielJDufour
@jfoclpf , would you be open to submitting a PR, adding this example to https://github.com/GeoTIFF/georaster-layer-for-leaflet-example
?
@jfoclpf , would you be open to submitting a PR, adding this example to https://github.com/GeoTIFF/georaster-layer-for-leaflet-example
?
sure, I will do it ASAP
@DanielJDufour I already submitted 3 PRs as you requested, tell me what you think
First of all PROPS for you guys for developing this GREAT AND FREE tool, thanks a lot
Is your feature request related to a problem? I have this elevation map with lots of zeros mapped to white, it would be nice to have transparency for values under zero, for example
Describe the solution you'd like
Allowing transparency without the need for an external GeoJSON mask via
pixelValuesToColorFn
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Use an external GeoJSON file for the mask
Additional context Working example I just made using your tool: https://stackoverflow.com/a/78298578/1243247
Again, thanks a lot for the great tool