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

my-google-map-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

my-google-map-autocomplete

Google Map Autocomplete search api

  • 0.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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 in an easy way. It can be used it React, React Native and other javascript related projects.

HOW TO USE


  1. Install the package.
npm i use-places-autocomplete
  1. Initialize the Google API Key in the entry point of your app.
import {Configure} from 'my-google-map-autocomplete';

Configure({
    GOOGLE_API_KEY: 'YOUR-GOOGLE-API-KEY-HERE'
});
  1. Use it normally.
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();
}, [])

Keywords

FAQs

Package last updated on 07 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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