toBounds method

LngLatBounds toBounds(
  1. num radius
)

Returns a LngLatBounds from the coordinates extended by a given radius. The returned LngLatBounds completely contains the radius.

@param {number} radius=0 Distance in meters from the coordinates to extend the bounds. @returns {LngLatBounds} A new LngLatBounds object representing the coordinates extended by the radius. @example var ll = new mapboxgl.LngLat(-73.9749, 40.7736); ll.toBounds(100).toArray(); // = [-73.97501862141328, 40.77351016847229, -73.97478137858673, 40.77368983152771]

Implementation

LngLatBounds toBounds(num radius) =>
    LngLatBounds.fromJsObject(jsObject.toBounds(radius));