hbuilder用uniapp写的高德地图运行到微信小程序不显示,在manifest.json源码视图中加上"requiredPrivateInfos": ["getLocation"]。
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "微信开发者工具appid",
"setting" : {
"urlCheck" : false,
"postcss" : true,
"minified" : true
},
"lazyCodeLoading" : "requiredComponents",
"requiredPrivateInfos": ["getLocation"],
"usingComponents" : true,
"optimization" : {
"subPackages" : true
},
"permission" : {
"scope.userLocation" : {
"desc" : "获取定位"
}
}
}