插件包 地铁图appId: wx6aaf93c4435fa1c1,版本1.02,官方文档https://lbs.qq.com/miniprogram_plugin/subway.html-----------以下为本地小程序配置------------------------ ------------app.json---- //引入插件包
"plugins": {
"subway": {
"version": "1.0.2",
"provider": "wx6aaf93c4435fa1c1"
}
},
//授权
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序定位"
}
},
-----------------------index.js-------------------------
//事件处理函数
contact: function(){
let plugin = requirePlugin("subway");
let key = 'M7TBZ-C6T3U-I4VVT-2AQJT-6BJYF-ADBPJ';//使用在腾讯位置服务申请的key;
let referer = 'miniWeb'; //调用插件的app的名称
wx.navigateTo({
url: 'plugin://subway/index?key=' + key + '&referer=' + referer
})
},-------------console输出----------------
VM452:1 thirdScriptError
Page is not a function; [Component] Event Handler Error @ pages/index/index#bound contact
TypeError: Page is not a function
at http://127.0.0.1:28436/appservice/__onlineplugin__/wx6aaf93c4435fa1c1/1.0.2/appservice.js:1450:56
at h (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5341)
at http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5477
at http://127.0.0.1:28436/appservice/__onlineplugin__/wx6aaf93c4435fa1c1/1.0.2/appservice.js:1452:2
at g (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5573)
at _ (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5924)
at r.contact (http://127.0.0.1:28436/appservice/pages/index/index.js:24:18)
at Object.r.safeCallback (http://127.0.0.1:28436/appservice/__dev__/WAService.js:14:10521)
at http://127.0.0.1:28436/appservice/__dev__/WAService.js:16:19796
at d (http://127.0.0.1:28436/appservice/__dev__/WAService.js:16:22199)
报 Page is not a function 是因为插件需要基础库的插件页面支持(2.1.0)。
具体插件的问题需要联系插件开发者。
您好,目前腾讯位置服务地铁图插件已经修复样式错乱问题,请关注升级。
问题找到了,调试基础库的版本调高点就好了,调成了最新版本2.8,但是有新的问题,地铁插件的布局乱了,并且看不到下面部分,我也控制不了插件的布局,如下图
同样的调用方式,路线规划的插件就没问题,如下图