Change defaults for symbol on google maps polyline

google-maps-api-3

Solution

In your code, lineSymbol is a Symbol object, arrow is a IconSequence, and flightPath is a Polyline. You put the symbol's strokeColor and strokeOpacity on the IconSequence, but it belongs on the Symbol.

var lineSymbol = {
        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW
        strokeColor: "#000000",
        strokeOpacity: 1
};
var arrow = {
    icon: lineSymbol,
    offset: '100%'
};
flightPath = new google.maps.Polyline({
    path : somePath,
    strokeColor: "#ff0000",
    strokeOpacity: 1,
    icons : [arrow]
});
flightPath.setMap(map);

Problem

I have a problem with google.maps.Symbol `polyline`. I can not change defaults (like color). Here is my code: ``` var lineSymbol = { path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW }; var arrow = { icon: lineSymbol, offset: '100%', strokeColor: "#000000", strokeOpacity :1, }; flightPath = new google.maps.Polyline({ path : somePath, strokeColor: "#ff0000", strokeOpacity: 1, icons : [arrow], }); flightPath.setMap(map); ``` After this, I expect that arrows will be black (`#000000 color`), but they are still `#ff0000`. Also I tried to change the scale for Symbol, but nothing happened.

Original source