New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mapbox-geocoding

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapbox-geocoding

A node module for querying the mapbox geocoding api.

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
99
-38.89%
Maintainers
1
Weekly downloads
 
Created
Source

mapbox-geocoding

Simple node.js wrapper module for querying the geocoding api of mapbox v4.

Installation

  npm install mapbox-geocoding --save

Usage

The mapbox-geocoding module exposes three methods, one for setting the mapbox public access token setAccessToken and two for querying the mapbox geocoding API geocode & reverseGeocode.

  var geo = require('mapbox-geocoding');

  geo.setAccessToken('YOUR MAPBOX PUBLIC TOKEN');

  // Geocode an address to coordinates
  geo.geocode('mapbox.places', 'Dam Square, Amsterdam', function (err, geoData) {
	  console.log(geoData);
  });

  // Reverse geocode coordinates to address.
  geo.reverseGeocode('mapbox.places', '4.8936580', '52.3731720', function (err, geoData) {
	  console.log(geoData);
  });

Tests

To run the tests execute:

	npm test

The tests have a configuration dependency, which is git ignored. To run the tests you will need config.js file under the config directory and of the following structure:

/**
 * Module configuration.
 *
 * Contains the mapbox public access token for the tests.
 *
 * config/config.js
 */
module.exports = {
	access_token: 'PLACE YOUR MAPBOX API ACCESS TOKEN HERE'
};

Dependencies

request

Keywords

mapbox

FAQs

Package last updated on 01 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts