Skip to main content

@mapgear/geoapps > Bookmarks

Bookmarks class

Provides access to the bookmarks functionality of GeoApps. Can be accessed through the Map.Bookmarks-property.

Signature:
export declare class Bookmarks 

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 Bookmarks class.

Example

An example of the usage:

// Connect as anonymous user to a geoapps environment
geoapps.Initialize("<specified tenant>");

// Add the map to a div with element id `map`
var map = geoapps.AddMap("map", "<mapId>");

// Wait till the map loaded, before starting the bookmarks
map.onLoaded.add(() => {
// Bookmarks
map.Bookmarks.onLoaded.add(function () {
console.log(map.Bookmarks.MapBookmarks);
});

// Get bookmark by id
console.log(map.Bookmarks.GetBookmark(<bookmarkId>));

// Activate bookmark by id
map.Bookmarks.ActivateBookmark(<bookmarkId>);
});

Events

PropertyModifiersTypeDescription
onActivatedreadonlyGAEvent<BookmarkActivatedEventArgs>Triggers when a bookmark is activated
onLoadedreadonlyGAEvent<GAEventArgs>Triggers when all the bookmarks are loaded from server

Properties

PropertyModifiersTypeDescription
ContainsBookmarksreadonlybooleanVerify if a bookmark exists
MapBookmarksreadonlyBookmark[]Retrieve all the bookmarks configured on the map
ThememapBookmarksreadonlyBookmark[]Retrieve all the bookmarks configured on the thememap

Methods

MethodModifiersDescription
ActivateBookmark(bookmarkId)Activate the specified bookmark
GetBookmark(bookmarkId)Retrieve a bookmark by its id
on(event, eventHandler)Bind to an event (legacy purposes)