map组件的bindcontroltap事件绑定无效
发布于 4 年前 作者 ytang 4098 次浏览 来自 问答

这里是视图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)

 }

但是该函数不会触发??????????

2 回复

同样问题,终于感到欣慰了,弄了两天,找不出原因

今天踩了一堆坑,原来是这个图标的显示分辨率太小了

回到顶部