//关于openlayers创建图层
import ImageLayer from 'ol/layer/Image'
createImageLayers(title, extent, imgUrl, opacity, zindex, visible) {
const self = this
const tempLayer = new ImageLayer({
zIndex: zindex,
title: title,
name: title,
visible: visible,
opacity: opacity
})
self.$map.addLayer(tempLayer)
var source = new Static({
url: imgUrl,
crossOrigin: null,
projection: new Projection({
code: 'EPSG:4326',
extent: extent // 此处为图层的外包范围
}),
imageExtent: extent
})
tempLayer.setSource(source)
},```
openlayers创建图片图层
最新推荐文章于 2024-08-27 15:13:23 发布