Google.maps.Polyline - how to get a transparent / invisible polyline?

I have the following code for the route where the animation continues, so I need a polyline, but I don't want to show it:

[..] this.polyline = new google.maps.Polyline({ path: [], strokeColor: '#ffffff', strokeWeight: 0 }); [..] 

A polyline is shown with this code. But I want to make the polyline transparent - not visible! How can i do this?

I set strokeColor to "transparent" - which does not work, or not when the option is completely removed. I also set strokeWeight to 0, but these options are not affected. I also tried strokeOpacity from 0.0 to 1.0 - also no effect. Does anyone know a solution? - PS: when I change the color to # ff0000, the color should be red, right? but the parameters do not seem to work at all, but the polyline is displayed, and I have no JavaScript errors in console.log ...?

Here's a link to a link with almost the same example ...

+4
source share
1 answer

This 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 does not work.

An example of a simple polyline from the Google Maps API v3 documentation

same code with transparent polyline

A similar question about transparent polylines on FusionTablesLayers

+4
source

All Articles