uni-app 使用map地图组件中的marker,设置气泡后,点击气泡的回调函数callouttap无法返回当前气泡信息
uni-app 使用map地图组件中的marker,设置气泡后,点击气泡的回调函数callouttap无法返回当前气泡信息
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
Windows | 11 | HBuilderX |
示例代码:
<template>
<map class="map" :latitude="latitude" :longitude="longitude" :markers="covers" @callouttap="callouttap" @markertap="markerTap"></map>
</template>
<script setup>
const covers = [{
latitude: 39.909,
longitude: 116.39742,
with:rpxTopx(48),
height:rpxTopx(52),
markerId:1,
id:1,
// label:{
// content:'故宫博物馆',
// },
callout:{
content:'故宫博物馆',
display: 'ALWAYS',
fontSize: rpxTopx(22),
bgColor: '#0180CC',
borderRadius:'100',
color:'#fff',
markerId:1,
id:1,
padding:rpxTopx(8)+'px '+rpxTopx(24),
anchorY:'0'
},
iconPath: '../../static/images/marker.png'
}, {
latitude: 39.90,
longitude: 116.39,
with:rpxTopx(48),
height:rpxTopx(52),
id:2,
markerId:2,
callout:{
content:'朝阳公园',
display: 'ALWAYS',
fontSize: rpxTopx(22),
bgColor: '#0180CC',
borderRadius:'100',
id:2,
markerId:2,
color:'#fff',
padding:rpxTopx(8)+'px '+rpxTopx(24),
},
iconPath: '../../static/images/marker.png'
}]
const callouttap = (e)=>{
console.log(e,'点击气泡')
}
</script>
操作步骤:
设置callout气泡,设置callouttap回调事件,无返回对应信息
预期结果:
获取到对应气泡点击信息
实际结果:
无法获取
bug描述:
使用map地图组件当中的marker,设置callout气泡后,点击气泡的回调函数callouttap,无法返回当前气泡信息
更多关于uni-app 使用map地图组件中的marker,设置气泡后,点击气泡的回调函数callouttap无法返回当前气泡信息的实战教程也可以访问 https://www.itying.com/category-93-b0.html
3 回复
你好,你是返回的markerid为NaN吗,这个问题会在下个版本更新后修复
更多关于uni-app 使用map地图组件中的marker,设置气泡后,点击气泡的回调函数callouttap无法返回当前气泡信息的实战教程也可以访问 https://www.itying.com/category-93-b0.html
是的,下个版本预计多久呢
回复 1***@163.com: 这几天吧,关注alpha版