This is the documentation of version 1.0.0-rc.2. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function calculateFittingBBox

    • Calculates an expanded bounding box that, when the map zooms to it, keeps the given to-be-contained bounding box visible within the area surrounding UI elements don't obscure, optional padding included.

      Parameters

      Returns BBox | null

      The expanded bounding box as [west, south, east, north], or null if the visible area is too small

      Use it when you want a specific geographic area (toBeContainedBBox) fully visible in the unobscured portion of the map (the area UI components don't cover). The function returns a larger bounding box that accounts for the space the UI elements take.