Reputation: 15
I have a question, is it possible to remove all landmarks from the google map, so I could change the scale of the map without landmarks shown?
Upvotes: 1
Views: 4850
Reputation: 21
To hide poi labels, the code below is enough:
options: {
styles: [
{
"featureType": "poi",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
]
}
Upvotes: 2
Reputation: 4553
Google has provided a UI to generate the custom styles. Refer this link.
For react-google-maps
module
<GoogleMap options={{styles: mapStyles}}>
mapStyles
is the custom style to be applied to the map.
Upvotes: 3
Reputation: 256
Feed below styles into your map - styles: [{"stylers":[{"visibility":"off"}]},{"featureType":"road","stylers":[{"visibility":"on"},{"color":"#ffffff"}]},{"featureType":"road.arterial","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"road.highway","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"landscape","stylers":[{"visibility":"on"},{"color":"#f3f4f4"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#7fc8ed"}]},{},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#83cead"}]},{"elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"weight":0.9},{"visibility":"off"}]}]
inside mapOptions array. When you provide this mapoption to your google map, there will be no markers.
Upvotes: 3