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

map控件里label和callout同时使用

问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 小程序 Bug map 工具 6.6.6 1.9.1

map控件里label和callout同时使用,点击market,callout会同时出现两个。

网友回复

瘦马难寻:

你好,IOS上测试点击marker,只会出现一个callout,麻烦提供下代码片段和机型相关信息

炒了个饭:

js:

latitude: 40.069,

longitude: 116.129,

markers: [{

id: 382712,

latitude: 40.07103,

longitude: 116.12672,

iconPath: '/image/zhfw.png',

width: 16,

height: 16,

label: { content: '安云影像', color: '#db5712', x: -16, y: 6, fontSize: 8 },

callout: { content: '去逛逛', color: '#db5712', display: 'BYCLICK', borderRadius: 5, fontSize: 8, display: 'BYCLICK' },

anchor: { x: .5, y: .5 }

},

{

id: 382715,

latitude: 40.071445,

longitude: 116.12731,

iconPath: '/image/mscy.png',

width: 16,

height: 16,

label: { content: '安河家园小\n顾披萨外卖', color: '#db1296', x: -16, y: 6, fontSize: 8 },

callout: { content: '去逛逛', color: '#db1296', display: 'BYCLICK', borderRadius: 5, fontSize: 8, display: 'BYCLICK' },

anchor: { x: .5, y: .5 }

}

],

wxml:

<map

id="myMap"

style="width: 100%; height: 100%;"

latitude="{{latitude}}"

longitude="{{longitude}}"

markers="{{markers}}"

circles="{{circles}}"

scale = "17"

bindmarkertap="markertap"

bindcallouttap = "bindcallouttap"

bindtap="bindtap"

show-location

></map>


娇华:

你好,麻烦提供下代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html?search-key=%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5)

评论 抢沙发

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

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

云免签H5支付