- 发布:2023-02-09 17:15
- 更新:2023-02-27 15:55
- 阅读:724
@regionchange="moveMap"
@markertap="chooseStation"
@callouttap="chooseStation"
>
如上所示,触发regionchange的同时,也触发了markertap事件;
还有个问题是缩放地图时,regionchange返回的causedBy是‘drag’,理应是‘scale’
最佳回复
vue版本及地图服务商是哪个
-
快乐的琪宝贝 (作者)
- 回复 2063586: <template>
- <view>
- <view class="page-body">
- <view class="page-section page-section-gap">
- <map
- style="width: 100%; height: 300px"
- latitude="latitude"
- longitude="longitude"
- markers="covers"
@markertap="clickMarker"
@regionchange="moveMap"
>
</map>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: 0, // 使用 marker点击事件 需要填写id
title: "map",
latitude: 39.909,
longitude: 116.39742,
covers: [
{
id: 1,
latitude: 39.909,
longitude: 116.39742,
iconPath:
"https://app-ccchong-com.oss-cn-qingdao.aliyuncs.com/map_markers_icon.png",
},
{
id: 2,
latitude: 39.9,
longitude: 116.39,
iconPath:
"https://app-ccchong-com.oss-cn-qingdao.aliyuncs.com/map_markers_icon.png",
},
],
};
},
methods: {
moveMap(e) {
console.log("moveMap===>e: ", e.detail.causedBy);
},
clickMarker(e) {
console.log("clickMarker===>e: ", e);
},
},
};
</script>2023-02-13 14:05
-
回复 9***@qq.com: 不行具体指什么,我测试 双指缩放会触发一到多次 regionchange,其中至少有一次 causedBy 为 scale
2023-02-14 15:04
5***@qq.com
赞一个
2023-05-27 15:04