使用破折号或点设置 Google 地图 v3 折线样式?
我想要一张基于 Google Map v3 的地图,其中包含一些自定义折线,并将其中一些线设为点线或虚线。我似乎找不到任何方法可以做到这一点。可能吗?如果可能的话,如何实现?
I'd like to take a Google Map v3-based map with some custom polylines, and make some of those lines dotted or dashed. I can't seem to find any way of doing this. Is it possible, and if so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此功能已添加到折线选项中,称为折线上的符号< /strong>
创建虚线如下所示 (demo):
短划线长度由
path
的 +/-1 控制,间距由repeat< 控制/代码>。虽然有点冗长,但是非常灵活。
除了破折号之外,新功能还包括圆形、箭头的预定义路径,文档甚至还包括动画演示:)
This feature has been added to Polyline options, and it's called Symbols on Polylines
Creating a dashed line looks like this (demo):
Dash length is controlled by
path
's +/-1, and spacing is controlled byrepeat
. It's a bit verbose, but very flexible.Besides dashes, the new feature includes predefined paths for a circle, arrowheads, and the docs even include an animation demo :)