带有自定义标记形状的谷歌地图似乎不起作用
我尝试将可点击/鼠标悬停区域减少为具有自定义圆形形状的标记的圆形区域,但该区域仍然太大。
new google.maps.Marker({
position: { lat: 40.97, lng: -2.3 },
label: "A",
title: "My custom title",
map: map,
shape: {
coords: [14, 14, 14],
type: 'circle'
}});
您可以尝试使用此 jsfiddle 并看到悬停很久之前就开始了当你到达标记处时,它的形状似乎总是矩形的。
I try to reduce the clickable/mouse-hover area to the round area of the marker with a custom circle shape, but this area is still too big.
new google.maps.Marker({
position: { lat: 40.97, lng: -2.3 },
label: "A",
title: "My custom title",
map: map,
shape: {
coords: [14, 14, 14],
type: 'circle'
}});
You can try with this jsfiddle and see that the hover starts long before you get to the marker and always seems to be rectangular in shape.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法解释这种行为,但它似乎只发生在我的机器上的任何浏览器上。在其他系统上不再出现该问题。
铬99.0.4844.51
Windows 10 专业版 21H2
I can't explain this behavior but it seems that it only happens on my machine with any browser. The problem no longer occurs on other systems.
Chrome 99.0.4844.51
Windows 10 Pro 21H2