2888关注9335浏览
这里是视图map组件
<map class='map' id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location controls="{{controls}}" bindcontroltap="controltap"></map>
这里是controls的对象数组
controls: [
{
id: 2,
iconPath: '/img/ios.png',
position: {
left: app.globalData.windowWidth / 2 - 12.5,
top: (app.globalData.windowHeight - 40) / 2 - 12.5,
width: 25,
height: 25
},
clickable: true
},
{
id: 1,
iconPath: '/img/ios-active.png',
position: {
left: 8,
top: (app.globalData.windowHeight - 40) - 25 - 8,
width: 25,
height: 25
},
clickable: true
}
]
这里是bindcontroltap所绑定的事件函数
controltap: function (e) {
console.log(e)
}
但是该函数不会触发??????????
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
张小千
2人对此回答表示赞同
今天踩了一堆坑,原来是这个图标的显示分辨率太小了
展开23回复分享发布于 6年前评论(3)
收起评论
要想触发貌似只能放在左上方。。。。。
的确如主所述放中间以下基本触发不到
我还得继续提一点,