stuartmatthews / leaflet-geotiff

Leaflet plugin for displaying geoTIFF raster data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReferenceError: GeoTIFF is not defined

Gaetanbrl opened this issue · comments

Version

Version : v8.1.0
Load : from release dist/ol.js inside index.html (old school import style)

Description

Hi,
I try to use OL 8.1.0 to view a simple TIFF file.

If i use openlayers as Vite dependancy (start serve with NPM), it works.

But if i load OpenLayers from ol.js file without NPM, i get an error :
ReferenceError: GeoTIFF is not defined

    <script
        type="text/javascript"
        src="lib/openlayers/8.1.0/ol.js"
    ></script>

When i debug ol lib, i can find ol.source.GeoTIFF function :

image

Here is the code inspired by OL examples :

const layer = new ol.layer.WebGLTile({
    source: new ol.source.GeoTIFF({
		convertToRGB: true,
		sources: [
			{
				url: 'xxxx_RVB_COG.tif',
			},
		],
	}),
});

Do you reproduce this behavior ? Need i to import GeoTIFF lib before ol in v8.x ?

Thanks.

GB

Wrong repo (wrong brower tab...). I close, sorry !