@dotdev/reactive-google-map
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "@dotdev/reactive-google-map", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "package/index.js", | ||
@@ -5,0 +5,0 @@ "types": "package/index.d.ts", |
import usePlacesAutocomplete from "use-places-autocomplete"; | ||
export declare const useAutocomplete: (googleMapsApiKey: string, googleMapsApiVersion?: string) => ReturnType<typeof usePlacesAutocomplete>; | ||
export declare const useAutocomplete: (options: { | ||
googleMapsApiKey: string; | ||
googleMapsApiVersion: string; | ||
googleMapsOptions?: { | ||
[key: string]: any; | ||
/** Reference: https://developers.google.com/places/web-service/supported_types#table1 */ | ||
types?: Array<string>; | ||
bounds?: any; | ||
componentRestrictions?: any; | ||
}; | ||
}) => ReturnType<typeof usePlacesAutocomplete>; |
@@ -43,6 +43,6 @@ "use strict"; | ||
var utility_1 = require("../utility"); | ||
exports.useAutocomplete = function (googleMapsApiKey, googleMapsApiVersion) { | ||
if (googleMapsApiVersion === void 0) { googleMapsApiVersion = "3.37"; } | ||
exports.useAutocomplete = function (options) { | ||
var placesAutocomplete = use_places_autocomplete_1.default({ | ||
initOnMount: false, | ||
requestOptions: options.googleMapsOptions, | ||
}); | ||
@@ -53,3 +53,3 @@ React.useEffect(function () { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, utility_1.InjectScript("https://maps.google.com/maps/api/js?v=" + googleMapsApiVersion + "&key=" + googleMapsApiKey + "&libraries=places")]; | ||
case 0: return [4 /*yield*/, utility_1.InjectScript("https://maps.google.com/maps/api/js?v=" + options.googleMapsApiVersion + "&key=" + options.googleMapsApiKey + "&libraries=places")]; | ||
case 1: | ||
@@ -56,0 +56,0 @@ _a.sent(); |
Sorry, the diff of this file is not supported yet
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
79232
1085