I am working on Android Studio with the Maps Api. On the shown map, there are markers that have been already placed by Google (see picture below).
Is there a way to interact with them by clicking to get more information (e.g. id of marker/place)?
The predefined markers added by Google are called Points of Interest (POI). The GoogleMaps class provides a special listener for POIs: GoogleMap.OnPoiClickListener
You can find corresponding documentation in
The code snippet should be something like
mMap.setOnPoiClickListener(new GoogleMap.OnPoiClickListener() {
@Override
public void onPoiClick(PointOfInterest poi) {
String placeId = poi.placeId;
//TODO: get details for place id
});
}
I hope this helps!