微信小程序使用插件官方文档:https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/using.html
uniapp项目的manifest.json文件:
"permission" : {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序定位"
}
},
"plugins" : {
"routePlan" : {
"version" : "1.0.19",
"provider" : "wx50b5593e81dd937a"
}
}
实际页面中使用的代码模板:
let plugin = requirePlugin('routePlan');
let key = 'xxx'; //使用在腾讯位置服务申请的key
let referer = 'xx'; //调用插件的app的名称
let endPoint = JSON.stringify({ //终点
'name': '北京西站',
'latitude': 39.894806,