1.开通腾讯、高德地图控制台获取生成的Key
2.找到uniapp项目的主配置文件,manifest.json 配置APP模块,H5模块,相关的key要填写。
![在这里插入图片描述](https://img-blog.csdnimg.cn/eb17d226091b4dc08cee422f9e3fa83b.png
代码如下:
<view class="row citys">
<uni-icons type="location" size="30" color="#fff"></uni-icons>
<text class="city" @tap="clickQH">{
{city}}</text>
</view>
<script>
export default {
data() {
return {
city:'',
}
},
onLoad() {
this.getCitys();
},
methods: {
getCitys(){
var that=this;
uni.chooseLocation({