1.0.5 • Published 2 years ago

@devkosta/reverse-geocode v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Reverse Geocode

A Module to Transform Coordinates into Human-Readable Location Data. This module utilises the Google Maps Geocoding API.

Installation

npm install @devkosta/reverse-geocode --save-dev
yarn add @devkosta/reverse-geocode

How to Use

import { reverseGeocode } from '@devkosta/reverse-geocode';

/**
  * @param {string} apiKey
  * @param {number} lat
  * @param {number} lng
  *
  * @returns {Promise}
  */

reverseGeocode('YOUR GOOGLE API KEY', 38.8977, 77.0365)
	.then((res) => {
		const formattedAddress = res.results[0].formatted_address;
		console.log(formattedAddress);
	})
	.catch((error) => {
		console.error(error);
	});

Props

PropertyTypeRequired?Description
apiKeyStringYour Google API KEY. This can be retrieved from here.
latNumberThe latitude value to be parsed.
lngNumberThe longitude value to be parsed.

License

MIT © DevKosta

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago