LocationIndicator

public enum LocationIndicator : Equatable

Types of the location marker visualization.

  • The location marker is rendered in a chevron pattern that can be added to the marker’s scale.

    Declaration

    Swift

    case navigationChevron(scale: Float)

    Parameters

    scale

    Multiplication factor for scaling the size of the marker. The marker’s width and height are multiplied by the given value. The default scale value is 1.0.

  • The location marker is rendered as a position marker, with the heading to be added to the marker’s scale.

    Declaration

    Swift

    case userLocation(scale: Float)

    Parameters

    scale

    Multiplication factor for scaling the size of the marker. The marker’s width and height are multiplied by the given value. The default scale value is 1.0.

  • Gives the ability to add a custom .glb model as a location indicator. The only model file extension that is supported is GLTFv2 binary-based format (.glb).

    The custom model is rendered behind the scenes using the following json scheme: “position-marker-render”: { “materials”: { “normal” (When GPS is fixed this will be applied): { “Base” (Annotates the layer named “Base”): { “ambient”: 0.4, “color”: “@position-marker-normal-base-color” }, “Outline” (Annotates the model layer named “Outline”): { “ambient”: 1.0, “color”: “@position-marker-normal-outline-color” }, “Shadow” (Annotates the layer named “Shadow”): { “ambient”: 0.4, “color”: “@position-marker-normal-shadow-color” } }, “nofix” (When GPS is not fixed this will be applied): { “Base”: { “ambient”: 0.4, “color”: “@position-marker-nofix-base-color” }, “Outline”: { “ambient”: 1.0, “color”: “@position-marker-nofix-outline-color” }, “Shadow”: { “ambient”: 0.4, “color”: “@position-marker-nofix-shadow-color” } } } }

    Providing a custom model in the correct format is not the only requirement to render it on the map, these are the supported features and core requirements for the .glb model format:

    • Models should be provided in a GLTFv2-compliant file. While the GLTFv2 container-format allows for many interesting features, only a small subset of those are actually used and supported:
      • Only frame 0 of scene #0 is loaded.
      • All nodes from scene #0 are loaded.
      • For every node only the following information is loaded:
      • node name
      • hierarchy structure
      • local/global transform matrices
      • All meshes for scene #0 are loaded.
      • One can select which meshes to be exported, but once they are in the file all nodes/meshes are loaded.
      • For every mesh the following streams are loaded:
      • Positions
      • colors
      • normals
      • texture coordinates
      • All pbr metallic-roughness materials are loaded.
      • For every material the following data is loaded:
      • name
      • base color
      • base color texture
      • base color factor
    • Skinning, animations, morphing, custom cameras and custom lights are not supported.
    • Any “extra” fields as defined by the GLTF standard are ignored.
    • Transparency is not explicitly supported. While having semi-transparent polygons is not forbidden, there’s no depth-sorting nor multistage rendering to account for transparency-related order problems. Therefore, having a simple shadow-like polygon underneath the model will work, but anything else will, most probably, result in polygons randomly becoming opaque at runtime, depending on draw order.
    • The node called “Shadow” is repositioned from it’s position to “lay on ground” and offset according to light direction.
    • Colors, normals, and TEXCOORDs are fully supported.
    • Material support is very limited, Only diffuse, ambient color and textures are supported.
    • Decoloring of materials are supported, when GPS is either fixed or not fixed, grayscale is applied for some materials.

    The project path that the custom model should be provided to is as follows: asset://file.glb. Markers size will be changed depending on current zoom level and scale parameter.

    Declaration

    Swift

    case custom(modelPath: String, scale: Float)

    Parameters

    modelPath

    Path for a custom .glb model as a location indicator.

    scale

    Multiplication factor for scaling the size of the marker. The marker’s width and height are multiplied by the given value. The default scale value is 1.0.

  • No location marker will be rendered on the map.

    Declaration

    Swift

    case none
  • The location marker is rendered in a chevron pattern.

    Declaration

    Swift

    public static let navigationChevron: LocationIndicator
  • The location marker is rendered as a position marker with the heading.

    Declaration

    Swift

    public static let userLocation: LocationIndicator