Home > @magiclane/maps-sdk > RouteBookmarks
RouteBookmarks class
Manages a persistent collection of saved routes (bookmarks).
Provides operations to create, add, import, update, remove and export saved routes. Use RouteBookmarks.create to open or create a named bookmarks collection backed by a file.
Signature:
export declare class RouteBookmarks extends GemAutoreleaseObject Extends: GemAutoreleaseObject
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number | bigint | ||
|
boolean |
Whether the underlying bookmarks database is automatically deleted when this object is destroyed. When true, the database file is removed when the RouteBookmarks instance is disposed. Default value is false. | ||
|
|
string |
File path of the bookmarks collection used by this RouteBookmarks instance. This is the platform-specific file path where the bookmarks database is stored. | |
|
|
number | bigint |
Gets the pointer ID for this RouteBookmarks instance. | |
|
|
number |
Number of bookmarked routes in this collection. | |
|
Change the sort order used to present routes from this collection. The default sort order is RouteBookmarksSortOrder.sortByDate. The UI should refresh any views after changing the sort order to reflect the updated ordering. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Adds a new route or updates an existing one in this bookmarks collection. Stores a route identified by name together with its waypoints and optional preferences. When a route with the same name already exists the operation will fail unless overwrite is set to true, in which case the existing route is replaced. Only route-relevant preference fields are persisted. | ||
|
Import routes from a file and add them to this bookmarks collection. The method attempts to parse and import trips from the given filename. On success it returns the number of imported routes. If the import fails the method returns an error code. | ||
|
Remove all routes from this bookmarks collection. After calling this method the collection will be empty. | ||
|
|
Open or create a bookmarks collection with the provided name. The factory creates or opens the underlying bookmarks database for the given name and returns a RouteBookmarks instance that operates on that collection. | |
|
|
Open or create a bookmarks collection with the provided name and folder path. The factory creates or opens the underlying bookmarks database for the given name and folderPath and returns a RouteBookmarks instance that operates on that collection. | |
|
Export a bookmarked route to the filesystem. Writes the route at index to the given filesystem path in a standard interchange format. The returned value communicates success or the type of failure. | ||
|
Find a bookmarked route by its name. | ||
|
Returns the name of the bookmarked route at index, or null when the index is invalid. | ||
|
Retrieves the RoutePreferences saved with the route at index. | ||
|
UTC timestamp of when the route was saved. | ||
|
Returns the list of Landmark waypoints for the route at index. | ||
|
Remove the bookmarked route at index. | ||
|
Update an existing bookmarked route. Only the fields provided will be updated; omit a parameter to leave the existing value intact. |