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.
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.
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"
Then select "more options" for a more specific styling.
Select Points of Interest, then select Business, then select Text fill and Text Outline and make their visibility as hidden.
We'll click "Finish" button, then "copy JSON" button. Now we have JSON formatted data copied.
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*/}
/>