Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding/Removing business names & markers in react-native-maps' mapview

I'm implementing my custom marker pin in MapView component. Are there a way to hide or remove third party markers, like hotels, restaurants, sales stores, etc...?

I have searched in component docs but found nothing.

like image 899
Marcos Favarão Avatar asked Oct 27 '25 05:10

Marcos Favarão


1 Answers

As far as I know, there is one way to turn off the business texts and markers. It is when we are applying a style to <MapView>'s customMapStyle property.

From this site, https://mapstyle.withgoogle.com/ , skip to styling selecting "use the Legacy JSON styling wizard" enter image description here

Then select "more options" for a more specific styling. enter image description here

Select Points of Interest, then select Business, then select Text fill and Text Outline and make their visibility as hidden. enter image description here

We'll click "Finish" button, then "copy JSON" button. Now we have JSON formatted data copied. enter image description here

You may hold this info in a variable named, say mapStyle

mapStyle=
[
  {
    "featureType": "poi.business",
    "elementType": "labels.text.fill",
    "stylers": [
      {
        "visibility": "off"
      }
    ]
  },
  {
    "featureType": "poi.business",
    "elementType": "labels.text.stroke",
    "stylers": [
      {
        "visibility": "off"
      }
    ]
  }
]

The last thing to do is to use mapStyle and making it equal to customMapStyle property like this..

<MapView 
  customMapStyle={mapStyle}

  {/*other properties*/}   
 />
like image 126
Uygar Uçar Avatar answered Oct 29 '25 08:10

Uygar Uçar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!