Google地图v3多段线工具提示 [英] Google maps v3 polyline tooltip
问题描述
谷歌地图标记对象(google.maps.Marker)具有title属性,因此当用户将鼠标移动到标记上方时,会显示一个简单的工具提示。
多段线上没有title属性(google.maps.Polyline)。有没有一种方法可以做到这一点/在V3模拟此? 我可以在V2中做到这一点,我找不到V3的例子。
干杯
A google maps marker object (google.maps.Marker) has a title property, so when a user moves their mouse over the marker a simple tooltip is displayed.
There isn't a title property on a polyline (google.maps.Polyline). Is there a way I can do this / simulate this in V3? I could do this in V2, and I can't find an example for V3.
If i'm not mistaken i don't think it is possible to set the tooltip since as you mentioned there is not a title property in PolygonOptions object.But you can make a div that looks exactly the same as the tooltip and place it let's say in the tip of your mouse during the mousemove event.I tried also to find a solution to place this tooltip somewhere in the center of the polygon but i think it is too much of a trouble that's why i also think the google guys didn't implement it also. Cheers
这篇关于Google地图v3多段线工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!