From 41dc8bedbfee679decb94d2df35c10fc003e258a Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 24 Aug 2022 15:37:31 +0800
Subject: [PATCH] 二级菜单添加返回功能
---
src/components/map/plotMap.vue | 162 +++++++++++++++++++++++++++++++++++------------------
1 files changed, 106 insertions(+), 56 deletions(-)
diff --git a/src/components/map/plotMap.vue b/src/components/map/plotMap.vue
index 2355472..94060dc 100644
--- a/src/components/map/plotMap.vue
+++ b/src/components/map/plotMap.vue
@@ -1,4 +1,3 @@
-/* eslint-disable camelcase */
<template>
<div>
<div id="viewer-container" style="height: 100%; width: 100%"></div>
@@ -70,11 +69,81 @@
// http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer
+ // global.viewer.imageryLayers.addImageryProvider(
+ // new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
+ // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengyjjddom/MapServer/WMTS',
+ // // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
+ // layer: 'nanchengyjjddom',
+ // style: 'default',
+ // tileMatrixSetID: 'default028mm',
+ // format: 'image/png',
+ // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
+ // maximumLevel: 19,
+ // tileMatrixLabels: [
+ // '0',
+ // '1',
+ // '2',
+ // '3',
+ // '4',
+ // '5',
+ // '6',
+ // '7',
+ // '8',
+ // '9',
+ // '10',
+ // '11',
+ // '12',
+ // '13',
+ // '14',
+ // '15',
+ // '16',
+ // '17',
+ // '18',
+ // '19'
+ // ]
+ // })
+ // )
+
+ // global.viewer.imageryLayers.addImageryProvider(
+ // new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
+ // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
+ // // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
+ // layer: 'nanchengdom',
+ // style: 'default',
+ // tileMatrixSetID: 'default028mm',
+ // format: 'image/png',
+ // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
+ // maximumLevel: 19,
+ // tileMatrixLabels: [
+ // '0',
+ // '1',
+ // '2',
+ // '3',
+ // '4',
+ // '5',
+ // '6',
+ // '7',
+ // '8',
+ // '9',
+ // '10',
+ // '11',
+ // '12',
+ // '13',
+ // '14',
+ // '15',
+ // '16',
+ // '17',
+ // '18',
+ // '19'
+ // ]
+ // })
+ // )
+
global.viewer.imageryLayers.addImageryProvider(
new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
- url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengyjjddom/MapServer/WMTS',
+ url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdomjuly/MapServer/WMTS',
// url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
- layer: 'nanchengyjjddom',
+ layer: 'nanchengdomjuly',
style: 'default',
tileMatrixSetID: 'default028mm',
format: 'image/png',
@@ -105,40 +174,8 @@
})
)
- global.viewer.imageryLayers.addImageryProvider(
- new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
- url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
- // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
- layer: 'nanchengdom',
- style: 'default',
- tileMatrixSetID: 'default028mm',
- format: 'image/png',
- tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
- maximumLevel: 19,
- tileMatrixLabels: [
- '0',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- '10',
- '11',
- '12',
- '13',
- '14',
- '15',
- '16',
- '17',
- '18',
- '19'
- ]
- })
- )
+
+
// 矢量电子
// global.viewer.imageryLayers.addImageryProvider(
@@ -216,25 +253,22 @@
addPlotPolygon (positions, item) {
const that = this
-
const center = this.getCenter(positions)
-
- // const divIcon = new global.DC.DivIcon(
- // new global.DC.Position(center[0], center[1], 0),
- // `
- // <div class="farm-map-icon">
- // <img src="/img/icon/3858.png" alt="">
- // // <div>${item.farmName}</div>
- // </div>
- // `
- // )
- // divIcon.attrParams = item
- // farmLogoLayer.addOverlay(divIcon)
-
- // divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
- // that.$parent.showDetailPopup(e.overlay.attrParams)
- // })
-
+ if(item.strainUrl !=""){
+ const divIcon = new global.DC.DivIcon(
+ new global.DC.Position(center[0], center[1], 0),
+ `
+ <div class="farm-map-icon">
+ <img src="${item.strainUrl}" alt=""width="50%" height="50%" text-align="center">
+ </div>
+ `
+ )
+ divIcon.attrParams = item
+ farmLogoLayer.addOverlay(divIcon)
+ divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
+ that.$parent.showDetailPopup(e.overlay.attrParams)
+ })
+ }
const polygon = new global.DC.Polygon(positions)
polygon.attrParams = item
polygon.setStyle({
@@ -248,8 +282,10 @@
that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
})
+ console.log(item, 123)
+
plotRegionLayer.addOverlay(polygon)
- addPlotLayers.push({ center, name: item.landName })
+ addPlotLayers.push({ center, name: item.landName, id: item.id })
},
setCenter (name) {
@@ -300,6 +336,20 @@
})
},
+ setPlotAttr (params) {
+ let overLayers = plotRegionLayer.getOverlays()
+
+ overLayers.some(item => {
+
+ if (item.attrParams.id == params.id) {
+ item.attrParams = params
+
+ return true
+ }
+
+ })
+ },
+
// 经纬度测算中心位置
getCenter (arr) {
let centerLonLat = []
--
Gitblit v1.9.3