GlobeMapProjection

@_spi(Experimental)
public struct GlobeMapProjection : Codable, Hashable

Globe projection is a custom map projection mode for rendering the map wrapped around a full 3D globe. Conceptually it is the undistorted and unskewed “ground truth” view of the map that preserves true proportions between different areas of the map.

Some layers are not supported when map is in Globe projection:

  • custom
  • fill extrusion
  • location indicator

If Globe projection is set it will be switched automatically to Mercator projection when passing GlobeMapProjection.transitionZoomLevel during zooming in.

See GlobeMapProjection.transitionZoomLevel for more details what projection will be used depending on current zoom level.

  • Undocumented

    Declaration

    Swift

    public let name: String
  • Undocumented

    Declaration

    Swift

    public init()
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Zoom level threshold where MapboxMap will automatically switch projection from MapProjection.mercator to MapProjection.globe or vice-versa if MapboxMap.setMapProjection was configured to use MapProjection.globe.

    If MapboxMap is using MapProjection.globe and current map zoom level is >= GlobeMapProjection.transitionZoomLevel - map will use MapProjection.mercator and MapboxMap.getMapProjection will return MapProjection.mercator.

    If MapboxMap is using MapProjection.globe and current map zoom level is < GlobeMapProjection.transitionZoomLevel - map will use MapProjection.globe and MapboxMap.getMapProjection will return MapProjection.globe.

    If MapboxMap is using MapProjection.mercator - map will use MapProjection.mercator for any zoom level and MapboxMap.getMapProjection will return MapProjection.mercator.

    Declaration

    Swift

    public static let transitionZoomLevel: CGFloat