my-google-map-autocomplete
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "my-google-map-autocomplete", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Google Map Autocomplete search api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,46 @@ ### MY-GOOGLE-MAP-AUTOCOMPLETE | ||
This is a javascript that uses Google Maps Places Autocomplete, Details and Geocode to help build an app capable of leveraging the power of Google Maps Places API. | ||
This is a javascript that uses Google Maps Places Autocomplete, Details and Geocode to help build an app capable of leveraging the power of Google Maps Places API in an easy way. It can be used it React, React Native and other javascript related projects. | ||
### HOW TO USE | ||
------------ | ||
1. Install the package. | ||
```javascript | ||
npm i use-places-autocomplete | ||
``` | ||
2. Initialize the Google API Key in the entry point of your app. | ||
```javascript | ||
import {Configure} from 'my-google-map-autocomplete'; | ||
Configure({ | ||
GOOGLE_API_KEY: 'YOUR-GOOGLE-API-KEY-HERE' | ||
}); | ||
``` | ||
3. Use it normally. | ||
```javascript | ||
import {PlaceAutocomplete, PlaceInfo, GeocodeInfo} from 'my-google-map-autocomplete'; | ||
React.useEffect(() => { | ||
async function locationTest() { | ||
const autocompleteInfo = await PlaceAutocomplete('california'); | ||
const placenfo = await PlaceInfo(autocompleteInfo[0].place_id); | ||
const {lat, lng} = placenfo.geometry.location; | ||
const geoInfo = await GeocodeInfo(lat, lng); | ||
console.log(autocompleteInfo); | ||
console.log(placenfo); | ||
console.log(geoInfo); | ||
} | ||
locationTest(); | ||
}, []) | ||
``` | ||
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
3108
50