html52.com
我爱小程序-开发者交流社区

安卓小程序 Map 组件 bindtap 无效

问题模块
API和组件

微信版本:6.5.16.1120

基础库版本:1.6.3(2017.10.20 15:03:22)


安卓小程序 Map 组件绑定点击事件无效,iPhone 没问题

网友回复

马仔:

你好,请问map 组件的bindtap事件,正常了吗?

M&S:

好的,麻烦看一下我的另一个问题呢【小程序 cover-view 设置 align-items 无效

黄思程:

你好,这是一个已知问题,我们会尽快进行修复。

M&S:

试了一下,是地图有 marker 时,绑定地图本身(非 marker)的点击事件,不会触发。下面是可复现代码:

<map longitude="{{longitude}}" latitude="{{latitude}}" markers="{{markers}}" bindtap="maptap"></map>
Page({
  data: {
    longitude: 116.39750,
    latitude: 39.90871,
    markers: [{
      longitude: 116.39750,
      latitude: 39.90871,
      iconPath: './marker.png',
      width: 32,
      height: 40
    }]
  },
  maptap() {
    wx.showToast({ title: 'fire' });
  }
});


黑色巧克力:

微信版本:6.5.16,基础库版本 1.6.0

黑色巧克力:

先看下我的,官方提供的示例代码,在iphone6s上点击Marker,很难响应事件,点很多次才能响应一次

<!-- map.wxml --><map id="map" longitude="113.324520" latitude="23.099994" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: 300px;"></map>

// map.jsPage({
  data: {
    markers: [{
      iconPath: "/resources/others.png",
      id: 0,
      latitude: 23.099994,
      longitude: 113.324520,
      width: 50,
      height: 50
    }],
    polyline: [{
      points: [{
        longitude: 113.3245211,
        latitude: 23.10229
      }, {
        longitude: 113.324520,
        latitude: 23.21229
      }],
      color:"#FF0000DD",
      width: 2,
      dottedLine: true
    }],
    controls: [{
      id: 1,
      iconPath: '/resources/location.png',
      position: {
        left: 0,
        top: 300 - 50,
        width: 50,
        height: 50
      },
      clickable: true
    }]
  },
  regionchange(e) {    console.log(e.type)
  },
  markertap(e) {    console.log(e.markerId)
  },
  controltap(e) {    console.log(e.controlId)
  }
})


黄思程:

你好,请提供一下能复现问题的简单代码示例。

黑色巧克力:

点Marker有没有响应bindmarkertap事件?

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付