Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Maps v2 remove default markers

I implemented Android Google Maps v2 in my Android app without any problem.

However, the map includes some "default markers" that I haven't included.

I mean, some private business locations.

Is it possible to remove these markers from the map so that I only get the city names and the street names?

like image 242
john518 Avatar asked Jun 24 '15 08:06

john518


People also ask

How do I get rid of the default marker on Google Maps?

Click the "My Places" button just beneath the search bar. Click "Maps" and wait for the list of maps to appear down the left side of the screen. When they do, click the title of the map containing the marker that you want to remove.

How do I get rid of blue markers on Google Maps?

If you want to remove the pin from Google Maps, simply right click on it and select "Remove this destination." Poof, it's gone.

How do I hide markers on Google Maps?

Step 1 Go to Add or Edit Map and Scroll down to the 'Infowindow Settings' section. Step 2 Enable the box of 'Hide Markers on Page Load' option. Step 3 Click on Save Map and open it in browser.

How do I change the marker on Google Maps Android?

For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.


1 Answers

You can do it simply by modification of the map style: Adding a Styled Map

  1. Create JSON file src\main\res\raw\map_style.json like this:
[
  {
    featureType: "poi",
    elementType: "labels",
    stylers: [
      {
        visibility: "off"
      }
    ]
  }
]
  1. Add map style to your GoogleMap
googleMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));
like image 71
Jozef Avatar answered Oct 22 '22 13:10

Jozef