Bookmarks class
Provides access to the bookmarks functionality of GeoApps. Can be accessed through the Map.Bookmarks
-property.
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
Property | Modifiers | Type | Description |
---|---|---|---|
onActivated | readonly | GAEvent<BookmarkActivatedEventArgs> | Triggers when a bookmark is activated |
onLoaded | readonly | GAEvent<GAEventArgs> | Triggers when all the bookmarks are loaded from server |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
ContainsBookmarks | readonly | boolean | Verify if a bookmark exists |
MapBookmarks | readonly | Bookmark[] | Retrieve all the bookmarks configured on the map |
ThememapBookmarks | readonly | Bookmark[] | Retrieve all the bookmarks configured on the thememap |
Methods
Method | Modifiers | Description |
---|---|---|
ActivateBookmark(bookmarkId) | Activate the specified bookmark | |
GetBookmark(bookmarkId) | Retrieve a bookmark by its id | |
on(event, eventHandler) | Bind to an event (legacy purposes) |