resize method

MapboxMap resize([
  1. dynamic eventData
])

Resizes the map according to the dimensions of its container element.

Checks if the map container size changed and updates the map if it has changed. This method must be called after the map's container is resized programmatically or when the map is shown after being initially hidden with CSS.

@param eventData Additional properties to be passed to movestart, move, resize, and moveend events that get triggered as a result of resize. This can be useful for differentiating the source of an event (for example, user-initiated or programmatically-triggered events). @returns {MapboxMap} this @example // Resize the map when the map container is shown // after being initially hidden with CSS. var mapDiv = document.getElementById('map'); if (mapDiv.style.visibility === true) map.resize();

Implementation

MapboxMap resize([dynamic eventData]) =>
    MapboxMap.fromJsObject(jsObject.resize());