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

posted @ 2022-12-30 11:58  fishpro  阅读(1605)  评论(0编辑  收藏  举报