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

heremap-node

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

heremap-node

node interface to HERE maps REST API

unpublished
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

HEREMAP-NODE

Set of node.js interfaces to HERE Maps REST APIs

Installation

npm install heremap-node

Usage

const heremap = require("heremap-node");

// your own credentials, to be obtained from developer.here.com
// by default, use production environemnt you may specify cit:true to use CIT
heremap.init({
    app_id: "YOUR APP_ID", app_code: "YOUR APP_CODE"
});


// simple geocoding
const res = await heremap.geocode("avenue des champs elysees, Paris");
console.log(res);

// Parallel geocoding and use in a route going from Paris to Versailles to bordeaux
const waypoints = [
    "avenue des champs-elysees, Paris",
    "Versailles, France",
    "Bordeaux,France",
];
const promises = waypoints.map(addr => heremap.geocode(addr));  // Arraéy of promises from geocoder
const result = await Promise.all(promises);                     // wait for all geocodes to be performed
const coords = result.map(resp => resp.coord);                  // extrct coords
const start = coords.shift();                                   // get start points and remove form list of waypoints
const resp = await heremap.route(start, coords);               // compute the route
console.log(result);

// Matrix Routing, exemple of 1:N
// Addresses are geocoding in parallel, and then first one is used as start point, all other as end points
const addresses = [
    "8 rue Benjamin Franklin Paris",
    "Perpignan, france",
    "Vannes, france",
    "Lyon,France",
    "Marseille,France",
    "Versailles,France"
];

const promises = addresses.map(addr => heremap.geocode(addr)); // array of promises
const result = await Promise.all(promises); // awaits all promises (gerocodes) to be performed
const coords = result.map(resp => resp.coord);  // get array of coords
const start = coords.shift();   // extract start point
const result = await heremap.matrix(start, coords); // does matrix routing
console.log(result);

Documentation from HERE

  • HERE Developer web site
  • HERE Developer's User guides in PDF

Keywords

HERE

FAQs

Package last updated on 05 Nov 2018

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