Closed vlach1989 closed 3 years ago
Hi, @vlach1989 . Thanks for sharing this. Would you be able to share the code you are using? Also, what browser are you using? Thank you!
Hi, I have the problem both in Chrome 92 and Firefox 91.
As I said, I'm using the library together with React-Leaflet:
class CogLayer extends MapLayer {
createLeafletElement(props) {
const {georaster, paneName, options} = props;
return new GeoRasterLayer({
georaster,
pane: paneName,
resolution: 128,
pixelValuesToColorFn: this.getStyle.bind(this),
});
}
updateLeafletElement(fromProps, toProps) {
super.updateLeafletElement(fromProps, toProps);
}
getStyle(pixelValues) {
// TODO multiple bands
const pixelValue = pixelValues[0]; // there's just one band in this raster
if (pixelValue === 0) return null;
// TODO scales, values, intervals
return '#000000';
}
}
export default withLeaflet(CogLayer);
@vlach1989 I had the same issue (Leaflet 1.7.1 + Chromium 93), the last version of georaster-layer-for-leaflet v3.2.0 fix the issue.
I confirm, that v3.2.0 fixes the issue
Glad to hear it!
I'm trying to reproduce following example: https://geotiff.github.io/georaster-layer-for-leaflet-example/examples/load-cog-via-script-tag.html wrapped with React-Leaflet
It works as expected in version 2.0.2. However, both in version 3.0.2 and 3.1.1 (the latest) the tiles are somehow scattered or missing:
I found out, that at least the calculated position for some tiles is wrong or padding is too big.