Fly 6 months ago
parent
commit
777948e7b8
3 changed files with 34 additions and 12 deletions
  1. 16 0
      components/city/json.js
  2. 1 0
      components/tiandituMap/tiandituMap.vue
  3. 17 12
      pages/map/map.js

+ 16 - 0
components/city/json.js

@@ -52,6 +52,22 @@ export const cityJson = [{
 	{
 		value: '420117',
 		label: '新洲区'
+	},
+	{
+		value: '420111001',
+		label: '东湖新技术开发区'
+	},
+	{
+		value: '420116001',
+		label: '长江新区'
+	},
+	{
+		value: '420113001',
+		label: '经济技术开发区'
+	},
+	{
+		value: '420111002',
+		label: '东湖生态旅游风景区'
 	}
 ]
 

+ 1 - 0
components/tiandituMap/tiandituMap.vue

@@ -447,6 +447,7 @@
 					if (!window.T) {
 						// this.setViewport() 
 						const script = document.createElement('script')
+						// script.src = "https://tile0.tianditu.gov.cn/vts?t=vt&pk=ag1adgmgd&tk=92053ec7c4309bf20d822b28f150f33d&v=1.0"
 						script.src = 'https://api.tianditu.gov.cn/api?v=4.0&tk=' + this.options.apikey
 						script.onload = this.initChartsRender.bind(this)
 						document.head.appendChild(script)

+ 17 - 12
pages/map/map.js

@@ -4,18 +4,23 @@ export default {
 	},
 	methods: {
 		getVal(val) {
-			const all = (val.split('周六') || []).map((el, index) => {
-				if (index === 0) {
-					if (val.indexOf('周六') === 0) {
-						el = `周六${el}`
-					}
-				} else {
-					el = `周六${el}`
-				}
-				return el
-			})
-			// console.log('all === ', all)
-			return all
+			// const all = (val.split('周六') || []).map((el, index) => {
+			// 	if (index === 0) {
+			// 		if (val.indexOf('周六') === 0) {
+			// 			el = `周六${el}`
+			// 		}
+			// 	} else {
+			// 		el = `周六${el}`
+			// 	}
+			// 	return el
+			// }) 
+			try {
+				const all = (val.split('&') || [])
+
+				return all
+			} catch {
+				return []
+			}
 		},
 	}
 };