GoogleMaps3D Framework Reference

Configuration

struct Configuration

A configuration that defines the visual properties of a Pin. This type can be used with the Marker or Marker3D types to customize the appearance of a pin-style marker.

Example usage:

// Create a pin with a red background, black border, and default inner circle glyph.
let redPin = Pin.Configuration(backgroundColor: .red, borderColor: .black)

// Create a pin with a green background and a custom image glyph.
let glyphPin = Pin.Configuration(backgroundColor: .green) {
    Image(systemName: "leaf.fill")
        .resizable()
        .scaledToFit()
        .padding(2)
        .foregroundStyle(.white)
}

// Use with Marker3D style:
Marker3D(latitude: 0, longitude: 0, style: .pin(redPin))
Marker3D(latitude: 0, longitude: 0, style: .pin(glyphPin))
Marker3D(latitude: 0, longitude: 0, style: .pin(.red))

// Use with Marker style:
Marker(position: .init(latitude: 0, longitude: 0)) {
    Pin(configuration: redPin)
})
Marker(position: .init(latitude: 0, longitude: 0)) {
    Pin(configuration: glyphPin)
})
Marker(position: .init(latitude: 0, longitude: 0)) {
    Pin(configuration: .red)
})
  • Declaration

    Swift

    let backgroundColor: Color
  • Declaration

    Swift

    let borderColor: Color
  • Creates a new Pin configuration.

    Use this configuration to customize the appearance of a Marker3D created with the .pin style.

    Custom Glyph can be created by passing a custom view

    Pin.Configuration {
        Text("String")
        .minimumScaleFactor(0.01)
    }
    Pin.Configuration {
        Image(systemName: "plus")
            .resizable()
            .scaledToFit()
    }
    
    • backgroundColor: The background Color of the pin.
    • borderColor: The border Color of the pin. Defaults to .black.
    • scale: The scale factor to apply to the pin. Defaults to 1.0.
    • glyph: A ViewBuilder closure providing the Marker3D glyph’s view for a snapshot. The view is constrained to a 15x15 pixel container.

    Declaration

    Swift

    init<GlyphView>(backgroundColor: Color = Color(red: 0.917, green: 0.262, blue: 0.207), borderColor: Color = Color(red: 0.772, green: 0.133, blue: 0.121), scale: Float = 1.0, @ViewBuilder glyph: () -> GlyphView) where GlyphView : View

    Parameters

    backgroundColor

    The background Color of the pin.

    borderColor

    The border Color of the pin. Defaults to .black.

    scale

    The scale factor to apply to the pin. Defaults to 1.0.

    glyph

    A ViewBuilder closure providing the Marker3D glyph’s view for a snapshot. The view is constrained to a 15x15 pixel container.

  • Creates a new Marker3D configuration.

    Use this configuration to customize the appearance of a Marker3D created with the .pin style.

    Declaration

    Swift

    init(backgroundColor: Color = Color(red: 0.917, green: 0.262, blue: 0.207), borderColor: Color = Color(red: 0.772, green: 0.133, blue: 0.121), scale: Float = 1.0, innerCircleColor: Color = Color(red: 0.702, green: 0.078, blue: 0.071))

    Parameters

    backgroundColor

    The background Color of the pin. Defaults to a custom dark red color

    borderColor

    The border Color of the pin. Defaults to a custom red color.

    scale

    The scale factor to apply to the pin. Defaults to 1.0.

    innerCircleColor

    Color of pin’s inner circle. Defaults to a custom dark red color.

  • red

    Google red Marker3D configuration.

    Declaration

    Swift

    static var red: Pin.Configuration { get }

    Return Value

    A Pin.Configuration instance configured as a red pin.

  • Declaration

    Swift

    let scale: Float