开发者

add css to google maps v3 polylines?

开发者 https://www.devze.com 2023-03-11 18:09 出处:网络
is there any way to customise google maps v3 polylines I think the only options mentioned are strokecolor, weight and opacity

is there any way to customise google maps v3 polylines I think the only options mentioned are strokecolor, weight and opacity http://code.google.com/apis/maps/documentation/javascript/r开发者_高级运维eference.html#PolylineOptions


As far as I know, the only options to style Google's polyline are the ones presented in the documentation. There is no way to customize them further by default.

However, what might work is creating a custom polyline class where you can define everything you want, but this is connected to a lot of work. You would have to start by inheriting the OverlayView class and implement all the needed features (Maybe it does also work if you inherit Polyline and overwrite just the drawing methods - the problem is, you don't really know how the original source code looks like).

In fact, for Google Maps V2, Bill Chadwick did this. You can see a demonstration on his website (the dashed polyline example at the bottom). Maybe his implementation helps you to transfer it to Google Maps API V3.

0

精彩评论

暂无评论...
验证码 换一张
取 消