import Bookmark from "@arcgis/core/webmap/Bookmark.js";const Bookmark = await $arcgis.import("@arcgis/core/webmap/Bookmark.js");- Inheritance:
- Bookmark→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.8
A bookmark is a saved map extent that allows end users to quickly navigate to a particular area of interest using the Bookmarks widget. They are usually defined part of the WebMap.bookmarks.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
| | ||
TimeExtent | null | undefined | | |
uid readonly inherited | ||
| |
timeExtent
- Type
- TimeExtent | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.22
The time extent of the bookmark item.
Example
// create a bookmark with a time extent starting December 10, 1996// and ending December 25, 1996const bookmark = new Bookmark({ timeExtent: { start: new Date(1996, 11, 10), end: new Date(1996, 11, 25) }}) uid
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 4.33
An automatically generated unique identifier assigned to the instance. The unique id is generated each time the application is loaded.
viewpoint
- Type
- Viewpoint
- Since
- ArcGIS Maps SDK for JavaScript 4.17
The viewpoint of the bookmark item. Defines the rotation, scale, and target geometry of the bookmark.
Bookmarks can only be saved to the WebMap when their viewpoint.targetGeometry is an Extent.
When defined manually on the Bookmarks widget, the targetGeometry can be a Point, but scale must also be defined.
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.