Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@googlemaps/google-maps-services-js

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@googlemaps/google-maps-services-js - npm Package Compare versions

Comparing version 3.1.16 to 3.2.0

9

CHANGELOG.md

@@ -1,2 +0,2 @@

## [3.1.16](https://github.com/googlemaps/google-maps-services-js/compare/v3.1.15...v3.1.16) (2021-01-20)
# [3.2.0](https://github.com/googlemaps/google-maps-services-js/compare/v3.1.17...v3.2.0) (2021-09-22)

@@ -6,2 +6,7 @@

* **definition:** duration_in_traffic route leg property is optional ([#544](https://github.com/googlemaps/google-maps-services-js/issues/544)) ([1d0fc62](https://github.com/googlemaps/google-maps-services-js/commit/1d0fc626879aaa8142ad14c4dcc4a8fbcccf2e4a))
* add new icon fields ([#646](https://github.com/googlemaps/google-maps-services-js/issues/646)) ([105fe97](https://github.com/googlemaps/google-maps-services-js/commit/105fe97d457e22f09d85b6a11ca45077e05bfd01))
### Features
* add client_id and client_secret auth alternatives ([#640](https://github.com/googlemaps/google-maps-services-js/issues/640)) ([f0c7455](https://github.com/googlemaps/google-maps-services-js/commit/f0c7455a46cd457a9f34f50206df4b13d9a69b42))

@@ -82,2 +82,3 @@ "use strict";

PlaceType1["accounting"] = "accounting";
/** indicates an airport. */
PlaceType1["airport"] = "airport";

@@ -144,2 +145,3 @@ PlaceType1["amusement_park"] = "amusement_park";

PlaceType1["painter"] = "painter";
/** indicates a named park. */
PlaceType1["park"] = "park";

@@ -158,2 +160,3 @@ PlaceType1["parking"] = "parking";

PlaceType1["school"] = "school";
PlaceType1["secondary_school"] = "secondary_school";
PlaceType1["shoe_store"] = "shoe_store";

@@ -169,2 +172,3 @@ PlaceType1["shopping_mall"] = "shopping_mall";

PlaceType1["taxi_stand"] = "taxi_stand";
PlaceType1["tourist_attraction"] = "tourist_attraction";
PlaceType1["train_station"] = "train_station";

@@ -187,8 +191,34 @@ PlaceType1["transit_station"] = "transit_station";

(function (PlaceType2) {
/**
* indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states.
* Not all nations exhibit these administrative levels. In most cases, `administrative_area_level_1` short names will closely match
* ISO 3166-2 subdivisions and other widely circulated lists; however this is not guaranteed as our geocoding results are based
* on a variety of signals and location data.
*/
PlaceType2["administrative_area_level_1"] = "administrative_area_level_1";
/**
* indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties.
* Not all nations exhibit these administrative levels.
*/
PlaceType2["administrative_area_level_2"] = "administrative_area_level_2";
/**
* indicates a third-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
PlaceType2["administrative_area_level_3"] = "administrative_area_level_3";
/**
* indicates a fourth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
PlaceType2["administrative_area_level_4"] = "administrative_area_level_4";
/**
* indicates a fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
PlaceType2["administrative_area_level_5"] = "administrative_area_level_5";
PlaceType2["archipelago"] = "archipelago";
/** indicates a commonly-used alternative name for the entity. */
PlaceType2["colloquial_area"] = "colloquial_area";
PlaceType2["continent"] = "continent";
/** indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
PlaceType2["country"] = "country";

@@ -202,10 +232,18 @@ PlaceType2["establishment"] = "establishment";

PlaceType2["health"] = "health";
/** indicates a major intersection, usually of two major roads. */
PlaceType2["intersection"] = "intersection";
PlaceType2["landmark"] = "landmark";
/** indicates an incorporated city or town political entity. */
PlaceType2["locality"] = "locality";
/** indicates a prominent natural feature. */
PlaceType2["natural_feature"] = "natural_feature";
/** indicates a named neighborhood */
PlaceType2["neighborhood"] = "neighborhood";
PlaceType2["place_of_worship"] = "place_of_worship";
PlaceType2["plus_code"] = "plus_code";
PlaceType2["point_of_interest"] = "point_of_interest";
/** indicates a political entity. Usually, this type indicates a polygon of some civil administration. */
PlaceType2["political"] = "political";
PlaceType2["point_of_interest"] = "point_of_interest";
PlaceType2["post_box"] = "post_box";
/** indicates a postal code as used to address postal mail within the country. */
PlaceType2["postal_code"] = "postal_code";

@@ -215,14 +253,26 @@ PlaceType2["postal_code_prefix"] = "postal_code_prefix";

PlaceType2["postal_town"] = "postal_town";
/** indicates a named location, usually a building or collection of buildings with a common name */
PlaceType2["premise"] = "premise";
PlaceType2["room"] = "room";
/** indicates a named route (such as "US 101"). */
PlaceType2["route"] = "route";
PlaceType2["street_address"] = "street_address";
PlaceType2["street_number"] = "street_number";
/**
* indicates a first-order civil entity below a locality. For some locations may receive one of the additional types:
* `sublocality_level_1` to `sublocality_level_5`. Each sublocality level is a civil entity. Larger numbers indicate a smaller
* geographic area.
*/
PlaceType2["sublocality"] = "sublocality";
PlaceType2["sublocality_level_1"] = "sublocality_level_1";
PlaceType2["sublocality_level_2"] = "sublocality_level_2";
PlaceType2["sublocality_level_3"] = "sublocality_level_3";
PlaceType2["sublocality_level_4"] = "sublocality_level_4";
PlaceType2["sublocality_level_5"] = "sublocality_level_5";
PlaceType2["sublocality_level_3"] = "sublocality_level_3";
PlaceType2["sublocality_level_2"] = "sublocality_level_2";
PlaceType2["sublocality_level_1"] = "sublocality_level_1";
/**
* indicates a first-order entity below a named location, usually a singular building within a collection of buildings with a
* common name.
*/
PlaceType2["subpremise"] = "subpremise";
PlaceType2["town_square"] = "town_square";
})(PlaceType2 = exports.PlaceType2 || (exports.PlaceType2 = {}));

@@ -555,85 +605,3 @@ var AspectRatingType;

})(GeocodedWaypointStatus = exports.GeocodedWaypointStatus || (exports.GeocodedWaypointStatus = {}));
var AddressType;
(function (AddressType) {
/** indicates a precise street address. */
AddressType["street_address"] = "street_address";
/** indicates a named route (such as "US 101"). */
AddressType["route"] = "route";
/** indicates a major intersection, usually of two major roads. */
AddressType["intersection"] = "intersection";
/** indicates a political entity. Usually, this type indicates a polygon of some civil administration. */
AddressType["political"] = "political";
/** indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
AddressType["country"] = "country";
/**
* indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states.
* Not all nations exhibit these administrative levels. In most cases, `administrative_area_level_1` short names will closely match
* ISO 3166-2 subdivisions and other widely circulated lists; however this is not guaranteed as our geocoding results are based
* on a variety of signals and location data.
*/
AddressType["administrative_area_level_1"] = "administrative_area_level_1";
/**
* indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties.
* Not all nations exhibit these administrative levels.
*/
AddressType["administrative_area_level_2"] = "administrative_area_level_2";
/**
* indicates a third-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
AddressType["administrative_area_level_3"] = "administrative_area_level_3";
/**
* indicates a fourth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
AddressType["administrative_area_level_4"] = "administrative_area_level_4";
/**
* indicates a fifth-order civil entity below the country level. This type indicates a minor civil division.
* Not all nations exhibit these administrative levels.
*/
AddressType["administrative_area_level_5"] = "administrative_area_level_5";
/** indicates a commonly-used alternative name for the entity. */
AddressType["colloquial_area"] = "colloquial_area";
/** indicates an incorporated city or town political entity. */
AddressType["locality"] = "locality";
/**
* indicates a specific type of Japanese locality, to facilitate distinction between multiple locality components within a
* Japanese address.
*/
AddressType["ward"] = "ward";
/**
* indicates a first-order civil entity below a locality. For some locations may receive one of the additional types:
* `sublocality_level_1` to `sublocality_level_5`. Each sublocality level is a civil entity. Larger numbers indicate a smaller
* geographic area.
*/
AddressType["sublocality"] = "sublocality";
AddressType["sublocality_level_1"] = "sublocality_level_1";
AddressType["sublocality_level_2"] = "sublocality_level_2";
AddressType["sublocality_level_3"] = "sublocality_level_3";
AddressType["sublocality_level_4"] = "sublocality_level_4";
AddressType["sublocality_level_5"] = "sublocality_level_5";
/** indicates a named neighborhood */
AddressType["neighborhood"] = "neighborhood";
/** indicates a named location, usually a building or collection of buildings with a common name */
AddressType["premise"] = "premise";
/**
* indicates a first-order entity below a named location, usually a singular building within a collection of buildings with a
* common name.
*/
AddressType["subpremise"] = "subpremise";
/** indicates a postal code as used to address postal mail within the country. */
AddressType["postal_code"] = "postal_code";
/** indicates a prominent natural feature. */
AddressType["natural_feature"] = "natural_feature";
/** indicates an airport. */
AddressType["airport"] = "airport";
/** indicates a named park. */
AddressType["park"] = "park";
/**
* indicates a named point of interest. Typically, these "POI"s are prominent local entities that don't easily fit in another category,
* such as "Empire State Building" or "Statue of Liberty".
*/
AddressType["point_of_interest"] = "point_of_interest";
AddressType["establishment"] = "establishment";
})(AddressType = exports.AddressType || (exports.AddressType = {}));
exports.AddressType = Object.assign({}, PlaceType1, PlaceType2);
var Maneuver;

@@ -640,0 +608,0 @@ (function (Maneuver) {

@@ -39,3 +39,3 @@ "use strict";

departure_time: serialize_1.toTimestamp,
});
}, exports.defaultUrl);
function directions(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -42,0 +42,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -38,3 +38,3 @@ "use strict";

departure_time: serialize_1.toTimestamp
});
}, exports.defaultUrl);
function distancematrix(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -41,0 +41,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -18,3 +18,3 @@ /**

import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
export interface PositionalElevationParams extends RequestParams {
export interface PositionalElevationParams {
/**

@@ -27,3 +27,3 @@ * defines the location(s) on the earth from which to return elevation data.

}
export interface SampledPathElevationParams extends RequestParams {
export interface SampledPathElevationParams {
/**

@@ -43,3 +43,3 @@ * defines a path on the earth for which to return elevation data. This parameter defines a

export interface ElevationRequest extends Partial<AxiosRequestConfig> {
params: PositionalElevationParams | SampledPathElevationParams;
params: (PositionalElevationParams | SampledPathElevationParams) & RequestParams;
}

@@ -46,0 +46,0 @@ export interface ElevationResponseData extends ResponseData {

@@ -36,3 +36,3 @@ "use strict";

path: o => o.map(serialize_1.latLngToString)
});
}, exports.defaultUrl);
function elevation(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -39,0 +39,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -36,3 +36,3 @@ "use strict";

components: serialize_1.objectToString
});
}, exports.defaultUrl);
function geocode(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -39,0 +39,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -53,3 +53,3 @@ "use strict";

latlng: serialize_1.latLngToString
});
}, exports.defaultUrl);
function reverseGeocode(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -56,0 +56,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -153,6 +153,6 @@ /**

}
export declare const defaultUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json";
export declare const defaultParamsSerializer: (params: {
[key: string]: any;
}) => string;
export declare const defaultUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json";
export declare function placeAutocomplete({ params, method, url, paramsSerializer, ...config }: PlaceAutocompleteRequest, axiosInstance?: AxiosInstance): Promise<PlaceAutocompleteResponse>;

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.placeAutocomplete = exports.defaultUrl = exports.defaultParamsSerializer = exports.PlaceAutocompleteType = void 0;
exports.placeAutocomplete = exports.defaultParamsSerializer = exports.defaultUrl = exports.PlaceAutocompleteType = void 0;
const serialize_1 = require("../serialize");

@@ -60,7 +60,7 @@ const client_1 = require("../client");

})(PlaceAutocompleteType = exports.PlaceAutocompleteType || (exports.PlaceAutocompleteType = {}));
exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json";
exports.defaultParamsSerializer = serialize_1.serializer({
location: serialize_1.latLngToString,
origin: serialize_1.latLngToString
});
exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json";
}, exports.defaultUrl);
function placeAutocomplete(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -67,0 +67,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -33,3 +33,3 @@ "use strict";

exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/details/json";
exports.defaultParamsSerializer = serialize_1.serializer({}, { arrayFormat: "comma" });
exports.defaultParamsSerializer = serialize_1.serializer({}, exports.defaultUrl, { arrayFormat: "comma" });
function placeDetails(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -36,0 +36,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -33,3 +33,3 @@ "use strict";

exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/findplacefromtext/json";
exports.defaultParamsSerializer = serialize_1.serializer({}, { arrayFormat: "comma" });
exports.defaultParamsSerializer = serialize_1.serializer({}, exports.defaultUrl, { arrayFormat: "comma" });
function findPlaceFromText(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -36,0 +36,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -46,3 +46,3 @@ "use strict";

exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json";
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString });
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString }, exports.defaultUrl);
function placesNearby(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -49,0 +49,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -33,3 +33,3 @@ "use strict";

exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/queryautocomplete/json";
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString });
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString }, exports.defaultUrl);
function placeQueryAutocomplete(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -36,0 +36,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -33,3 +33,3 @@ "use strict";

exports.defaultUrl = "https://maps.googleapis.com/maps/api/place/textsearch/json";
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString });
exports.defaultParamsSerializer = serialize_1.serializer({ location: serialize_1.latLngToString }, exports.defaultUrl);
function textSearch(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -36,0 +36,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -35,3 +35,3 @@ "use strict";

points: o => o.map(latLng => serialize_1.latLngToString(latLng))
});
}, exports.defaultUrl);
function nearestRoads(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -38,0 +38,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -35,3 +35,3 @@ "use strict";

path: o => o.map(serialize_1.latLngToString)
});
}, exports.defaultUrl);
function snapToRoads(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -38,0 +38,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

@@ -26,5 +26,9 @@ /**

};
export declare function serializer(format: serializerFormat, queryStringOptions?: object): (params: {
export declare function serializer(format: serializerFormat, baseUrl: string, queryStringOptions?: object): (params: {
[key: string]: any;
}) => string;
export declare function toTimestamp(o: "now" | number | Date): number | "now";
export declare function createPremiumPlanQueryString(serializedParams: {
[key: string]: string;
}, queryStringOptions: object, baseUrl: string): string;
export declare function createPremiumPlanSignature(unsignedUrl: string, clientSecret: string): string;

@@ -18,5 +18,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.toTimestamp = exports.serializer = exports.latLngArrayToStringMaybeEncoded = exports.toLatLngLiteral = exports.latLngBoundsToString = exports.objectToString = exports.latLngToString = void 0;
exports.createPremiumPlanSignature = exports.createPremiumPlanQueryString = exports.toTimestamp = exports.serializer = exports.latLngArrayToStringMaybeEncoded = exports.toLatLngLiteral = exports.latLngBoundsToString = exports.objectToString = exports.latLngToString = void 0;
const util_1 = require("./util");
const crypto_1 = require("crypto");
const query_string_1 = require("query-string");
const url_1 = require("url");
const separator = "|";

@@ -100,3 +102,3 @@ function latLngToString(o) {

exports.latLngArrayToStringMaybeEncoded = latLngArrayToStringMaybeEncoded;
function serializer(format, queryStringOptions = {
function serializer(format, baseUrl, queryStringOptions = {
arrayFormat: "separator",

@@ -113,2 +115,6 @@ arrayFormatSeparator: separator,

});
if ("client_id" in serializedParams && "client_secret" in serializedParams) {
// Special case to handle premium plan signature
return createPremiumPlanQueryString(serializedParams, queryStringOptions, baseUrl);
}
return query_string_1.stringify(serializedParams, queryStringOptions);

@@ -128,2 +134,28 @@ };

exports.toTimestamp = toTimestamp;
function createPremiumPlanQueryString(serializedParams, queryStringOptions, baseUrl) {
serializedParams.client = serializedParams.client_id;
const clientSecret = serializedParams.client_secret;
delete serializedParams.client_id;
delete serializedParams.client_secret;
const partialQueryString = query_string_1.stringify(serializedParams, queryStringOptions);
const unsignedUrl = `${baseUrl}?${partialQueryString}`;
const signature = createPremiumPlanSignature(unsignedUrl, clientSecret);
// The signature must come last
return `${partialQueryString}&signature=${signature}`;
}
exports.createPremiumPlanQueryString = createPremiumPlanQueryString;
function createPremiumPlanSignature(unsignedUrl, clientSecret) {
// Strip off the protocol, scheme, and host portions of the URL, leaving only the path and the query
const fullUrl = new url_1.URL(unsignedUrl);
const pathAndQuery = `${fullUrl.pathname}${fullUrl.search}`;
// Convert from 'web safe' base64 to true base64
const unsafeClientSecret = clientSecret.replace(/-/g, "+").replace(/_/g, "/");
// Base64 decode the secret
const decodedSecret = Buffer.from(unsafeClientSecret, "base64");
// Sign the url with the decoded secret
const unsafeSignature = crypto_1.createHmac("sha1", decodedSecret).update(pathAndQuery).digest("base64");
// Convert from true base64 to 'web safe' base64
return unsafeSignature.replace(/\+/g, "-").replace(/\//g, "_");
}
exports.createPremiumPlanSignature = createPremiumPlanSignature;
//# sourceMappingURL=serialize.js.map

@@ -36,3 +36,3 @@ "use strict";

location: serialize_1.latLngToString
});
}, exports.defaultUrl);
function timezone(_a, axiosInstance = client_1.defaultAxiosInstance) {

@@ -39,0 +39,0 @@ var { params, method = "get", url = exports.defaultUrl, paramsSerializer = exports.defaultParamsSerializer } = _a, config = __rest(_a, ["params", "method", "url", "paramsSerializer"]);

{
"name": "@googlemaps/google-maps-services-js",
"version": "3.1.16",
"version": "3.2.0",
"description": "Node.js client library for Google Maps API Web Services",

@@ -5,0 +5,0 @@ "keywords": [

@@ -78,3 +78,3 @@ Node.js Client for Google Maps Services

The generated reference documentationcan be found [here](https://googlemaps.github.io/google-maps-services-js/). The TypeScript types are the authoritative documentation for this library and may differ slightly from the descriptions.
The generated reference documentation can be found [here](https://googlemaps.github.io/google-maps-services-js/). The TypeScript types are the authoritative documentation for this library and may differ slightly from the descriptions.

@@ -149,3 +149,27 @@ ## Developing

## Premium Plan Authentication
Authentication via client ID and URL signing secret is provided to support legacy applications that use the Google Maps Platform Premium Plan. The Google Maps Platform Premium Plan is no longer available for sign up or new customers. All new applications must use API keys.
```js
const client = new Client({});
client
.elevation({
params: {
locations: [{ lat: 45, lng: -110 }],
client_id: process.env.GOOGLE_MAPS_CLIENT_ID,
client_secret: process.env.GOOGLE_MAPS_CLIENT_SECRET
},
timeout: 1000 // milliseconds
})
.then(r => {
console.log(r.data.results[0].elevation);
})
.catch(e => {
console.log(e.response.data.error_message);
});
```
## Support

@@ -152,0 +176,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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