Stay organized with collections Save and categorize content based on your preferences.
By default, points of interest (POIs) appear on the base map along with their corresponding icons. POIs include parks, schools, government buildings, and more.
In addition, business POIs appear by default on the map when the map type is normal
. Business POIs represent businesses such as shops, restaurants, hotels, and more. Business POIs on indoor maps (floor plans) appear only on a lite mode map.
A POI corresponds to a Place ID, as defined in the Places SDK for Android. For example, recreational parks are POIs, but things like water fountains are generally not POIs (unless they're of national or historic significance).
Listen for click events on POIsIf you want to respond to a user tapping on a POI, you can use an OnPoiClickListener
as shown in the following code sample:
internal class OnPoiClickDemoActivity : AppCompatActivity(), OnMapReadyCallback, OnPoiClickListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.poi_click_demo) val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment mapFragment.getMapAsync(this) } override fun onMapReady(map: GoogleMap) { map.setOnPoiClickListener(this) } override fun onPoiClick(poi: PointOfInterest) { Toast.makeText(this, """Clicked: ${poi.name} Place ID:${poi.placeId} Latitude:${poi.latLng.latitude} Longitude:${poi.latLng.longitude}""", Toast.LENGTH_SHORT ).show() } }Java
class OnPoiClickDemoActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleMap.OnPoiClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.poi_click_demo); SupportMapFragment mapFragment; mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(GoogleMap map) { map.setOnPoiClickListener(this); } @Override public void onPoiClick(PointOfInterest poi) { Toast.makeText(this, "Clicked: " + poi.name + "\nPlace ID:" + poi.placeId + "\nLatitude:" + poi.latLng.latitude + " Longitude:" + poi.latLng.longitude, Toast.LENGTH_SHORT).show(); } }
POIs appear on the map by default, but there is no default on-click UI. That is, the API does not automatically display an info window or any other user interface when the user taps a POI.
As the above sample shows, you set the OnPoiClickListener
on the map by calling GoogleMap.setOnPoiClickListener(OnPoiClickListener)
. When a user clicks (taps) on a POI, your app receives an OnPoiClick(PointOfInterest)
event indicating the point of interest (POI) that the user clicked. The PointOfInterest
contains the latitude/longitude coordinates, place ID and name of the point of interest.
You can hide points of interest (POIs) by applying custom styles to all POIs or to specific categories of POIs.
The following JSON style declaration hides all business POIs on the map:
[
{
"featureType": "poi.business",
"stylers": [
{ "visibility": "off" }
]
}
]
As another example, the following JSON simplifies the display of all categories of POIs:
[
{
"featureType": "poi",
"stylers": [
{ "visibility": "simplified" }
]
}
]
For Java code and other details, see the guide to hiding map features with styling.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["Points of Interest (POIs) such as parks, schools, and businesses, are displayed on the map by default with corresponding icons."],["Developers can listen for click events on POIs and respond to user interactions using the `OnPoiClickListener`."],["Although POIs are displayed by default, there is no default on-click UI, meaning developers need to implement their own info windows or other UI elements."],["The display of POIs can be customized or hidden altogether using JSON style declarations to control their visibility and appearance."]]],["Points of interest (POIs), including parks, schools, and businesses, appear by default on maps. To handle user taps on POIs, use `OnPoiClickListener` and set it via `GoogleMap.setOnPoiClickListener`. This triggers an `OnPoiClick` event, providing the POI's name, place ID, and coordinates. You can also hide POIs using custom JSON styling by setting the `visibility` to `off` for business POIs for instance or `simplified` for all POIs.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4