How to use the geolib.longitude 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 FH-Potsdam / shifted-maps / app / server / services / geocode.js View on Github external
function geocode(location, callback) {
  var lonLat = [geolib.longitude(location), geolib.latitude(location)].join(',');

  // Function for requesting a reversed geocode location if we have no cache entry
  function requestApi() {
    var apiURLObject = url.parse(config.mapbox.api_url, true),
      path = ['geocode', config.mapbox.geocoding_index];

    path.push(lonLat);

    apiURLObject.pathname += '/' + path.join('/') + '.json';
    apiURLObject.query.access_token = clientConfig.mapbox.token;

    var options = {
      url: url.format(apiURLObject),
      gzip: true
    };

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 1 year ago

Package Health Score

62 / 100
Full package analysis