Skip to main content

Map State

Access functions that expose the current map view so you can persist state, create bookmarks, or drive related UI.

downloadMap

Export the current map view as an image (typically PNG) the user can download.

Parameters: None

Usage:

control.downloadMap();

getMapCenter

Retrieve the current map center coordinate (WGS84).

Parameters: None

Usage:

const center = control.getMapCenter();
Response
[
115.84918407152657,
-39.88261124068561
]

getMapExtent

Retrieve the current map extent (bounding box) if available.

Parameters: None

Usage:

const extent = control.getMapExtent();
Response
{
"xmin": 72.57528084020129,
"xmax": 159.12308730285957,
"ymin": -54.99625423678426,
"ymax": -20.536173852143378,
"zmax": 0,
"zmin": 0,
"spatialReference": {
"wkid": 4326
}
}