标准基座获取定位可以获取address城市,自定义基座获取不到address

正常的返回应该

{
    "type": "WGS84",
    "altitude": 0,
    "latitude": 31.830118,
    "longitude": 117.128463,
    "speed": 0,
    "accuracy": 83,
    "address": {
        "country": "中国",
        "province": "安徽省",
        "city": "合肥市",
        "district": "蜀山区",
        "street": "望江西路",
        "streetNum": "5089号",
        "poiName": "湖山别墅",
        "cityCode": "0551"
    },
    "errMsg": "getLocation:ok"
}

解决方法:

需要在manifest.json文件可视化界面的“模块权限配置”中添加“Maps地图”,并在“SDK配置”设置地图相关的配置信息(百度地图或高德地图)。

 

posted @ 2020-09-21 15:57  奔跑吧前端(李钊)  阅读(365)  评论(0编辑  收藏  举报