Skip to main content

MapModule

Class

Allows access to map texture data around a specified location.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v202

Index

Extends

Properties

name

name: string

The name of the Asset in Lens Studio.

Default Value

""

Inherited from

Asset.name


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Asset.uniqueIdentifier

Methods

createMapTextureProvider()

createMapTextureProvider(): Texture

Creates a new texture which holds a MapTextureProvider.

Returns

Texture

Since

Lens Scripting Version 228


getTypeName()

static getTypeName(): TypeName<MapModule>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<MapModule>

Since

Lens Scripting Version 202

Overrides

Asset.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Asset.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Asset.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Asset.isSame


longLatToImageRatio()

longLatToImageRatio(longitude, latitude, location): vec2

Returns the position of the marker (relative to the associated map tile) based on the specified longitude, latitude and location. The top left corner of the provided location has a value of [0,0] and the right down corner has a value of [1.1].

Parameters

ParameterType
longitudenumber
latitudenumber
locationLocationAsset

Returns

vec2

Since

Lens Scripting Version 228

See also

Map Component guide.