How do I change the color of traffic levels on Google Maps?

Is there a way to change the default traffic colors of the traffic layer on a Google map?

+4
source share
1 answer

See Stylized Cards in the documentation.

For example, the following example reduces the saturation of all functions and disables shortcuts on the roads.

  var styles = [
  {
    stylers: [
      { hue: "#00ffe6" },
      { saturation: -20 }
    ]
  },{
    featureType: "road",
    elementType: "geometry",
    stylers: [
      { lightness: 100 },
      { visibility: "simplified" }
    ]
  },{
    featureType: "road",
    elementType: "labels",
    stylers: [
      { visibility: "off" }
    ]
  }
];

map.setOptions({styles: styles});

I created one example for you: see JSFiddle

+1
source

Source: https://habr.com/ru/post/1547692/


All Articles