Interacting with points of interest
It’s possible to get notified about interaction with POI on the map. You can use MapView.addPoiListener
method to add a listener and MapView.removePoiListener
to remove it. The listener must implement PlaceListener
interface.
Example:
MapView.PlaceListener listener = new MapView.PlaceListener() {
@Override
public void onSingleTap(List<Place> places) {
Log.d("MapView", "onSingleTap");
}
@Override
public void onDoubleTap(List<Place> places) {
Log.d("MapView", "onDoubleTap");
}
@Override
public void onLongTap(List<Place> places) {
Log.d("MapView", "onLongTap");
}
};
mapView.addPoiListener(listener);
The places
argument will contain the list of all places around the tapped point.