getCenter method

LngLat getCenter()

Returns the geographical coordinate equidistant from the bounding box's corners.

@returns {LngLat} The bounding box's center. @example var llb = new mapboxgl.LngLatBounds(-73.9876, 40.7661, -73.9397, 40.8002); llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}

Implementation

LngLat getCenter() => LngLat.fromJsObject(jsObject.getCenter());