🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

google-maps-autocomplete-input

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-autocomplete-input

_autocomplete input with dropdown for google maps JS API

0.1.6
Source
npm
Version published
Maintainers
1
Created
Source

DEPRECATED AND MOVED TO: NPM GIT

https://www.npmjs.com/package/places-autocomplete

https://github.com/rgbutov/places-autocomplete

Autocomplete input with dropdwon for google maps JS API · npm version Bundlephobia

Browser document object is requered.

Sample

Installation

Node

npm i -s google-maps-autocomplete-input 

Script tag

<script src="/path/to/google-maps-autocomplete-input.min.js"></script>

Usage

  // _init module, you need API_TOKEN from google console
  const gmaInput = new googleMapsAutocompleteInput('<API_TOKEN>');
  const placeConfig = {
    // _specify country for autocomplete
    countryCode: 'us',
    // _type of autocomplition: (cities), (regions): https://developers.google.com/maps/documentation/javascript/places-autocomplete
    autocompleteType: ['(cities)'],
    // _use only place name
    onlyName: true,
    // _inputs list with additional filter places like city, state, country
    filterInputs: []
  } 
  // _after dropdown selected callback
  const afterPlaceSelected = (place_id, place_name) => {
    console.log(place_id, place_name);
  }
  
  const placeInput = document.getElementById('dcity');
  // bind input with autocompletetion to input
  gmaInput.bindInput({
      input: placeInput, 
      config: placeConfig,
      afterSelected: afterPlaceSelected
  });

License

Autocomplete input with dropdwon is MIT licensed.

Keywords

front-end

FAQs

Package last updated on 28 May 2020

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