|
@ -74,6 +74,7 @@ import { METERS_PER_UNIT } from 'ol/proj/Units'; |
|
|
import { Vector as VectorSource, XYZ } from 'ol/source'; |
|
|
import { Vector as VectorSource, XYZ } from 'ol/source'; |
|
|
import { Fill, Icon, Stroke, Style, Text } from 'ol/style'; |
|
|
import { Fill, Icon, Stroke, Style, Text } from 'ol/style'; |
|
|
import Dialog from "./dialog.vue"; |
|
|
import Dialog from "./dialog.vue"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
Dialog |
|
|
Dialog |
|
@ -141,28 +142,6 @@ export default { |
|
|
//添加标注 |
|
|
//添加标注 |
|
|
this.map.addOverlay(this.overlay); |
|
|
this.map.addOverlay(this.overlay); |
|
|
const _this = this; |
|
|
const _this = this; |
|
|
// let select = new Select({ |
|
|
|
|
|
// style: new Style({ |
|
|
|
|
|
// stroke: new Stroke({ |
|
|
|
|
|
// color: "rgb(0, 153, 255,1)", |
|
|
|
|
|
// width: 2 |
|
|
|
|
|
// }), |
|
|
|
|
|
// fill: new Fill({ |
|
|
|
|
|
// color: "rgb(209, 203, 189,0.6)" |
|
|
|
|
|
// }) |
|
|
|
|
|
// }) |
|
|
|
|
|
// }); |
|
|
|
|
|
// //map加载该控件,默认是激活可用的 |
|
|
|
|
|
// _this.map.addInteraction(select); |
|
|
|
|
|
// console.log(99999, select); |
|
|
|
|
|
// select.on("select", function (e) { |
|
|
|
|
|
// console.log("选中要素"); |
|
|
|
|
|
// // console.log(e.selected[0].get('name')); //打印已选择的Feature的name属性 |
|
|
|
|
|
// let currentRome = e.selected[0]; //获取当前选中的节点 |
|
|
|
|
|
// console.log(e) |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
// return |
|
|
|
|
|
_this.map.on("click", function (e) { |
|
|
_this.map.on("click", function (e) { |
|
|
_this.featureInfo = {} |
|
|
_this.featureInfo = {} |
|
|
let feature = _this.map.forEachFeatureAtPixel(e.pixel, function (feature) { |
|
|
let feature = _this.map.forEachFeatureAtPixel(e.pixel, function (feature) { |
|
|