<map id="id" @tap="tap"></map>
 
                                        
                                    
                                    - 发布:2024-04-01 10:00
- 更新:2025-10-22 14:04
- 阅读:285
产品分类: uniapp/H5
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 13.0 (22A380)
HBuilderX版本号: 4.07
浏览器平台: Chrome
浏览器版本: 版本 123.0.6312.86(正式版本) (arm64)
项目创建方式: CLI
CLI版本号: 3.7.11
示例代码:
                                    
                                    
                                         
                                
                                                                                                操作步骤:
                                    
                                        <map id="id" @tap="tap"></map>
                                     
                                
                                                                                                <map id="id" @tap="tap"></map>
预期结果:
                                    
                                    
                                        <map id="id" @tap="tap"></map>
                                     
                                
                                                                                                <map id="id" @tap="tap"></map>
实际结果:
                                    
                                    
                                        {
"type": "click",
"timeStamp": 0,
"detail": {
"x":undefined
"y": NaN
},
"target": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {},
"x":undefined
"y": NaN
},
"currentTarget": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {}
},
"touches": [
{
"force": 1,
"identifier": 0
}
],
"changedTouches": [
{
"force": 1,
"identifier": 0
}
],
"mp": {
"@warning": "mp is deprecated",
"type": "click",
"timeStamp": 0,
"detail": {
"x":undefined
"y": NaN
},
"target": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {},
"x":undefined
"y": NaN
},
"currentTarget": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {}
},
"touches": [
{
"force": 1,
"identifier": 0
}
],
"changedTouches": [
{
"force": 1,
"identifier": 0
}
]
},
"_processed": true
}
                                     
                                
                                                            {
"type": "click",
"timeStamp": 0,
"detail": {
"x":undefined
"y": NaN
},
"target": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {},
"x":undefined
"y": NaN
},
"currentTarget": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {}
},
"touches": [
{
"force": 1,
"identifier": 0
}
],
"changedTouches": [
{
"force": 1,
"identifier": 0
}
],
"mp": {
"@warning": "mp is deprecated",
"type": "click",
"timeStamp": 0,
"detail": {
"x":undefined
"y": NaN
},
"target": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {},
"x":undefined
"y": NaN
},
"currentTarget": {
"id": "NearbyLocation",
"offsetLeft": 0,
"offsetTop": 44,
"dataset": {}
},
"touches": [
{
"force": 1,
"identifier": 0
}
],
"changedTouches": [
{
"force": 1,
"identifier": 0
}
]
},
"_processed": true
}
bug描述:
在H5中,tap事件点击之后,里面的坐标轴无法获取。
用的是高德地图,
 
             
             
             
			 
                                                                    
 
                                                                     
            
c***@gmail.com (作者)
"x":undefined
"y": NaN
我的本意是X和Y值,无法获取。
我有看官方文档,是不支持经纬度。
2024-04-03 17:04