I faced with problem that I can't to display any .tif image on my map. I'm using leaflet-geotiff plugin for my map. I downloaded the file (for example from gis-lab.info, here is link to download) and tried to paste and display on my map. But I always get Custom Mask is off screen.
Here is a sample how I use it:
import * as geotiff from 'leaflet-geotiff/leaflet-geotiff';
import * as plotty from 'leaflet-geotiff/leaflet-geotiff-plotty';
export class MapComponent {
ngOnInit() {
this.map.on('load', () => {
const options = {
band: 0,
name: 'Custom Mask',
opacity: 1,
renderer: new plotty.Plotty({
colorScale: 'greys'
})
};
new geotiff.LeafletGeotiff('assets/uploads/clearcuts_174016_20101018_clip.tif', options).addTo(this.leafletMap);
});
}
}
And also here what I have in browser console (I added some console.log in leaflet-geotiff lib to be sure that tif file parsed there):
Seems in code in leaflet-geotiff it happens when plotHeight and plotWidth has negative values. And my layer still not showing on map. What am I doing wrong? And how can I display custom tif file correctly?


