Home > @magiclane/maps-sdk > Landmark

Landmark class

Landmark class - core class for location information

Signature:

export declare class Landmark extends GemAutoreleaseObject 

Extends: GemAutoreleaseObject

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Landmark class.

Properties

Property

Modifiers

Type

Description

address

AddressInfo

Retrieves the address information for this landmark.

Some or all address fields may be empty depending on the source of the landmark data. Changes made to an AddressInfo do not automatically propagate to the associated Landmark. To apply changes, set the modified AddressInfo back on the landmark via this property.

author

string

Retrieves the author or creator of this landmark's information.

The field may be empty when the author is not specified by the data source.

categories

readonly

LandmarkCategory[]

Returns the categories assigned to this landmark.

Categories classify the landmark into predefined types (for example Gas Station, Shopping, etc.). A landmark can belong to zero or more categories.

contactInfo

ContactInfo

Retrieves contact information for this landmark.

The returned ContactInfo may contain phone numbers, emails, URLs and textual descriptions. If you modify the returned object, assign it back to contactInfo to persist the change on the landmark.

coordinates

Coordinates

Retrieves the centroid coordinates of this landmark.

The centroid is used for distance calculations and map centering. For the landmark's full spatial extent use geographicArea.

description

string

Retrieves the description text for this landmark.

The description may be localized depending on SDK language settings and can be empty.

entrances

readonly

EntranceLocations

Retrieves the entrance locations for this landmark.

This returns an EntranceLocations object containing named entrance points and their access types (for example pedestrian or vehicle).

extraImg

Img | null

Get the extra image as an Img wrapper.

Prefer Img when you need SDK-managed metadata (uid, recommended size/aspectRatio, scalability) or to request raw image bytes; use getExtraImage when you only need raw image bytes.

extraInfo

ExtraInfo

Retrieves additional metadata associated with this landmark.

The ExtraInfo object is a flexible key/value store used by the SDK to attach auxiliary information. If you modify the returned object you must reassign it to extraInfo to persist the changes.

geographicArea

GeographicArea

Retrieves the geographic area that represents the landmark's spatial extent.

The returned GeographicArea can be a rectangle, circle, or polygon depending on the landmark data. The centroid is available via coordinates.

hasTrackData

readonly

boolean

Checks if this landmark contains waypoint track data.

id

readonly

number

Returns the landmark's unique identifier within its landmark store.

If the landmark is not associated with a store this getter returns -1.

imageUid

readonly

number

Retrieves the unique identifier for the landmark's primary image.

img

Img

Sets the landmark's primary image from an Img instance.

It is also the icon displayed on maps for this landmark.

landmarkStoreId

readonly

number

Returns the ID of the landmark store that contains this landmark.

If the landmark is not attached to any store this returns -1.

landmarkStoreType

readonly

number

Returns the type code of the landmark store this landmark belongs to.

mapId

readonly

number

name

string

Retrieves the display name of this landmark.

The name may be localized according to the SDK language settings and can be empty. It is also the label shown on maps for this landmark.

overlayItem

readonly

OverlayItem | null

Retrieves the overlay item associated with this landmark.

Returns an overlay item if the landmark originated from search results in overlays.

pointerId

readonly

number | bigint

providerId

number

Returns the provider identifier for this landmark's data source.

timeStamp

Date

Returns the timestamp when this landmark was created or last updated.

If a user-defined timestamp is not set, it typically reflects the insertion time into the landmark store. The returned value is in UTC.

trackData

Path

Retrieves the waypoint track data for this landmark.

Returns the track as a Path object.

Methods

Method

Modifiers

Description

addExtraInfo(info)

Appends an extra information entry to the landmark's metadata.

create()

static

Creates a new landmark

detachFromStore()

Detaches this landmark from its associated landmark store.

After detachment, landmarkStoreId will return -1. The landmark is no longer associated with store properties and is not removed from the store.

dispose()

findExtraInfo(startStr)

Finds the first extra info entry that begins with the specified string.

The returned string will have leading non-alphanumeric characters trimmed.

getContourGeographicArea(relevantOnly)

Retrieves the contour geographic bounding rectangle for this landmark.

Landmarks can have complex contours; this method returns a rectangle that bounds the contour. Use relevantOnly to request a reduced bounding box when available.

getExtraImage(size, format, allowResize)

Retrieves the landmark's secondary (extra) image as raw bytes.

The returned bytes may be null when no extra image exists. The caller is responsible for validating and decoding the bytes. For higher-level handling use extraImg which returns an Img wrapper.

getImage(size, format, allowResize)

Retrieves the primary (main) image for this landmark as raw bytes.

This image is typically used as the icon shown on the map. If no image exists the result is null. For higher-level access use img which returns an Img.

getJson(landmarkImageWidth, landmarkImageHeight)

reverseTrackData()

Reverses the sequence of points in the waypoint track data.

Changes the order of the track points.

setExtraImage(imageData, format)

Sets the extra image for this landmark from raw image data.

setImage(imageData, format)

Sets the primary image for this landmark from raw image data.

setImageFromIcon(icon)

Sets the primary image for this landmark from a predefined icon.

setTrackDataDepartureAndDestination(departure, destination)

Truncates the track data between specified departure and destination coordinates.

Set departure and destination to the same coordinate to create a circuit.

withCoordinates(coordinates)

static

Creates a new landmark with coordinates

withLatLng({ latitude, longitude }, input)

static

Creates a new landmark with latitude and longitude.