Skip to content
import Bookmark from "@arcgis/core/webmap/Bookmark.js";
Inheritance:
BookmarkAccessor
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.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

name

Property
Type
string

The name of the bookmark item. Used as a label in the Bookmarks widget.

thumbnail

autocast Property
Type
SlideThumbnail | null | undefined

The URL for a thumbnail image.

timeExtent

autocast Property
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, 1996
const bookmark = new Bookmark({
timeExtent: {
start: new Date(1996, 11, 10),
end: new Date(1996, 11, 25)
}
})

uid

readonlyinherited Property
Type
string
Inherited from: IdentifiableMixin
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

autocast Property
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

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
clone(): Bookmark
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

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
ParameterTypeDescriptionRequired
json
any

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.

clone

Method
Signature
clone (): Bookmark
Since
ArcGIS Maps SDK for JavaScript 4.12

Creates a deep clone of the Bookmark.

Returns
Bookmark

A deep clone of the Bookmark instance.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

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.