提交 a22a0ca1 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新地图定位控件

上级 91f9d1e0
......@@ -226,9 +226,7 @@ export default class AppMobMapPage extends Vue {
visible: true
});
this.center = position;
if (this.marker.address) {
this.address = this.marker.address;
} else {
if (!this.address) {
const address = await this.getAddress(longitude, latitude).catch((error) => {
console.warn(error);
});
......@@ -236,6 +234,8 @@ export default class AppMobMapPage extends Vue {
this.address = address as string;
}
}
} else if (this.address) {
this.handleSearch();
}
}
......
.app-mob-map-position {
display: flex;
ion-icon {
transform: translate(0px, 12px);
}
}
\ No newline at end of file
<template>
<div class="app-mob-map-position">
<ion-icon name="location" @click="openMap"></ion-icon>
<ion-input :value="data ? data[address] : null" @ionChange="changeAddress"></ion-input>
</div>
</template>
<script lang="ts">
......@@ -71,6 +72,16 @@ export default class AppMobMapPosition extends Vue {
*/
public map: any;
/**
* 改变地址
*
* @type {*}
* @memberof AppMobMapPosition
*/
public changeAddress($enevt: any) {
this.$emit('change', {name: this.address, value: $enevt.detail.value});
}
/**
* 打开地图
*
......@@ -103,7 +114,7 @@ export default class AppMobMapPosition extends Vue {
}
/**
* 打开地图
* 关闭地图
*
* @type {*}
* @memberof AppMobMapPosition
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册