I am trying to style the map which shows the directions of all roads without the road numbers on them.
{
featureType: "road.highway",
elementType: "labels.icon",
stylers: [
{color:"#979897"},
{ lightness: 50 },
{ visibility: "off" }
]
},
But this removes the directions on the road as well the numbers.I want to show only the directions without the highway numbers.
This code removes all icons as well as labels. I am not sure what you mean by directional arrows, is this an additional layer you have?
[
{
"featureType": "road",
"elementType": "labels",
"stylers": [
{ "visibility": "off" }
]
}
]
There's a very useful styling tool which allows you to visually tweak map settings, which then spits out the JSON you need for your settings:
https://mapstyle.withgoogle.com/
Jeremy's answer will remove labels from all roads, including highways, arterial roads and local roads. I suspect you only want to hide highway numbers, so use:
[
{
"featureType": "road.highway",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
}
]
(This will also hide highway labels though).
You can also remove labels for arterial and local roads separately, if desired, by adding additional JSON objects using the following as the "featureType":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With