|
@@ -101,6 +101,17 @@ export default {
|
|
|
},
|
|
|
async mounted() {
|
|
|
await loadJS('https://api.tianditu.gov.cn/api?v=4.0&tk=a4dc3ba4fde4085083ab82395af6c046')
|
|
|
+ if (this.$attrs.expandMode) {
|
|
|
+ setTimeout(() => {
|
|
|
+ const lon = this.value.split(this.$attrs.keepSeparator)[0]
|
|
|
+ const lat = this.value.split(this.$attrs.keepSeparator)[1]
|
|
|
+ const map1 = new T.Map('mapDiv1')
|
|
|
+ map1.centerAndZoom(new T.LngLat(lon, lat), zoom)
|
|
|
+ marker = new T.Marker(new T.LngLat(lon, lat))
|
|
|
+ //向地图上添加标注
|
|
|
+ map1.addOverLay(marker)
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
isShow(val) {
|
|
@@ -111,6 +122,8 @@ export default {
|
|
|
const lat = this.innerValue.split(this.$attrs.keepSeparator)[1]
|
|
|
this.mapObject.lon = lon
|
|
|
this.mapObject.lat = lat
|
|
|
+
|
|
|
+ console.log(lon, lat)
|
|
|
}
|
|
|
if (!map) {
|
|
|
map = new T.Map('mapDiv')
|
|
@@ -144,17 +157,6 @@ export default {
|
|
|
innerValue(val) {
|
|
|
val && this.$emit('change', val)
|
|
|
if (val) {
|
|
|
- if (this.$attrs.expandMode) {
|
|
|
- setTimeout(() => {
|
|
|
- const lon = val.split(this.$attrs.keepSeparator)[0]
|
|
|
- const lat = val.split(this.$attrs.keepSeparator)[1]
|
|
|
- const map1 = new T.Map('mapDiv1')
|
|
|
- map1.centerAndZoom(new T.LngLat(lon, lat), zoom)
|
|
|
- marker = new T.Marker(new T.LngLat(lon, lat))
|
|
|
- //向地图上添加标注
|
|
|
- map1.addOverLay(marker)
|
|
|
- }, 500)
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
value(val) {
|