geolib
Version:
Library to provide basic geospatial operations like distance calculation, decoding of sexagesimal coordinates etc.
1 lines • 567 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _getBounds=_interopRequireDefault(require("./getBounds"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const getCenterOfBounds=coords=>{const bounds=(0,_getBounds.default)(coords);const latitude=bounds.minLat+(bounds.maxLat-bounds.minLat)/2;const longitude=bounds.minLng+(bounds.maxLng-bounds.minLng)/2;return{latitude:parseFloat(latitude.toFixed(6)),longitude:parseFloat(longitude.toFixed(6))}};var _default=exports.default=getCenterOfBounds;