| | |
| | | > |
| | | 查询 |
| | | </el-button> |
| | | <el-button |
| | | v-if="$parent.mapType==='edit'" |
| | | type="primary" |
| | | :disabled="placeSearchName===''" |
| | | @click="close" |
| | | > |
| | | 确定 |
| | | </el-button> |
| | | </div> |
| | | <div id="mapd" /> |
| | | </div> |
| | |
| | | map: null, |
| | | geolocation: null, |
| | | marker: null, |
| | | placeSearchName: null, |
| | | placeSearchName: '', |
| | | mapPlaceSearch: null, |
| | | position: [], |
| | | positionInput: '' |
| | |
| | | map: map, |
| | | position: that.$parent.position |
| | | }) |
| | | that.positionInput = that.$parent.position.join(',') |
| | | that.positionInput = that.toFixed(that.$parent.position[0], 8) + ',' + that.toFixed(that.$parent.position[1], 8) |
| | | that.marker.setMap(map) |
| | | that.map.setCenter(that.$parent.position) |
| | | that.marker.setAnimation('AMAP_ANIMATION_BOUNCE') |
| | | this.placeSearchName = this.$parent.address |
| | | } |
| | | }, |
| | | toFixed (str, decimalPlaces) { |
| | | const num = parseFloat(str) |
| | | return num.toFixed(decimalPlaces) |
| | | }, |
| | | getAddress (position) { |
| | | AMap.plugin('AMap.Geocoder', () => { |
| | | const geocoder = new AMap.Geocoder({}) |