Commit fd0463c1 by wangzhihui

地图切换

1 parent f66b9639
......@@ -13,7 +13,7 @@
</template>
<script>
import '../../assets/spritesmith-generated/sprite.css'
import mapService from 'utils/mapService.js'
import mapService from 'utils/mapBService.js'
import { mapGetters, mapActions } from 'vuex'
export default{
......
......@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-12-06 14:10:32
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2024-12-21 15:52:17
* @LastEditTime: 2024-12-23 14:10:33
* @FilePath: \oEshield\src\utils\mapBService.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -100,19 +100,17 @@ MapService.prototype = {
this.map.invoke('distanceToolclose') // 关闭测距
},
getCurrentLocation: function() {
var self = this;
self.map.invoke('Geolocation', res => {
console.log(res,999)
// self.currentMarker && self.map.remove(self.currentMarker);
// var lnglatXY = self.getLngLat(res.point.lng, res.point.lat);
var lnglatXY = self.getLngLat(116.404, 39.915);
console.log(lnglatXY,'lnglatXY')
self.currentMarker = self.createMarker(lnglatXY);
// self.setFitView()
})
},
var self = this
const { map } = this
self.currentMarker && map.invoke('removeOverlay', self.currentMarker)
map.invoke('Geolocation', res => {
console.log(res, 'Geolocation')
const lngLatXY = self.getLngLat(res.longitude, res.latitude)
self.currentMarker = self.createMarker(lngLatXY)
console.log(self.currentMarker, 'self.currentMarker')
map.invoke('addOverlay', self.currentMarker)
})
},
createMarker: function(lnglatXY) {
let that=this,
url=require('images/mapLocation.gif'),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!