如何访问 Google 地图 V3 中由 DirectionsRenderer 创建的对象
有没有一种简单的方法来访问由 DirectionsRenderer 创建的标记和信息窗口的对象/属性? (即路线的“A”和“B”端点)
我正在寻找替换“A”和“B”端点。 “B”标记的信息窗口与我从另一个“非路线”标记创建的信息窗口(包含动态内容)。
我尝试将以前的信息窗口中的内容复制到新的“路线一”中,如下所示,但它无法正确呈现(太多的祖先 div 和样式约束)。
//infowin is a reference to the infowindow attached to the marker
result.routes[0].legs[0].end_address = MarkersArray[i].infowin.getContent();
谢谢, 乙
Is there an easy way to get access to the objects/properties of the markers and infowindows created by the DirectionsRenderer? (i.e. the "A" and "B" endpoints of the route)
I'm looking to replace the "A" & "B" markers' infowindows with one that I've created (containing dynamic content) from another "non-route" marker.
I've tried to copy the content from the previous infowindow into the new "route one" like this below, but it doesn't render properly (too many ancestor div & styling constraints).
//infowin is a reference to the infowindow attached to the marker
result.routes[0].legs[0].end_address = MarkersArray[i].infowin.getContent();
Thanks,
E
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试解决同样的问题。我没有找到任何方法来获取标准开始或结束图标。
您可以停用路线图标并设置自定义标记。
I try to solve the same problem. I dont't found any method to get the standart start or end icon.
You can disable the icons for the route and set a coustom marker.