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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章