|
|
@ -373,6 +373,8 @@ |
|
|
|
import 'ol/ol.css' |
|
|
|
import { Map, View } from 'ol' |
|
|
|
import TileLayer from 'ol/layer/Tile.js'; |
|
|
|
import ImageLayer from 'ol/layer/Image'; |
|
|
|
import { Raster as RasterSource } from 'ol/source'; |
|
|
|
import XYZ from 'ol/source/XYZ.js'; |
|
|
|
import VectorLayer from 'ol/layer/Vector.js'; |
|
|
|
import VectorSource from 'ol/source/Vector.js'; |
|
|
@ -489,6 +491,28 @@ var polygonStyleFunction = (function () { |
|
|
|
}; |
|
|
|
})() |
|
|
|
|
|
|
|
//定义颜色转换方法 |
|
|
|
let reverseFunc = function (pixelsTemp) { |
|
|
|
//蓝色 |
|
|
|
for (var i = 0; i < pixelsTemp.length; i += 4) { |
|
|
|
var r = pixelsTemp[i]; |
|
|
|
var g = pixelsTemp[i + 1]; |
|
|
|
var b = pixelsTemp[i + 2]; |
|
|
|
//运用图像学公式,设置灰度值 |
|
|
|
var grey = r * 0.3 + g * 0.59 + b * 0.11; |
|
|
|
//将rgb的值替换为灰度值 |
|
|
|
pixelsTemp[i] = grey; |
|
|
|
pixelsTemp[i + 1] = grey; |
|
|
|
pixelsTemp[i + 2] = grey; |
|
|
|
|
|
|
|
//基于灰色,设置为蓝色,这几个数值是我自己试出来的,可以根据需求调整 |
|
|
|
pixelsTemp[i] = 55 - pixelsTemp[i]; |
|
|
|
pixelsTemp[i + 1] = 255 - pixelsTemp[i + 1]; |
|
|
|
pixelsTemp[i + 2] = 305 - pixelsTemp[i + 2]; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const vueGis = { |
|
|
|
name: 'HomeMap', |
|
|
|
data () { |
|
|
@ -1642,9 +1666,13 @@ const vueGis = { |
|
|
|
url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}', |
|
|
|
wrapX: true//x方向平铺,也可以选择false |
|
|
|
}), |
|
|
|
zIndex: 20 |
|
|
|
zIndex: 20, |
|
|
|
crossOrigin: 'anonymous' |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mapView = new View({ |
|
|
|
//中心点坐标 |
|
|
|
center: this.centerPoint, |
|
|
@ -1674,6 +1702,8 @@ const vueGis = { |
|
|
|
}); |
|
|
|
map.removeInteraction(dblClickInteraction); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
//添加标注图层 |
|
|
|
addParentLayer () { |
|
|
|