leaflet-geotiff-2
leaflet-geotiff-2 copied to clipboard
Unable to change band number
Hi there. I'm running into a couple potential errors (could be on my end). I'm hoping you can help me understand what's going wrong. I have a local geotiff with 4 bands that I'm visualizing. 2 unexpected errors:
- When I change the band number (using the "band" option as an input to L.LeafletGeotiff), nothing changes.
- When I change the clampHigh option as an input to L.LeafletGeotiff.plotty, nothing changes. Specifically, all values higher than displayMax are left empty.
Here is my code if helpful:
JAVASCRIPT import "leaflet-geotiff-2"; import "leaflet-geotiff-2/dist/leaflet-geotiff-plotty"; var map = L.map('map').setView([38, -98], 5); var streetMap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', { attribution: 'Map data © OpenStreetMap contributors, Imagery © Mapbox', maxZoom: 18, id: 'mapbox/streets-v11', tileSize: 512, zoomOffset: -1, accessToken: '..........' }); streetMap.addTo(map); var renderer = L.LeafletGeotiff.plotty({displayMax: 15, colorScale: "viridis"}) var layer_options = {renderer: renderer, band: 3} //change band number here!! var layer = L.leafletGeotiff("./dist/imgs/test_sept.tif", layer_options).addTo(map);
HTML
I'm unable to attach a geotiff (although I can email it if helpful). Here is the converted png: