We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述 H5 Map组件高德地图callout弹出后立即自动关闭,貌似触发了两次,但奇怪的是前几个月时还正常,最近突然不行了,也没有做过版本更新。
复现步骤
<template> <view class="content"> <map ref="map" id="map" class="map" :latitude="latitude" :longitude="longitude" :markers="markers" :polyline="polyline" :include-points="points" > </map> </view> </template> <script> export default { data() { return { title: "Hello", markerIcon: require("@/static/marker.png"), latitude: null, longitude: null, markers: [], polyline: [], points: [], }; }, onReady() { this.initMap(); }, methods: { initMap() { let data = [ { longitude: 116.284451, latitude: 39.823066, }, { longitude: 117.064522, latitude: 40.133483, }, { longitude: 117.093158, latitude: 40.14781, }, ]; let markers = []; let points = []; let i = 0; for (let item of data) { if (i === 0) { this.latitude = item.latitude; this.longitude = item.longitude; } let marker = { latitude: item.latitude, longitude: item.longitude, iconPath: this.markerIcon, width: 25, height: 25, callout: { //自定义标记点上方的气泡窗口 点击有效 content: "测试", //文本 padding: 5, color: "#ffffff", //文字颜色 fontSize: 14, //文本大小 borderRadius: 2, //边框圆角 bgColor: "#00c16f", //背景颜色 display: "BYCLICK", //常显 }, }; markers.push(marker); let point = { latitude: item.latitude, longitude: item.longitude, }; points.push(point); i++; } this.markers = markers; this.points = points; this.polyline = [ { points: points, color: "#0081ff", width: 3, arrowLine: true, dottedLine: true, }, ]; }, }, }; </script> <style> .map { width: 100%; height: 400px; } </style>
预期结果 正常应该点击marker后显示,再次点击关闭
实际结果 点击marker后闪烁
系统信息:
补充信息
map-marker.js
click
touchend
touched
e.preventDefault()
callout.js
The text was updated successfully, but these errors were encountered:
Otto-J
zhenyuWang
No branches or pull requests
问题描述
H5 Map组件高德地图callout弹出后立即自动关闭,貌似触发了两次,但奇怪的是前几个月时还正常,最近突然不行了,也没有做过版本更新。
复现步骤
预期结果
正常应该点击marker后显示,再次点击关闭
实际结果
![动画](https://private-user-images.githubusercontent.com/5761981/277214809-3507df4c-790a-4e87-8d6f-2c81515cb237.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1OTIwOTEsIm5iZiI6MTcyNDU5MTc5MSwicGF0aCI6Ii81NzYxOTgxLzI3NzIxNDgwOS0zNTA3ZGY0Yy03OTBhLTRlODctOGQ2Zi0yYzgxNTE1Y2IyMzcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTMxNjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjI1N2U2ZjBhMDNiZjc5ZDIxZmIyNjlmZWVkMGFlY2FhYzIwNzA3YmRiNGRhNjQ4M2U2MjFmYTllOGM3OTg2NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.PA5Q0TUzN_bnvDohcjp12JwzXuFhXdFIeC9SnR6xQMU)
点击marker后闪烁
系统信息:
补充信息
map-marker.js
中同时监听了click
和touchend
,然后两个都触发了,是否应该先增加touched
监听,然后在监听方法中通过e.preventDefault()
来阻止click
事件触发,在callout.js
文件中也有类似的同时监听的代码。The text was updated successfully, but these errors were encountered: