Skip to content

An autocomplete input field to search city based on Google Map Places

License

Notifications You must be signed in to change notification settings

lufutu/AutoCity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoCity

An autocomplete input field to search city based on Google Map Places. You don't need JQuery library. Be free to use!

Usage

Add GoogleMap Javascript SDK first and include &libraries=places before use! You can also include language parameter if you want.

AutoCity()

Options

Property Meaning Default
element The HTML element input field will use for revice data. You can use "#" for id and "." for class .autocity
element_custom_class Custom class of input field will display for searching form-control
place_holder Place holder text for input field will display for searching Empty
data Value insert to input field, have two value string or object. String is simple name of city, object is an JSON object include all data of city string
country Add country for filter like 'en','fr','vi'.. All Countries

Callback

You can add callback function when google return all data of selected city

AutoCity({
            data: 'object'
        }, function (city) {
            alert("You selected city " + city.name);
        });

city is [Google Map Place Object] (https://developers.google.com/maps/documentation/javascript/places)

About

An autocomplete input field to search city based on Google Map Places

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published