setCenter method

MapboxMap setCenter(
  1. LngLat center, [
  2. dynamic eventData
])

Sets the map's geographical centerpoint. Equivalent to jumpTo({center: center}).

@memberof MapboxMap# @param center The centerpoint to set. @param eventData Additional properties to be added to event objects of events triggered by this method. @fires movestart @fires moveend @returns {MapboxMap} this @example map.setCenter(-74, 38);

Implementation

MapboxMap setCenter(LngLat center, [dynamic eventData]) =>
    MapboxMap.fromJsObject(jsObject.setCenter(center.jsObject));