|
|
@ -53,28 +53,28 @@ |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
|
|
|
|
import dy from '@/assets/images/fifteen/dy.png'; |
|
|
|
import education from '@/assets/images/fifteen/education.png'; |
|
|
|
import jr from '@/assets/images/fifteen/jr.png'; |
|
|
|
import qt from '@/assets/images/fifteen/qt.png'; |
|
|
|
import sy from '@/assets/images/fifteen/sy.png'; |
|
|
|
import sz from '@/assets/images/fifteen/sz.png'; |
|
|
|
import wt from '@/assets/images/fifteen/wt.png'; |
|
|
|
import xz from '@/assets/images/fifteen/xz.png'; |
|
|
|
import yl from '@/assets/images/fifteen/yl.png'; |
|
|
|
import { requestPostBi } from "@/js/dai/request-bipass"; |
|
|
|
import { Feature, Overlay } from 'ol'; |
|
|
|
import Map from 'ol/Map'; |
|
|
|
import { XYZ } from 'ol/source'; |
|
|
|
import View from 'ol/View'; |
|
|
|
import { defaults as defaultControls } from 'ol/control.js'; |
|
|
|
import { Icon, Style, Fill, Stroke, Text } from 'ol/style'; |
|
|
|
import { Circle, Point, Polygon } from 'ol/geom'; |
|
|
|
import { Select } from 'ol/interaction'; |
|
|
|
import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer'; |
|
|
|
import education from '@/assets/images/fifteen/education.png' |
|
|
|
import xz from '@/assets/images/fifteen/xz.png' |
|
|
|
import jr from '@/assets/images/fifteen/jr.png' |
|
|
|
import qt from '@/assets/images/fifteen/qt.png' |
|
|
|
import sy from '@/assets/images/fifteen/sy.png' |
|
|
|
import sz from '@/assets/images/fifteen/sz.png' |
|
|
|
import wt from '@/assets/images/fifteen/wt.png' |
|
|
|
import yl from '@/assets/images/fifteen/yl.png' |
|
|
|
import dy from '@/assets/images/fifteen/dy.png' |
|
|
|
import { Vector as VectorSource } from 'ol/source'; |
|
|
|
import { Feature, Overlay } from 'ol' |
|
|
|
import { Point, Polygon, Circle } from 'ol/geom' |
|
|
|
import { requestPostBi } from "@/js/dai/request-bipass"; |
|
|
|
import { getPointResolution } from 'ol/proj' |
|
|
|
import { METERS_PER_UNIT } from 'ol/proj/Units' |
|
|
|
import Dialog from "./dialog.vue" |
|
|
|
import { getPointResolution } from 'ol/proj'; |
|
|
|
import { METERS_PER_UNIT } from 'ol/proj/Units'; |
|
|
|
import { Vector as VectorSource, XYZ } from 'ol/source'; |
|
|
|
import { Fill, Icon, Stroke, Style, Text } from 'ol/style'; |
|
|
|
import Dialog from "./dialog.vue"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Dialog |
|
|
@ -142,6 +142,28 @@ export default { |
|
|
|
//添加标注 |
|
|
|
this.map.addOverlay(this.overlay); |
|
|
|
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.featureInfo = {} |
|
|
|
let feature = _this.map.forEachFeatureAtPixel(e.pixel, function (feature) { |
|
|
|