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

mappify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mappify

Node.js client library for Mappify.io

latest
Source
npmnpm
Version
0.8.1
Version published
Maintainers
1
Created
Source

Mappify JS Client

A simple asynchronous JavaScript client for Mappify.io

##Installation

Node.js:

npm install mappify

Usage

const mappify = require("mappify").getClient("<YOUR_API_KEY>");

The API key is optional but you'll be limited to 100 requests per day without it as per Mappify.io pricing

Geocoding - Autocomplete

mappify.autocomplete("178 Wake", (err, res) => {
    // Your code here
});

The response body is described in the Mappify.io API docs

You can disable prefix boosting by passing in an options argument:

mappify.autocomplete("178 Wake", {boostPrefix: false}, (err, res) => {

});

Geocoding - Classify Coordinates

mappify.classifyCoordinates("LGA", -27.471, 153.027, (err, res) => {
    // Your code here
});

The first argument is the encoding. Valid encoding values and the response structure described in the Mappify.io API docs

You can pass in a radius as the 4th argument:

mappify.classifyCoordinates("LGA", -27.471, 153.027, 500, (err, res) => {

});

Geocoding - Geocode

mappify.geocode("16 St Georges Terrace", "6000", "Perth", "WA", (err, res) => {
    // Your code here
});

Only the first argument (street address) is required, but pass in null or an empty string for arguments you don't use. Response structure described in the Mappify.io API docs

Geocoding - Reverse Geocode

mappify.reverseGeocode(-27.471, 153.027, (err, res) => {
    // Your code here
});

The response body is described in the Mappify.io API docs

You can pass in a radius as the 3rd argument:

mappify.reverseGeocode(-27.471, 153.027, 500, (err, res) => {

});

Routing - Driving Directions

Provide the Origin and Destination as point objects:

mappify.drivingDirections({lat: -12.4317, lon: 130.8449}, {lat: -12.4668, lon: 130.8426}, (err, res) => {
    // Your code here
});

You can toggle prioritiseMinimumDistance and ignoreDirectionality by providing an options object

mappify.drivingDirections({lat: -12.4317, lon: 130.8449}, {lat: -12.4668, lon: 130.8426}, {prioritiseMinimumDistance: true, ignoreDirectionality: true}, (err, res) => {

});

Response structure described in the Mappify.io API docs

Routing - Driving Statistics

Provide the Origin and Destination as point objects:

mappify.drivingStatistics({lat: -12.4317, lon: 130.8449}, {lat: -12.4668, lon: 130.8426}, (err, res) => {
    // Your code here
});

You can toggle prioritiseMinimumDistance and ignoreDirectionality by providing an options object

mappify.drivingStatistics({lat: -12.4317, lon: 130.8449}, {lat: -12.4668, lon: 130.8426}, {prioritiseMinimumDistance: true, ignoreDirectionality: true}, (err, res) => {

});

Response structure described in the Mappify.io API docs

Keywords

mappify

FAQs

Package last updated on 03 Nov 2019

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