![Photo showing a small popover with place details in the bottom of the screen resulting from a tap.](https://developers.google.com/static/maps/documentation/maps-3d/images/maps_3d_places_demo.png)

When a user taps a point of interest (POI) on a
[`Map`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Map.md.txt), the
Maps 3D SDK for iOS (`GoogleMaps3DKit`) displays a
[Places widget](https://developers.google.com/maps/documentation/places/ios-sdk/places-ui-kit-overview.md.txt) for
that POI. You can listen for tap events and control whether this widget is
displayed using
[`onTap(_:)`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Extensions/View.md.txt#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE5onTapyQryAD0fI4InfoVcF),
`onPlaceTap(_:)`, and `placeInformationEnabled(_:)`.

> [!NOTE]
> **Note:** By default, the Places UI widget shows when a point of interest is tapped in `GoogleMaps3DKit`. Use `placeInformationEnabled(false)` or `onPlaceTap(_:)` to suppress the widget in your app.

## Listen for tap events

To listen for tap events on a
[`Map`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Map.md.txt), apply
the
[`onTap(_:)`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Extensions/View.md.txt#/s:7SwiftUI4ViewP12GoogleMaps3DAD13MapAnimatableRzrlE5onTapyQryAD0fI4InfoVcF)
modifier.

When a user taps the map, the closure receives a
[`MapTapInfo`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo.md.txt)
object containing the following properties:

- [`location`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo.md.txt#/s:12GoogleMaps3D10MapTapInfoV8locationAA14LatLngAltitudeVvp): The [`LatLngAltitude`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/LatLngAltitude.md.txt) representing the geographic coordinates and altitude of the tap.
- [`content`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo.md.txt#/s:12GoogleMaps3D10MapTapInfoV7contentAC7ContentOvp): The [`MapTapInfo.Content`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo/Content.md.txt) value indicating what was tapped:
  - [`MapTapInfo.Content.map`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo/Content.md.txt#/s:12GoogleMaps3D10MapTapInfoV7ContentO3mapyA2EmF): The tap hit the base map.
  - [`MapTapInfo.Content.place(id:)`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/MapTapInfo/Content.md.txt#/s:12GoogleMaps3D10MapTapInfoV7ContentO5placeyAESS_tcAEmF): The tap hit a place, providing its unique place ID (`String`).

## Control the Places UI widget

To control whether the built-in Places UI widget is displayed when a place is
tapped, apply `onPlaceTap(_:)` to
[`Map`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Map.md.txt). The
closure receives the tapped `placeId` (`String`) and returns a `PlaceTapAction`:

- **Return `.default`**: Shows the built-in Places UI widget.
- **Return `.none`**: Suppresses the built-in Places UI widget.

The following example listens for tap events and suppresses the default Places
UI widget:

```swift
import GoogleMaps3DKit
import SwiftUI

struct ContentView: View {
  @State private var camera = Camera(center: .init(latitude: 37.7749, longitude: -122.4194))

  var body: some View {
    Map(camera: $camera, mode: .hybrid)
      .onPlaceTap { placeId in
        // Suppress the built-in Places UI widget
        .none
      }
      .onTap { tapInfo in
        switch tapInfo.content {
        case .map:
          print("Tapped map at \(tapInfo.location)")
        case .place(let placeId):
          print("Tapped place \(placeId) at \(tapInfo.location)")
        }
      }
  }
}
```

To disable the built-in place information card for all POI taps on a
[`Map`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Map.md.txt), pass
`false` to `placeInformationEnabled(_:)`:

```swift
import GoogleMaps3DKit
import SwiftUI

struct ContentView: View {
  var body: some View {
    Map(mode: .hybrid)
      .placeInformationEnabled(false)
  }
}
```