1.0.10 • Published 2 years ago

google-map-js v1.0.10

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

google-map-js

Installing

Package manager

Using npm:

$ 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

// 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

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
  }
}
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago