正常操作,点击marker气泡显示,然后点击气泡无法获取正确Id
- 发布:2020-12-22 15:21
- 更新:2020-12-22 15:30
- 阅读:1175
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 10
HBuilderX类型: 正式
HBuilderX版本号: 2.9.8
手机系统: Android
手机系统版本号: Android 10
手机厂商: OPPO
手机机型: 一加7pro
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
获取正确Id
获取正确Id
实际结果:
无法获取正确Id
无法获取正确Id
bug描述:
点击marker上的气泡,获取到的event.detail.markerId,不知道从哪来的,和我设置的markerId完全不一致。
e.target和e.currentTarget都能显示出我的marker数组,可以看到他的markerId。
难道是这个Id长度有限制?
{
"type": "callouttap",
"timeStamp": 1608621376681,
"target": {
"id": "map",
"dataset": {
"mark": [{
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3649373140339712",
"latitude": 22.57463307932597,
"longitude": 113.92843800919093,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}, {
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3459752870087680",
"latitude": 22.571507141031468,
"longitude": 113.92809808760865,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}, {
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3262914203468800",
"latitude": 22.57164996614238,
"longitude": 113.92810071731128,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}]
},
"offsetLeft": 0,
"offsetTop": 0
},
"currentTarget": {
"id": "map",
"dataset": {
"mark": [{
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3649373140339712",
"latitude": 22.57463307932597,
"longitude": 113.92843800919093,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}, {
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3459752870087680",
"latitude": 22.571507141031468,
"longitude": 113.92809808760865,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}, {
"iconPath": "/static/common/images/maphome@3x.png",
"id": "3262914203468800",
"latitude": 22.57164996614238,
"longitude": 113.92810071731128,
"width": 40,
"height": 40,
"callout": {
"content": "删除此住所标记",
"color": "#ff0000",
"fontSize": 16,
"borderRadius": 5,
"bgColor": "#ffffff",
"padding": 10,
"display": "BYCLICK"
}
}]
},
"offsetLeft": 0,
"offsetTop": 0
},
"detail": {
"markerId": 2147483647
},
"stopPropagation": "function() { [native code] }"
}
t***@vip.qq.com (作者)
谢谢,通过此办法已解决。这点希望可以标注在文档里面,以免后续有人在遇到这个问题。因为编译到小程序时这个功能是正常的
2020-12-23 16:31