This commit is contained in:
yanran200730
2022-03-25 18:06:57 +08:00
parent d484770b2f
commit 4ce4dd0a3c
2 changed files with 5 additions and 5 deletions

View File

@@ -165,6 +165,7 @@
)
},
handleSliderOption(e) {
console.log(e)
this.selected = {
command: e.type,
...e.node

View File

@@ -5,7 +5,7 @@
@onConfirm="handleConfirm">
<div id="amap" v-if="dialog"/>
<div class="poi">
<el-input ref="poiInput" v-model="search" size="small" clearable @change="handleSearch" placeholder="请输入地点"/>
<el-input ref="poiInput" v-model="search" size="small" clearable v-throttle="handleSearch" placeholder="请输入地点"/>
</div>
<el-form class="selected" v-if="!!selected.location" id="result" size="mini" label-suffix=""
label-position="left">
@@ -55,7 +55,6 @@ export default {
plugins: ['AMap.PlaceSearch', 'AMap.Marker', 'AMap.Geolocation'],
}).then(AMap => {
this.AMap = AMap
console.log(this.latlng)
this.map = new AMap.Map('amap', {
zoom: 14,
center: this.latlng ? [this.latlng.lng, this.latlng.lat] : ''
@@ -93,9 +92,9 @@ export default {
this.map.addControl(this.geo)
})
},
handleSearch(v) {
if (v) {
this.poi.searchNearBy(v, this.map.getCenter(), 50000)
handleSearch() {
if (this.search) {
this.poi.searchNearBy(this.search, this.map.getCenter(), 50000)
}
},
handleConfirm() {