Search code examples
javascriptgoogle-mapsgoogle-polyline

Is there a way to remove the line under a symbol in Google map polyline?


This link shows how to animate google map symbols: https://developers.google.com/maps/documentation/javascript/examples/overlay-symbol-animate

Is there a way to remove the black line under the animated circle (but still show the green circle)?

Reason I am asking is because I want the animated circle to move ABOVE a dashed-line instead.

Thanks


Solution

  • The line is simply a Polyline object. Quickest solution is to hide it by setting the strokeOpactity to 0. Read more here

    EDIT: To make the symbol visible, you need to set its strokeOpacity to 1.0 to overwrite line's opacity. Here is a jsfiddle example.