admin管理员组文章数量:1414928
I have the following code for a route where an animation goes on, so i need the polyline but i don't want to show it:
[..]
this.polyline = new google.maps.Polyline({
path: [],
strokeColor: '#ffffff',
strokeWeight: 0
});
[..]
The polyline is shown with that code. But i want to make the polyline transparent - not visible! How can i do it?
I set the strokeColor to "transparent" - what doesnt work, either not when i remove the option pletely. I also set the strokeWeight to 0 - but these parameters have no effect. I tried also strokeOpacity from 0.0 to 1.0 - also no effect. Knows someone a solution? - PS: when i change the color to #ff0000 the color should be red, right? but it seems to be that the options doesn't work at all - but the polyline is shown and i have no JavaScript errors in the console.log...?
Here the link to the reference with nearly the same example...
I have the following code for a route where an animation goes on, so i need the polyline but i don't want to show it:
[..]
this.polyline = new google.maps.Polyline({
path: [],
strokeColor: '#ffffff',
strokeWeight: 0
});
[..]
The polyline is shown with that code. But i want to make the polyline transparent - not visible! How can i do it?
I set the strokeColor to "transparent" - what doesnt work, either not when i remove the option pletely. I also set the strokeWeight to 0 - but these parameters have no effect. I tried also strokeOpacity from 0.0 to 1.0 - also no effect. Knows someone a solution? - PS: when i change the color to #ff0000 the color should be red, right? but it seems to be that the options doesn't work at all - but the polyline is shown and i have no JavaScript errors in the console.log...?
Here the link to the reference with nearly the same example...
Share Improve this question edited Jan 11, 2013 at 23:53 Roman C 1 asked Jan 11, 2013 at 23:32 ZeussiZeussi 5811 gold badge11 silver badges23 bronze badges1 Answer
Reset to default 4This works for me:
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
strokeColor: '#FF0000',
strokeOpacity: 0.00001,
strokeWeight: 0
});
For some unknown reason strokeOpacity: 0.0 doesn't work.
Simple polyline example from the Google Maps API v3 documentation
same code with a transparent polyline
Similar question about transparent polylines on FusionTablesLayers
本文标签: javascriptgooglemapsPolylinehow to get a transparentinvisible polylineStack Overflow
版权声明:本文标题:javascript - google.maps.Polyline - how to get a transparentinvisible polyline? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745168051a2645802.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论