# google-map-js

> Pass form latitude longititude and to latitude longitude to get the route for the two points with google api.

Latest version **1.0.10** (published 2023-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install google-map-js
pnpm add google-map-js
yarn add google-map-js
bun add google-map-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2023-06-19 |
| First published | 2023-06-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | saravana kumar A |
| Maintainers | devil1432 |
| Keywords | googlemaps, direction, location, distance-route, distance-calculater, geolocation, map, best-route, latitude, longititude |

## Links

- npm: https://www.npmjs.com/package/google-map-js
- npm.io page: https://npm.io/package/google-map-js

## Dependencies (1)

- [@googlemaps/google-maps-services-js](https://npm.io/package/@googlemaps/google-maps-services-js.md) ^3.3.31

## Recent versions

- 1.0.10 (latest) — 2023-06-19
- 1.0.9 — 2023-06-19
- 1.0.8 — 2023-06-18
- 1.0.7 — 2023-06-18
- 1.0.6 — 2023-06-18
- 1.0.5 — 2023-06-18
- 1.0.4 — 2023-06-18
- 1.0.3 — 2023-06-16
- 1.0.1 — 2023-06-16
- 1.0.0 — 2023-06-15

## README

# google-map-js

## Installing

### Package manager

Using npm:

```bash
$ npm install google-map-js
```

## google-map-js

Requests can be made by passing the relevant config to `google-map-js`.

Travel mode have 4 types -> default select is driving:

-   1.Driving
-   2.Walking
-   3.Bicycling
-   4.Transit

## Examples

### Get 2 points routes and distance calculate

```js
// Send a request to get 2 points routes and distance calculate
const latitudeA = 00.000000; // Latitude of point A
const longitudeA = 00.000000; // Longitude of point A
const latitudeB = 00.000000; // Latitude of point B
const longitudeB = 00.000000; // Longitude of point B

const mapDistanceCalculater = require('google-map-js');

const data = await mapDistanceCalculater.DirectionsService(latitudeA, longitudeA, latitudeB, longitudeB, 'Google map api key', 'Travel mode');

console.log(data);

// Output -> data
{
  { routeDetails: Returns full details of distance route details,
    mapDistanceUrl: Distance map URL,
    distance: Distance with miles in 2 digits
  }
}
```

### Address using to get the latitude longitude

```js
const map = require('google-map-js');

const data = await map.GetAddressToLatitudeLongitude('Your address', 'Google map api key');

console.log(data);

// Output -> data
{
  {
    latitude: Repective address latitude,
		longitude: Repective address longitude
  }
}
```

---
_Source: https://npm.io/package/google-map-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
