| | |
| | | <el-row class="place-box"> |
| | | <div class="place-left"> |
| | | <el-form :model="LongLatPos" label-width="90px"> |
| | | <el-form-item label="经度:"> |
| | | <el-input v-model="LongLatPos.longPos"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="纬度:"> |
| | | <el-input v-model="LongLatPos.latPos"></el-input> |
| | | </el-form-item> |
| | | <el-row style="display: flex;align-items: center"> |
| | | <el-form-item label="经度:" style="display: inline-block"> |
| | | <el-col :span="20"> |
| | | <el-input v-model="LongLatPos.longPos"></el-input> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-col :span="4"> |
| | | <el-button type="primary" size="small" @click="mapPoints">点击定位</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="display: flex;align-items: center"> |
| | | <el-form-item label="纬度:"> |
| | | <el-col :span="20"> |
| | | <el-input v-model="LongLatPos.latPos"></el-input> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-col :span="4"> |
| | | <el-button type="primary" size="small" @click="dataPoints">数据定位</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <div class="place-right"> |
| | | <el-button type="primary" size="small" @click="mapPoints">点击定位</el-button> |
| | | <el-button type="primary" size="small" @click="dataPoints">数据定位</el-button> |
| | | </div> |
| | | <!-- <div class="place-right">--> |
| | | <!-- <el-button type="primary" size="small" @click="mapPoints">点击定位</el-button>--> |
| | | <!-- <el-button type="primary" size="small" @click="dataPoints">数据定位</el-button>--> |
| | | <!-- </div>--> |
| | | </el-row> |
| | | <div class="place-bottom" style="text-align: right;margin: 5px"> |
| | | <el-button type="primary" @click="confirm">确认</el-button> |
| | | <el-button type="primary" @click="confirm" size="small">确认</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { pulseEffect } from '../../../../utils/utils' |
| | | import iconUrl from '../../../../../public/assets/images/map/loc.png' |
| | | import iconUrl from '../../../../../public/assets/images/map/marker-icon.png' |
| | | import eventBus from '../../../../eventBus' |
| | | |
| | | export default { |
| | |
| | | LongLatPos: { |
| | | longPos: '', |
| | | latPos: '' |
| | | } |
| | | }, |
| | | marker: null |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | // console.log(as) |
| | | window.map.setView(as, 17) |
| | | pulseEffect(as) |
| | | const marker = window.L.marker(as, { |
| | | this.marker = window.L.marker(as, { |
| | | icon: window.L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [30, 30], |
| | | iconSize: [25, 45], |
| | | iconAnchor: [15, 15] |
| | | }) |
| | | }) |
| | | window.map.addLayer(marker) |
| | | window.map.addLayer(this.marker) |
| | | window.map.off('click') |
| | | }) |
| | | }, |
| | |
| | | // console.log(as) |
| | | window.map.setView(as, 17) |
| | | pulseEffect(as) |
| | | const marker = window.L.marker(as, { |
| | | this.marker = window.L.marker(as, { |
| | | icon: window.L.icon({ |
| | | iconUrl: iconUrl, |
| | | iconSize: [30, 30], |
| | | iconAnchor: [15, 15] |
| | | }) |
| | | }) |
| | | window.map.addLayer(marker) |
| | | window.map.addLayer(this.marker) |
| | | this.LongLatPos.latPos = '' |
| | | this.LongLatPos.longPos = '' |
| | | }, |
| | | // 点击确认按钮事件 |
| | | confirm () { |
| | | window.mapManager.clearHighlight() |
| | | window.map.removeLayer(this.marker) |
| | | eventBus.$emit('location-setChange', true) |
| | | this.LongLatPos.longPos = '' |
| | | this.LongLatPos.latPos = '' |