ui.Map.centerObject

Centers the map view on a given object.

Returns this ui.Map.

UsageReturns
Map.centerObject(object, zoom, onComplete)ui.Map
ArgumentTypeDetails
this: ui.mapui.Map

The ui.Map instance.

objectElement|Geometry

An object to center on - a geometry, image or feature.

zoomNumber, optional

The zoom level, from 1 to 24. If unspecified, computed based on the object's bounding box.

onCompleteFunction, optional

A callback which is triggered after the recentering completes successfully. Passing this parameter causes the

`centerObject` operation to run asynchronously.