Android Google Maps v2 remove default markers

前端 未结 2 804
闹比i
闹比i 2020-12-01 21:52

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 me

2条回答
  •  悲哀的现实
    2020-12-01 22:22

    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));
    

提交回复
热议问题