一、在微信小程序中获取位置信息
1、首先引入amap-wx.130.js文件,在项目中可以新建文件夹common,在下面引入该js文件
2、在使用的页面引入该js,
<template>
<view></view>
</template>
<script>
import amap from '@/common/amap-wx.130.js'
export default {
data() {
return {
amapPlugin:null
}
}
}
3、获取定位信息(注意先需要申请高德地图的key)申请方式如下连接
<template>
<view></view>
</template>
<script>
import amap from '@/common/amap-wx.130.js'
export default {
data() {
return {
amapPlugin:null
}
},
async onLoad(item) {