Socket
Socket
Sign inDemoInstall

google-map-js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-map-js - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

package.json
{
"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';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc