location-search

3.1.0 • Public • Published

location-search npm

Javascript lib to add location autocomplete to a input box

Update

Added place_id field to Events.Geocode

Installation

npm i location-search

Usage

JavaScript

@import 'location-search';

HTML

<link rel="stylesheet" href="node_modules/@firstandthird/complete/lib/complete.css"/>
<div data-module="LocationSearch" class="module-complete">
  <input data-name="input" type="text" id="location-search" data-action="search" data-action-type="input" />
  <div data-name="resultsContainer"></div>
</div>

Attribution

Google requires anyone using the places api show attribution.

By default location-search uses ./img/light.png. This is the hidpi version so your css will need resize the image to 144px x 18px. There's also a img/dark.png available.

To change this, set the googleLogo option. This should be a path the browser can resolve. You can also set it to an empty string if you're going to display the logo elsewhere.

Readme

Keywords

none

Package Sidebar

Install

npm i location-search

Weekly Downloads

7

Version

3.1.0

License

none

Unpacked Size

61.7 kB

Total Files

10

Last publish

Collaborators

  • jga
  • dawnerd
  • ecwillis
  • orthagonal1
  • alaguna
  • aleperez92