小程序
小游戏
企业微信
微信支付
扫描小程序码分享
在地图上我想根据地图的缩放来动态改变markers显示的多少,我根据地图的缩放等级来进行判断,然后setData
但是在苹果手机上实现了
安卓手机(华为)却不行 地图放大可以增加markers但缩小的时候却不会减少markers
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
小米6 微信最新版本 华为TRT-AL00A 微信最新版本
regionchange: function (e) {
if (e.type == "end") {
var that = this;
this.mapCtx.getScale({
success: function (e) {
console.log("缩放级别", e.scale)
var lists = that.data.markers.slice(0, 3);
if (e.scale > 13) {
} else if (e.scale > 7){
} else {
}
console.log(lists) //打印的值已经减少来了 但是页面上体现不出来
that.setData({
markers: lists
})
},
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html按照教程提供下
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
小米6 微信最新版本 华为TRT-AL00A 微信最新版本
regionchange: function (e) {
if (e.type == "end") {
var that = this;
this.mapCtx.getScale({
success: function (e) {
console.log("缩放级别", e.scale)
var lists = that.data.markers.slice(0, 3);
if (e.scale > 13) {
} else if (e.scale > 7){
} else {
}
console.log(lists) //打印的值已经减少来了 但是页面上体现不出来
that.setData({
markers: lists
})
}
})
}
},
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html按照教程提供下