Skip to content

Function: setViewport()

ts
function setViewport(view): Promise<void>;

Set the map viewport. Zoom range is validated as 10–24. mapCenter is validated for WGS84 coordinate ranges.

Parameters

ParameterTypeDescription
viewMapViewViewportOptions object specifying the desired viewport. ViewportOptions is the canonical type; MapView is a deprecated alias (same shape, kept for backward compatibility — prefer ViewportOptions in new code).

Returns

Promise<void>

Throws

MAPSTED-1043 when both zoomLevel and mapCenter are omitted, or when coordinates are outside WGS84 range.

Throws

MAPSTED-1090 when the API is not READY.