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 = ; geo; // Geocode an address to coordinates geo; // Reverse geocode coordinates to address. geo;
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 */moduleexports = access_token: 'PLACE YOUR MAPBOX API ACCESS TOKEN HERE';