Skip to content
Newer
Older
100644 53 lines (31 sloc) 1.88 KB
3122250 @tristandunn Update README.
authored
1 # jQuery Automatic Geocoder
e94d315 @tristandunn Add a README.
authored
2
3 A jQuery plug-in to automatically geocode and display a location entered in a
4 text field by a user.
5
6 ## Usage
7
8 1. Include [jQuery](http://jquery.com).
3122250 @tristandunn Update README.
authored
9 2. Include the Google Maps [JavaScript API Version 3](https://developers.google.com/maps/documentation/javascript/).
10 3. Include [the plug-in](https://github.com/tristandunn/jquery-auto-geocoder/raw/master/jquery.auto-geocoder.min.js).
b829d1d @tristandunn Clean up README and add credits section.
authored
11 4. Set a width and height for the map using the class name, which is `jquery-auto-geocoder-map` by default.
12 5. Call `autoGeocoder` on your location input(s).
e94d315 @tristandunn Add a README.
authored
13
14 ## Example
15
eea4af3 @tristandunn Support highlighting in README.
authored
16 ~~~ js
17 $(function() {
18 $('#location').autoGeocoder();
19 });
20 ~~~
e94d315 @tristandunn Add a README.
authored
21
ed5f888 @tristandunn Remove references to online examples.
authored
22 See [examples](https://github.com/tristandunn/jquery-auto-geocoder/tree/master/examples/) for more.
e94d315 @tristandunn Add a README.
authored
23
e44b6ca @tristandunn Add documentation for available options to the README.
authored
24 ## Options
25
26 ##### className
27
28 The class name of the map container. Defaults to `jquery-auto-geocoder-map`.
29
30 ##### position
31
32 Where to insert the map container. Supported options are `after` and `before` for after and before the element, or a custom jQuery selector for where the element should be appended. Defaults to `after`.
33
34 ##### delay
35
36 The time, in milliseconds, to wait after a keypress before geocoding the location. Defaults to `500`.
37
38 ##### success.zoom
39
40 The zoom level to use after a successful geocoding. Supported options are any Google Maps zoom level, or `auto` to have it automatically determined. Defaults to `auto`.
41
42 ##### initial
43
44 The initial options used to create the map. Accepts any options `google.maps.Map` accepts. The `zoom` and `center` options are also used to reset the map after an unsuccessful geocoding. See the bottom of [jquery.auto-geocoder.js](https://github.com/tristandunn/jquery-auto-geocoder/blob/master/jquery.auto-geocoder.js) for all the defaults.
45
b829d1d @tristandunn Clean up README and add credits section.
authored
46 ## Credits
47
3122250 @tristandunn Update README.
authored
48 * [Jan-Gerd Tenberge](http://janten.com) for the `map.fitBounds(viewport)` tip.
b829d1d @tristandunn Clean up README and add credits section.
authored
49
e94d315 @tristandunn Add a README.
authored
50 ## License
51
463e8e3 @tristandunn Move the license out of the README.
authored
52 jquery-auto-geocoder uses the MIT license. See LICENSE for more details.
Something went wrong with that request. Please try again.