GoogleMaps3D Framework Reference

Marker

struct Marker
extension Marker : Copyable, Equatable, Escapable, Hashable, Identifiable, MapContent

A 3D marker that can be placed on a map.

Map(mode: .hybrid) {
  Marker(position: .init(latitude: 37.7749, longitude: -122.4194, altitude: 0))
}
  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    static func == (a: Marker, b: Marker) -> Bool
  • ID

    A type representing the stable identity of the entity associated with an instance.

    Declaration

    Swift

    @available(watchOS, introduced: 6.0)
    @available(macOS, introduced: 10.15)
    @available(iOS, introduced: 13.0)
    @available(tvOS, introduced: 13.0)
    typealias ID = String
  • Declaration

    Swift

    func add(coordinator: RenderingCoordinator)
  • Specifies how altitude in the position is interpreted.

    Default value: clampToGround

    Declaration

    Swift

    var altitudeMode: AltitudeMode
  • Specifies how a Marker should behave when it collides with another Marker or with the default map labels.

    Default value: required

    Declaration

    Swift

    var collisionBehavior: CollisionBehavior
  • Specifies whether this marker should be drawn or not when it’s occluded. The marker can be occluded by map geometry (e.g. buildings).

    Default value: clampToGround

    Declaration

    Swift

    var drawsWhenOccluded: Bool
  • Specifies whether to connect the marker to the ground. To extrude a marker, the altitudeMode must be either relativeToGround, relativeToMesh or absolute.

    Default value: false

    Declaration

    Swift

    var extruded: Bool
  • Hashes the essential components of this value by feeding them into the given hasher.

    Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

    Important

    In your implementation of hash(into:), don’t call finalize() on the hasher instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.

    Declaration

    Swift

    func hash(into hasher: inout Hasher)
  • The hash value.

    Hash values are not guaranteed to be equal across different executions of your program. Do not save hash values to use during a future execution.

    Important

    hashValue is deprecated as a Hashable requirement. To conform to Hashable, implement the hash(into:) requirement instead. The compiler provides an implementation for hashValue for you.

    Declaration

    Swift

    var hashValue: Int { get }
  • id

    Unique identifier

    Declaration

    Swift

    let id: String
  • Declaration

    Swift

    init(position: LatLngAltitude, altitudeMode: AltitudeMode = .clampToGround, collisionBehavior: CollisionBehavior = .required, extruded: Bool = false, drawsWhenOccluded: Bool = false, sizePreserved: Bool = false, zIndex: Int32 = 0, label: String = "")
  • Text to be displayed by this marker.

    Defaults to empty string.

    Declaration

    Swift

    var label: String
  • Sets the position.

    Declaration

    Swift

    var position: LatLngAltitude
  • Declaration

    Swift

    func remove(coordinator: RenderingCoordinator)
  • Specifies whether this marker should preserve its size or not regardless of distance from camera. By default the marker is scaled based on distance from camera/tilt.

    Default value: false

    Declaration

    Swift

    var sizePreserved: Bool
  • Declaration

    Swift

    func update(coordinator: RenderingCoordinator)
  • The zIndex compared to other 3D markers. By default, Markers are displayed according to their vertical position on screen, with lower Markersappearing in front ofMarkerfarther up the screen. Note thatzIndexis also used to help determine relative priority between CollisionBehavior.optionalAndHidesLowerPriority3D markers. A higher zIndex` value indicates higher priority.

    Default value: clampToGround

    Declaration

    Swift

    var zIndex: Int32