<template>
<view>
<map id="map1" ref="map1" :controls="controls" scale="18" min-scale="16" max-scale="19"
:longitude="currentLocation.longitude" :latitude="currentLocation.latitude"
:show-location="showLocation" :show-compass="true"
:enable-poi="enablePoi" :enable-zoom="true" :enable-scroll="true"
:enable-traffic="false" :markers="markers"
:polyline="polyline" :circles="circles" :polygons="polygons" :include-points="includePoints"
@regionchange="onRegionChange">
</map>
</view>
</template>
<script>
export default {
methods: {
onRegionChange(e) {
console.log(JSON.stringify(e));
},
}
}
</script>
![gweii](https://img-cdn-tc.dcloud.net.cn/account/identicon/6e0e0f0a622e62de637c59a27ce78496.png)
- 发布:2021-02-23 09:39
- 更新:2021-02-26 18:58
- 阅读:2028
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: macOS Catalina 10.15.5
HBuilderX类型: 正式
HBuilderX版本号: 3.1.2
第三方开发者工具版本号: 1.05.2102010
基础库版本号: 2.14.3
项目创建方式: HBuilderX
示例代码:
操作步骤:
参考代码片段
参考代码片段
预期结果:
缩放地图后在浏览器的开发者工具的console中立即打印日志
缩放地图后在浏览器的开发者工具的console中立即打印日志
实际结果:
没有立即打印,需要拖动地图后才打印日志
没有立即打印,需要拖动地图后才打印日志
bug描述:
如题
1 个回复
gweii (作者)
用了一个变通的办法来检测缩放等级改变: