openlayers 加载 tiff
main.js代码如下
import './style.css';
import GeoTIFF from 'ol/source/GeoTIFF'
import Map from 'ol/Map'
import TileLayer from 'ol/layer/WebGLTile'
const source=new GeoTIFF({
sources:[
{
url:'https://openlayers.org/data/raster/no-overviews.tif',
overviews:['https://openlayers.org/data/raster/no-overviews.tif.ovr']
},
]
})
const map=new Map({
target:'map',
layers:[
new TileLayer({
source:source,
}),
],
view:source.getView(),
})
document:https://openlayers.org/en/latest/examples/cog-overviews.html
禁止转载