Home > @magiclane/maps-sdk > LandmarkStore

LandmarkStore class

Provides access to a landmark store and its operations.

This class should not be instantiated directly. Instead, use the related methods from LandmarkStoreService to obtain an instance.

It represents a single persistence store instance and is the primary entry point for reading, adding, updating and removing landmark data and categories, plus creating scoped browse sessions for iterative access.

Typical tasks include enumerating and filtering landmarks (by category or geographic area), creating and modifying categories, importing external landmark datasets. Main members expose store identity and metadata, collections of category and landmark objects.

Can be presented on the map using the LandmarkStoreCollection associated with a GemMapController, in for custom search operations and for alerts.

Places

Signature:

export declare class LandmarkStore 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 LandmarkStore class.

Properties

Property

Modifiers

Type

Description

categories

readonly

LandmarkCategory[]

Get the list of all categories.

id

readonly

number

Get the ID of the landmark store.

image

readonly

Img

Get the landmark store image.

invalidLandmarkCategId

static

readonly

(not declared)

mapId

readonly

number

name

readonly

string

Get the landmark store name.

pointerId

readonly

number | bigint

type

readonly

LandmarkStoreType

Get the type of the landmark store.

uncategorizedLandmarkCategId

static

readonly

(not declared)

Methods

Method

Modifiers

Description

addCategory(category)

Add a new category to the store.

After this method call, the category object that is passed as a parameter belongs to this landmark store. The category must have a name.

addLandmark(landmark, categoryId)

Add a landmark to the specified category in the landmark store.

If the landmark already exists in the landmark store, only the category info is updated.

cancelImportLandmarks()

Cancel async import landmarks operation

containsLandmark(landmarkId)

Checks if the landmark store contains the landmark ID

createLandmarkBrowseSession(settings)

Create a landmarks browse session with the specified settings

Shows only the landmarks added before the LandmarkBrowseSession was created

dispose()

Cleans up any resources.

getCategoriesFromLandmark(landmarkId)

Get the list of categories for the specified landmark.

getCategoryById(categoryId)

Get the category by ID.

getFilePath()

Get landmark store path.

getLandmark(landmarkId)

Get the specified landmark.

getLandmarkCount(categoryId)

Get the number of all landmarks within the specified category.

If the category ID is uncategorizedLandmarkCategId, the uncategorized landmarks count is returned. If the category ID is invalidLandmarkCategId, the total landmarks count is returned.

getLandmarks(categoryId)

Get the landmarks within the specified category.

getLandmarksInArea({ area, categoryId, }, input)

Get the landmarks within the specified area.

importLandmarks({ filePath, format, image, onComplete, onProgressUpdated, categoryId, }, input)

Asynchronously import landmarks from given file format

importLandmarksWithDataBuffer({ buffer, format, image, onComplete, onProgressUpdated, categoryId, }, input)

Asynchronously import landmarks from given buffer format

isFastUpdateMode()

Get fast update mode state.

removeAllLandmarks()

Remove all landmarks from store.

removeCategory(categoryId, removeLmkContent)

Remove the specified category.

removeLandmark(landmark)

Remove the specified landmark.

setImage(image)

Set the landmark store image.

Setting a valid landmark store image will override individual items images, see Landmark.getImage Setting an empty landmark store image will restore individual items images, see Landmark.getImage

setLandmarkCategory(landmark, categoryId)

Set landmark category id

startFastUpdateMode()

Start landmark store fast update mode

Fast update mode - allow fast insert, delete and update operations. This mode should be used with caution because if a power failure or process crash interrupts it, the database will likely be corrupted and will be deleted at next startup.

This is intended for fast import of external landmarks into application format

stopFastUpdateMode(discard)

Stop landmark store fast update mode.

updateCategory(category)

Update the specified category.

The category object must belong to this landmark store. No fields of the parameter will be updated by this call.

updateLandmark(landmark)

Update the information about a landmark.

This updates only the information about a landmark and does not modify the categories the landmark belongs to. The landmark instance passed in as the parameter must be an instance that belongs to this landmark store. Calling this method updates the timestamp of the landmark.