GoogleMaps3D Framework Reference

Style

struct Style

Defines the visual style and content of a Marker3D.

  • The default Marker3D style.

    Returns: A standard, pre-configured Marker3D appearance provided by the SDK,

    Declaration

    Swift

    static var `default`: Marker3D.Style { get }
  • Creates a Marker3D from a custom SwiftUI Image.

    The provided image will be rendered as the Marker3D’s content.

    Declaration

    Swift

    static func image(_ image: Image) -> Marker3D.Style

    Parameters

    image

    The SwiftUI Image to use for the Marker3D.

    Return Value

    A Marker3D.Style instance based on the image.

  • Creates a pin-style Marker3D with the specified visual configuration.

    This style renders a standard map pin shape, customized with your provided colors, scale, and an optional glyph.

    Declaration

    Swift

    static func pin(_ configuration: Pin.Configuration) -> Marker3D.Style

    Parameters

    configuration

    A Pin.Configuration object defining the pin’s appearance.

    Return Value

    A Marker3D.Style instance configured as a pin.

  • Creates a Marker3D by taking a snapshot of a custom SwiftUI View.

    This allows for highly customizable Marker3Ds using any combination of SwiftUI views. The view hierarchy is rendered into an image and used as the Marker3D’s texture.

    Example:

    .viewSnapshot {
    VStack {
    Image(systemName: "star.fill")
    .foregroundStyle(.yellow)
    Text("Favorite")
    .font(.caption)
    }
    .padding(8)
    .background(.blue, in: .capsule)
    }
    

    Declaration

    Swift

    static func viewSnapshot<V>(@ViewBuilder _ content: () -> V) -> Marker3D.Style where V : View

    Parameters

    content

    A ViewBuilder closure that returns the view to be rendered into a snapshot as the Marker3D.

    Return Value

    A Marker3D.Style instance based on a snapshot of the view.