How to use the geolib.convertUnit function in geolib

To help you get started, we’ve selected a few geolib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hackclub / finder / src / components / ClubCard.js View on Github external
children: props => {
    const system = props.imperial ? 'mi' : 'km'
    return `${geolib.convertUnit(system, props.distance, 1)} ${system} away`
  },
  color: 'white',
github mongodb / stitch-examples / PlateSpace / Web / src / mongodb-manager / mongodb-manager.js View on Github external
function getDistance(fromLocation, toLocation) {
  const distance = geolib.getDistance(fromLocation, toLocation);
  return geolib.convertUnit('mi', distance, 1);
}

geolib

Library to provide basic geospatial operations like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc. This library is currently **2D**, meaning that altitude/elevation is not yet supported by any of its functions!

MIT
Latest version published 12 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages