LocationMarkerOptions

data class LocationMarkerOptions(val type: LocationMarkerOptions.Type, @FloatRange(from = 0.0, fromInclusive = false) val markerMagnification: Double = DEFAULT_MAGNIFICATION, val animationDuration: Duration? = null, val customModel: Uri? = null)

Configures options for the location marker which visualizes the users location on the map.

See also: TomTomMap.enableLocationMarker(options: LocationMarkerOptions)

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 will 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 its 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 is 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.

Constructors

Link copied to clipboard
constructor(type: LocationMarkerOptions.Type, @FloatRange(from = 0.0, fromInclusive = false) markerMagnification: Double = DEFAULT_MAGNIFICATION, animationDuration: Duration? = null, customModel: Uri? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
value class Type

Types of the location marker visualization.

Properties

Link copied to clipboard

The animation duration between location updates. If this is null, duration will be calculated at runtime.

Link copied to clipboard
val customModel: Uri? = null

The model url to use for a custom marker. The only supported format is glTF 2.0. The supported model file extension is the binary-based format (.glb), while the text-based format (.gltf) is not supported.

Link copied to clipboard

The magnification level to apply to the marker model.

Link copied to clipboard

The type of location marker, eg: chevron, pointer, custom.