-1

Image below is from Google Maps. Can we do similar things in our Android app? I believe those are not markers, instead it's an icon and label.

screenshot taken from google map

Some even have a snippet/subtitle under the label, like the Top Rated under the label. I don't know what keyword to search to find a way to do this in our own app. screenshot taken from google map

imin
  • 4,504
  • 13
  • 56
  • 103

1 Answers1

1

Yes it's possible. You need to:

  1. Remove all "default" places labels from map like in this answer of josef:

a) create JSON file src\main\res\raw\map_style.json like this:

[
  {
    featureType: "poi",
    elementType: "labels",
    stylers: [
      {
        visibility: "off"
      }
    ]
  }
]

b) add map style to your GoogleMap:

`googleMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));`
  1. Get information about places "manually" via Places SDK for Android and parse information about each place. For example, you need get Place Details for each place and analyze Place.Field.RATING and Place.Field.USER_RATINGS_TOTAL to determine "top rated" places. And don't forget to enable Places API for your application.

  2. Create custom marker with text like in answers for this question. Or draw whatever you need directly on MapView (or MapFragment) canvas via creating custom view that extends MapView (or MapFragment) like in that answer.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79