https://github.com/woosmap/woosmap-autocomplete-searchbox
Woosmap Autocomplete SearchBox to search for Woosmap Localities and fallback on Google Places according to a partial string similarity ratio (fuzzy string matching) and other certain specific criteria.
https://github.com/woosmap/woosmap-autocomplete-searchbox
Last synced: about 1 month ago
JSON representation
Woosmap Autocomplete SearchBox to search for Woosmap Localities and fallback on Google Places according to a partial string similarity ratio (fuzzy string matching) and other certain specific criteria.
- Host: GitHub
- URL: https://github.com/woosmap/woosmap-autocomplete-searchbox
- Owner: Woosmap
- Created: 2017-12-11T13:53:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T09:29:50.000Z (over 5 years ago)
- Last Synced: 2024-04-23T13:36:09.259Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://community.woosmap.com/localities-fallback-googleplaces/
- Size: 288 KB
- Stars: 0
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Autocomplete Localities Fallback Google Places
Lightweight and customizable autocomplete widget to search for [Woosmap Localities](https://developers.woosmap.com/products/localities/search-city-postcode/) and fallback on **Google Places** according to a partial string similarity ratio and other certain specific criteria.
Official Documentation:
## Overview
When Searching for [Woosmap Localities](https://developers.woosmap.com/products/localities/search-city-postcode/) using this widget, a **matching ratio** is computed between the user input and for each returned items.
- If Woosmap Localities return no item with matching **Ratio = 100** (customizable using `breakpointRatio` parameter), the widget populate predictions response with Google Places.
- All returned Woosmap Localities items with **Ratio <= 75** (customizable using `minRatio` parameter) are removed from the predictions pick list.
Check how we [calculate ratio](#ratio--partial-string-similarity) or explore [source code on GitHub](https://github.com/woosmap/woosmap-autocomplete-searchbox).
## Installation
You can use the **jsDelivr** CDN for both JS and CSS.
```html
```
Otherwise, [fork or download the source code](https://github.com/woosmap/woosmap-autocomplete-searchbox) and run the following commands:
#### Install dependencies
```ShellSession
$ npm install
```
#### Run
```ShellSession
$ npm run start
```
#### build
```ShellSession
$ npm run build
```
## Basic Usage
Before you try anything, you need to add an *input* block element and include `autocompletewoosmap.css` and `autocompletewoosmap.js` in your page, via the usual tags:
```html