# PlaceMarker

    @MainActor
    struct PlaceMarker

    extension PlaceMarker : Sendable, SendableMetatype, View

A SwiftUI View displaying a place marker (with an optional icon and text such as
rating, price range, open status, or custom text).

Fetches place details asynchronously using the provided `https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceIdentifier.html` and renders the
corresponding speech-bubble or custom marker when required attribute data is available.
- `


  ### [Body](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV4Bodya)


  ` The type of view representing the body of this view.

  When you create a custom view, Swift infers this type from your
  implementation of the required `View/body-swift.property` property.

  #### Declaration

  Swift

      typealias Body = some View

- `


  ### [body](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV4bodyQrvp)


  ` The content and behavior of the view.

  When you implement a custom view, you must implement a computed
  `body` property to provide the content for your view. Return a view
  that's composed of built-in views that SwiftUI provides, plus other
  composite views that you've already defined:

      struct MyView: View {
          var body: some View {
              Text("Hello, World!")
          }
      }

  For more information about composing views and a view hierarchy,
  see <doc:Declaring-a-Custom-View>.

  #### Declaration

  Swift

      @MainActor
      @preconcurrency
      var body: some View { get }

- `


  ### [configuration](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV13configurationAA0dE13ConfigurationVvp)


  ` Visual styling options for customizing the marker.

  #### Declaration

  Swift

      @MainActor
      var configuration: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarkerConfiguration.html

- `


  ### [identifier](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV10identifierAA0D10IdentifierOvp)


  ` The identifier specifying the place to fetch and display.

  #### Declaration

  Swift

      @MainActor
      let identifier: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceIdentifier.html

- `


  ### [init(identifier:markerIcon:markerText:configuration:)](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV10identifier10markerIcon0G4Text13configurationAcA0D10IdentifierO_AA0eH0OAA0eI0OSgAA0dE13ConfigurationVtcfc)


  `

  #### Declaration

  Swift

      @MainActor
      init(identifier: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlaceIdentifier.html, markerIcon: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/MarkerIcon.html = .none, markerText: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/MarkerText.html? = nil, configuration: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarkerConfiguration.html = https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarkerConfiguration.html())

- `


  ### [markerIcon](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV10markerIconAA0eG0Ovp)


  ` The marker icon variant displayed by the marker.

  #### Declaration

  Swift

      @MainActor
      let markerIcon: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/MarkerIcon.html

- `


  ### [markerText](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV10markerTextAA0eG0OSgvp)


  ` The optional text displayed inside the marker.

  #### Declaration

  Swift

      @MainActor
      let markerText: https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/MarkerText.html?

- `


  ### [onLoad(_:)](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV6onLoadyACys6ResultOyAA0D0VAA0B5ErrorOGcF)


  ` Adds a callback to be called when the place details are loaded.

  #### Declaration

  Swift

      @MainActor
      func onLoad(_ callback: @escaping (Result<https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/Place.html, https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Enums/PlacesError.html>) -> Void) -> PlaceMarker

  #### Parameters

  |---|---|
  | ` callback ` | The callback to be called when the place results are loaded. |

  #### Return Value

  The `PlaceMarker` with the callback added.
- `


  ### [onTap(_:)](https://developers.google.com/maps/documentation/places/ios-sdk/reference/swift/Structs/PlaceMarker#/s:17GooglePlacesSwift11PlaceMarkerV5onTapyACySScF)


  ` Adds an action to perform when the marker is tapped by the user.

  #### Declaration

  Swift

      @MainActor
      func onTap(_ action: @escaping (String) -> Void) -> PlaceMarker

  #### Parameters

  |---|---|
  | ` action ` | The closure to execute on tap, receiving the place ID string. |

  #### Return Value

  A modified `PlaceMarker` with the tap action attached.