google-map-js
Advanced tools
Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "google-map-js", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Pass form latitude longititude and to latitude longitude to get the route for the two points with google api.", | ||
@@ -5,0 +5,0 @@ "main": "server.js", |
@@ -24,4 +24,2 @@ # google-map-js | ||
Short route -> true set to be default we don't pass the parameter, false means you will pass the false values as a parameter. | ||
## Examples | ||
@@ -40,3 +38,3 @@ | ||
const data = await mapDistanceCalculater.DirectionsService(latitudeA, longitudeA, latitudeB, longitudeB, 'Google map api key', 'Travel mode', 'Short route'); | ||
const data = await mapDistanceCalculater.DirectionsService(latitudeA, longitudeA, latitudeB, longitudeB, 'Google map api key', 'Travel mode'); | ||
@@ -43,0 +41,0 @@ console.log(data); |
@@ -17,6 +17,5 @@ #!/usr/bin/env node | ||
* @param {string} travelMode 4 types -> driving, walking, bicycling, transit - default is driving | ||
* @param {string} optimize Best short route - default true | ||
* @returns {Promise<{ mapDistanceUrl: string, distance: Number }>} Promise that resolves to { routeDetails: Returns full details of distance route details, mapDistanceUrl: Distance map URL, distance: Distance with miles in 2 digits } | ||
*/ | ||
const DirectionsService = (latitudeA, longitudeA, latitudeB, longitudeB, googleMapApiKey, travelMode = 'driving', optimize = true) => { | ||
const DirectionsService = (latitudeA, longitudeA, latitudeB, longitudeB, googleMapApiKey, travelMode = 'driving') => { | ||
return new Promise((resolve, reject) => { | ||
@@ -44,3 +43,2 @@ try { | ||
mode: travelMode.trim().toLowerCase(), | ||
optimize: typeof optimize === 'boolean' ? optimize : Boolean(optimize.trim().toLowerCase()), | ||
key: googleMapApiKey | ||
@@ -127,3 +125,2 @@ }, | ||
try { | ||
// Define the address you want to geocode | ||
@@ -130,0 +127,0 @@ // const address = 'Your Address'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8487
151
67