| | |
| | | const jweixin = require('jweixin-module') |
| | | window.wx = {} |
| | | /*引入,注释可关闭*/ |
| | | // import vconsole from "vconsole"; |
| | | // Vue.prototype.vconsole = new vconsole(); |
| | | import vconsole from "vconsole"; |
| | | Vue.prototype.vconsole = new vconsole(); |
| | | Vue.config.productionTip = false |
| | | Vue.prototype.$store = store |
| | | Vue.prototype.$jweixin = jweixin |
| | |
| | | navigator.geolocation.getCurrentPosition(success, error, options);
|
| | |
|
| | | function success(position) {
|
| | | geoconv({coords:`${position.coords.longitude},${position.coords.latitude}`}).then(res=>{
|
| | | console.log('position', position)
|
| | | geoconv({
|
| | | coords: `${position.coords.longitude},${position.coords.latitude}`
|
| | | }).then(res => {
|
| | | console.log('res', res)
|
| | | const latitude = res.data.result[0].y;
|
| | | const longitude = res.data.result[0].x;
|
| | | var point = new BMapGL.Point(longitude, latitude); // 创建点坐标
|
| | |
| | | }
|
| | |
|
| | | function error(err) {
|
| | | console.log('err', err)
|
| | | switch (err.code) {
|
| | | case err.PERMISSION_DENIED:
|
| | | console.error("用户拒绝了位置请求。");
|