|
@@ -2,10 +2,10 @@
|
|
|
<div>
|
|
<div>
|
|
|
<label>
|
|
<label>
|
|
|
<el-select v-model="form" placeholder="选择标签" @change="onChange">
|
|
<el-select v-model="form" placeholder="选择标签" @change="onChange">
|
|
|
- <el-option label="内容1" value="1" />
|
|
|
|
|
- <el-option label="内容2" value="2" />
|
|
|
|
|
- <el-option label="内容3" value="3" />
|
|
|
|
|
- <el-option label="内容4" value="4" />
|
|
|
|
|
|
|
+ <el-option label="分类1" value="1" />
|
|
|
|
|
+ <el-option label="分类2" value="2" />
|
|
|
|
|
+ <el-option label="分类3" value="3" />
|
|
|
|
|
+ <el-option label="分类4" value="4" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</label>
|
|
</label>
|
|
|
<!-- zoom=7 的比例尺为 100km -->
|
|
<!-- zoom=7 的比例尺为 100km -->
|
|
@@ -104,7 +104,7 @@ export default {
|
|
|
lat: null,
|
|
lat: null,
|
|
|
lng: null
|
|
lng: null
|
|
|
},
|
|
},
|
|
|
- form: null,
|
|
|
|
|
|
|
+ form: 1,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -129,22 +129,33 @@ export default {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const type = 1
|
|
const type = 1
|
|
|
- getMapMarkers(type).then(res => {
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- this.markers = res.data
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$notify({
|
|
|
|
|
- title: res.status,
|
|
|
|
|
- message: res.data,
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- duration: 500
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }).catch(error => {
|
|
|
|
|
- this.$message.error(error.message)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.getMapMarkersWrapper(type)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getMapMarkersWrapper(type) {
|
|
|
|
|
+ getMapMarkers(type).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ message: '加载了 ' + res.data.length + ' 条数据',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ duration: 3000
|
|
|
|
|
+ })
|
|
|
|
|
+ this.markers = res.data
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ duration: 3000
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ message: error.message,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ duration: 3000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
getClickInfo(e) {
|
|
getClickInfo(e) {
|
|
|
//console.log(e)
|
|
//console.log(e)
|
|
|
// 调整地图中心位置
|
|
// 调整地图中心位置
|
|
@@ -211,10 +222,15 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
onCopyError(e) {
|
|
onCopyError(e) {
|
|
|
- console.log('复制失败!')
|
|
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ message: '复制 GoogleEarth 坐标失败!',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 3000
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
onChange() {
|
|
onChange() {
|
|
|
- console.log(this.form)
|
|
|
|
|
|
|
+ const type = this.form
|
|
|
|
|
+ this.getMapMarkersWrapper(type)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|