<div>
var mymap = L.map('mapid').setView([20.5937, 78.9629], 5);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
var fogDepth = plotty.addColorScale("mycolorscale", ["#00ff00", "#0000ff", "#ff0000"], [0, 0.5, 1]);;
plotty.addColorScale("test", ["#00ff00", "#0000ff", "#ff0000"], [0, 0.5, 1]);
var fogDepth = L.leafletGeotiff(
url = 'FOG.tif',
options = {
band: 0,
displayMin: 0,
displayMax: 45,
name: 'Fog Depth',
colorScale: 'rainbow',
clampLow: false,
clampHigh: true,
//vector:true,
// arrowSize: 20,
}
).addTo(mymap);
</div>
I have added a rainbow color scale to the GeoTIFF file with band=0 min value 0 and max value 45, the tiff file in the grey scale of band =1 how can I change to color scale to rainbow?
with the above code, I am getting this output, and its in scale between 0-1:
