Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.1 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.1 KB

latlng-address

this library is wrapper to call reverse geocoding function in the Google Maps API from node.js

Purpose

get address with latitude / longitude by reverse geocoding.

Parameter

field data type necessity description
latitude double required latitude data
longitude double required longitude data
option object optional about the detail, check below.

Optional parameter

optional parameter is set in the option argument.

Sample Code

About the key data, please register map api servie.
https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse?hl=ja

const LatLngAdr = require('latlng-address');

const config = {
  key: {YOUR KEY},
  stagger_time: 1000,
  encode_polylines: false,
  secure: true
};

const lla = new LatLngAdr(config);

lla.getAddress(40.782906, -73.965433)
.then((address) => {
  console.log(address);
});