ui.Map.onChangeCenter

Registers a callback that's fired when the map center changes. This is fired during pan or when the map's center is changed programmatically.

Returns an ID which can be passed to unlisten() to unregister the callback.

UsageReturns
Map.onChangeCenter(callback)String
ArgumentTypeDetails
this: ui.mapui.MapThe ui.Map instance.
callbackFunctionThe callback to fire when the map center changes. The callback is passed two parameters: an object containing the coordinates of the new center (with keys lon and lat) and the map widget itself.