MGLStyle

extension MGLStyle
  • Returns the URL to the current version of the Mapbox Navigation Day style.

    Declaration

    Swift

    public class var navigationDayStyleURL: URL { get }
  • Returns the URL to the current version of the Mapbox Navigation Night style.

    Declaration

    Swift

    public class var navigationNightStyleURL: URL { get }
  • Returns the URL to the given version of the Mapbox Navigation Day style. Available versions are: 1.

    To use the Navigation Guidance Day or Navigation Preview Day style, which predates the Navigation Day style, create a mapbox: URL directly. For example:

    • Navigation Guidance Day: mapbox://styles/mapbox/navigation-guidance-day-v1 (available versions are: 1, 2, 3, and 4)
    • Navigation Preview Day: mapbox://styles/mapbox/navigation-preview-day-v1 (available versions are: 1, 2, 3, and 4)

    We only have one version of Mapbox Navigation Day style in China, so if you switch your endpoint to .cn, it will return the default day style.

    Declaration

    Swift

    public class func navigationDayStyleURL(version: Int) -> URL
  • Returns the URL to the given version of the Mapbox Navigation Night style. Available versions are: 1.

    To use the Navigation Guidance Night or Navigation Preview Night style, which predates the Navigation Night style, create a mapbox: URL directly. For example:

    • Navigation Guidance Night: mapbox://styles/mapbox/navigation-guidance-night-v2 (available versions are: 2, 3, and 4)
    • Navigation Preview Night: mapbox://styles/mapbox/navigation-preview-night-v2 (available versions are: 2, 3, and 4)

    We only have one version of Mapbox Navigation Night style in China, so if you switch your endpoint to .cn, it will return the default night style.

    Declaration

    Swift

    public class func navigationNightStyleURL(version: Int) -> URL
  • Convenience method for adding a circle at a given coordinate.

    Useful for debugging or visualizing data.

    Declaration

    Swift

    public func addDebugCircleLayer(identifier: String, coordinate: CLLocationCoordinate2D, color: UIColor = UIColor.purple)
  • Convenience method for adding a line connecting a given set of coordinates.

    Useful for debugging or visualizing data.

    Declaration

    Swift

    public func addDebugLineLayer(identifier: String, coordinates: [CLLocationCoordinate2D], color: UIColor = UIColor.purple)
  • Convenience method for adding a polygon shape.

    Useful for debugging or visualizing data.

    Declaration

    Swift

    public func addDebugPolygonLayer(identifier: String, coordinates: [CLLocationCoordinate2D], color: UIColor = UIColor.purple)
  • Method to remove any debug line style layers.

    Call to clean up when you no longer need any debug layers added with addDebugLineLayer(identifier:, coordinates:, color:)

    Declaration

    Swift

    public func removeDebugLineLayers()
  • Method to remove any debug fill style layers.

    Call to clean up when you no longer need any debug layers added with addDebugPolygonLayer(identifier:, coordinates:, color:)

    Declaration

    Swift

    public func removeDebugPolygonLayers()
  • Method to remove any debug circle style layers.

    Call to clean up when you no longer need any debug layers added with addDebugCircleLayer(identifier:, coordinate:, color:)

    Declaration

    Swift

    public func removeDebugCircleLayers()