@magiclane/maps-sdk
    Preparing search index...

    Class LandmarkStore

    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.

    Hierarchy

    • GemAutoreleaseObject
      • LandmarkStore
    Index

    Constructors

    • Internal

      Parameters

      • id: number
      • mapId: number

      Returns LandmarkStore

    Properties

    invalidLandmarkCategId: -2
    uncategorizedLandmarkCategId: -1

    Accessors

    • get categories(): LandmarkCategory[]

      Get the list of all categories.

      Returns LandmarkCategory[]

      The list of categories

      An exception if it fails.

    • get id(): number

      Get the ID of the landmark store.

      Returns number

      The landmark store ID

      An exception if it fails.

    • get image(): Img

      Get the landmark store image.

      Returns Img

      The image of the landmark. The user is responsible to check if the image is valid.

      An exception if it fails.

    • get mapId(): number

      Returns number

    • get name(): string

      Get the landmark store name.

      Returns string

      The landmark store name

      An exception if it fails.

    • get pointerId(): number

      Returns number

    • get type(): LandmarkStoreType

      Get the type of the landmark store.

      Returns LandmarkStoreType

      The landmark store type

      An exception if it fails.

    Methods

    • 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.

      Parameters

      Returns void

      An exception if it fails.

    • 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.

      Parameters

      • landmark: Landmark

        The landmark to be added to the landmark store in the specified category.

      • categoryId: number = LandmarkStore.uncategorizedLandmarkCategId

        The ID of the category where the landmark will be added.

      Returns void

      An exception if it fails.

    • Cancel async import landmarks operation

      Returns void

      An exception if it fails.

    • Checks if the landmark store contains the landmark ID

      Parameters

      • landmarkId: number

        The id of the landmark looked for

      Returns boolean

      True if the landmark is in the landmark store, false otherwise.

      An exception if it fails.

    • Create a landmarks browse session with the specified settings

      Shows only the landmarks added before the LandmarkBrowseSession was created

      Parameters

      Returns LandmarkBrowseSession

      The landmarks browse session

      An exception if it fails.

    • Returns Promise<void>

    • Get the list of categories for the specified landmark.

      Parameters

      • landmarkId: number

        The id of the landmark.

      Returns LandmarkCategory[]

      The list of categories

      An exception if it fails.

    • Get the category by ID.

      Parameters

      • categoryId: number

        The category ID

      Returns LandmarkCategory | null

      The category if found, null otherwise

      An exception if it fails.

    • Get landmark store path.

      Returns string

      The landmark store path.

      An exception if it fails.

    • Get the specified landmark.

      Parameters

      • landmarkId: number

        The landmark id.

      Returns Landmark | null

      The Landmark object if found, null otherwise.

      An exception if it fails.

    • 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.

      Parameters

      • categoryId: number = LandmarkStore.invalidLandmarkCategId

        The category ID

      Returns number

      The number of landmarks

      An exception if it fails.

    • Get the landmarks within the specified category.

      Parameters

      • categoryId: number = LandmarkStore.invalidLandmarkCategId

        The category id for which landmarks are retrieved (default LandmarkCategory.invalidLandmarkCategId, meaning all categories). If the category ID is LandmarkCategory.uncategorizedLandmarkCategId, all uncategorized landmarks are retrieved. If the category ID is LandmarkCategory.invalidLandmarkCategId, all landmarks are retrieved.

      Returns Landmark[]

      The landmark list.

      An exception if it fails.

    • Get the landmarks within the specified area.

      Parameters

      • options: { area?: GeographicArea; categoryId?: number } = {}

        Object containing filter parameters

        • Optionalarea?: GeographicArea

          The geographic area queried for landmarks.

        • OptionalcategoryId?: number

          The category id for which landmarks are retrieved (default LandmarkCategory.invalidLandmarkCategId, meaning all categories). If the category ID is uncategorizedLandmarkCategId, all uncategorized landmarks are retrieved. If the category ID is invalidLandmarkCategId, all landmarks are retrieved.

      Returns Landmark[]

      The landmark list corresponding to given criteria.

      An exception if it fails.

    • Asynchronously import landmarks from given file format

      Parameters

      • options: {
            categoryId?: number;
            filePath: string;
            format: LandmarkFileFormat;
            image: Img;
            onComplete?: (error: GemError) => void;
            onProgressUpdated?: (progress: number) => void;
        }

        Object containing import parameters

        • OptionalcategoryId?: number

          The category for the new imported landmarks. The category must exist or use uncategorizedLandmarkCategId to set the landmark as uncategorized

        • filePath: string

          The file path

        • format: LandmarkFileFormat

          The file format, see LandmarkFileFormat.

        • image: Img

          The landmark map image. If left empty, a default image is assigned

        • OptionalonComplete?: (error: GemError) => void

          Callback that gets triggered with the associated GemError when the update process is completed.

          • Is called with GemError.success if the operation suceeded
          • Is called with GemError.inUse if an import is already in progress
          • Is called with GemError.notFound if the file could not be opened or it the landmark store category id is invalid
          • Is called with GemError.cancel if the operation was canceled
          • Is called with GemError.invalidInput if the provided data could not be parsed
        • OptionalonProgressUpdated?: (progress: number) => void

          Callback that gets triggered with the associated progress when the update process is in progress.

      Returns ProgressListener | null

      The associated ProgressListener if the request can be started, null otherwise.

      An exception if it fails.

    • Asynchronously import landmarks from given buffer format

      Parameters

      • options: {
            buffer: Uint8Array;
            categoryId?: number;
            format: LandmarkFileFormat;
            image: Img;
            onComplete?: (error: GemError) => void;
            onProgressUpdated?: (progress: number) => void;
        }

        Object containing import parameters

        • buffer: Uint8Array

          The data buffer.

        • OptionalcategoryId?: number

          The category for the new imported landmarks. The category must exist or use uncategorizedLandmarkCategId to set the landmark as uncategorized

        • format: LandmarkFileFormat

          The file format, see LandmarkFileFormat.

        • image: Img

          The landmark map image. If left empty, a default image is assigned

        • OptionalonComplete?: (error: GemError) => void

          Callback that gets triggered with the associated GemError when the update process is completed.

          • Is called with GemError.success if the operation suceeded
          • Is called with GemError.inUse if an import is already in progress
          • Is called with GemError.notFound if the landmark store category id is invalid
          • Is called with GemError.cancel if the operation was canceled
          • Is called with GemError.invalidInput if the provided data could not be parsed
        • OptionalonProgressUpdated?: (progress: number) => void

          Callback that gets triggered with the associated progress when the update process is in progress.

      Returns ProgressListener | null

      The associated ProgressListener if the request can be started, null otherwise.

      An exception if it fails.

    • Get fast update mode state.

      Returns boolean

      True if fast update mode is active, false otherwise.

      An exception if it fails.

    • Registers an object for auto release. When the object is not used anymore, it will be released automatically from C++.

      Parameters

      • pointerId: any

        The pointer ID to register

      Returns void

    • Remove all landmarks from store.

      Returns void

      An exception if it fails.

    • Remove the specified category.

      Parameters

      • categoryId: number

        The category ID.

      • removeLmkContent: boolean = false

        Request to remove all landmarks belonging to the category. If removeLmkContent is false, the landmarks belonging to the category are marked uncategorized.

      Returns void

      An exception if it fails.

    • Remove the specified landmark.

      Parameters

      • landmark: Landmark

        The landmark to be removed

      Returns void

      An exception if it fails.

    • 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

      Parameters

      • image: Img

        The landmark store image.

      Returns GemError

      GemError.success on success

      An exception if it fails.

    • Set landmark category id

      Parameters

      • landmark: Landmark

        The landmark object

      • categoryId: number

        The category ID

      Returns void

      An exception if it fails.

    • 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

      Returns void

      An exception if it fails.

    • Stop landmark store fast update mode.

      Parameters

      • discard: boolean = false

        Discard fast update mode session changes. Default is false.

      Returns void

      An exception if it fails.

    • Update the specified category.

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

      Parameters

      Returns void

      An exception if it fails.

    • 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.

      Parameters

      • landmark: Landmark

        The landmark to be updated.

      Returns void

      An exception if it fails.