0

I am trying to add a tiff layer to my map and im basically trying to do this example, on my map, but it keeps throwing errors.

I recreated the code in jsFiddle open the browser console and you will see it.

is this a problem with ol ? or am i doing something wrong ?

on ol 6.15.1

TypeError: this.blockIdsToFetch.has is not a function
    at rp.fetch (blockedsource.js:92:41)
    at Ep.fromSource (geotiff.js:521:38)
    at geotiff.js:715:34
    at qp (GeoTIFF.js:200:15)
    at new n (GeoTIFF.js:418:21)

and on ol 7.4.0

ReferenceError: GeoTIFF is not defined
    at ic (GeoTIFF.js:242:15)
    at new sc (GeoTIFF.js:470:1)

this is my code: im using the same links from the ol example

const olTiffUrl = `https://openlayers.org/data/raster/no-overviews.tif`;
const olTiffovr = `https://openlayers.org/data/raster/no-overviews.tif.ovr`;

const tiffLayer = new ol.layer.WebGLTile({
    source: new ol.source.GeoTIFF({
        sources: [
            {
                url: olTiffUrl,
                overviews: [olTiffovr]
            }
        ]
    }),
    title: 'geo Tiff',
    zIndex: 2,
    visible: true
});

olMap.addLayer(tiffLayer);
khaled
  • 33
  • 1
  • 1
  • 7
  • As well as the ol.js link `https://cdn.jsdelivr.net/npm/ol@v7.4.0/dist/ol.js` you need to include geotiff.js `https://cdn.jsdelivr.net/npm/geotiff@2.0.7/dist-browser/geotiff.js` – Mike Jun 12 '23 at 18:59

0 Answers0