https://github.com/benignware/jquery-placepicker
A simple placepicker component for the google-maps api.
https://github.com/benignware/jquery-placepicker
Last synced: 11 months ago
JSON representation
A simple placepicker component for the google-maps api.
- Host: GitHub
- URL: https://github.com/benignware/jquery-placepicker
- Owner: benignware
- Created: 2014-03-08T12:32:50.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-23T10:44:19.000Z (almost 10 years ago)
- Last Synced: 2023-08-12T18:37:45.537Z (almost 3 years ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 12
- Watchers: 4
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery-placepicker
==================
A simple placepicker component for the google-maps api.
[Demo](http://benignware.github.io/jquery-placepicker)
Usage
-----
Include dependencies.
Be sure to add Google Places.
```html
```
```html
```
```js
$(".placepicker").placepicker();
```
Advanced usage
--------------
### Integrating a map view
This example shows how to integrate a collapsible map-view using bootstrap.
Include Bootstrap Collapsible and styles.
```html
```
```html
```
```js
$(".placepicker").placepicker();
```
```css
.placepicker-map {
min-height: 250px;
}
```
Options
-------
TypeNameDescription
HTMLdata-latitudePreset the map's latitude
HTMLdata-longitudePreset the map's longitude
HTMLdata-latitude-inputSet the DOM ID of the input field to populate with the latitude
HTMLdata-longitude-inputSet the DOM ID of the input field to populate with the longitude
HTMLdata-map-container-idSet the ID of the
element containing the map's destination element. Configuring this
will automatically inject an open/close button to show/hide the map.
The container must have Bootstrap's "collapse" CSS class.
JavaScriptmapMap selector or map-element
JavaScriptmapOptionsAn object with google maps api options
JavaScriptplaceChangedThis callback is fired when location changed
Methods
-------
NameDescriptionReturn
reloadReloads mapvoid
resizeResizes mapvoid
geoLocationSet value to html5 geo-locationvoid
getLocationReturns an object containing the current locationvoid
getLatLngReturns an object of type google.maps.LatLng containing the current location LatLng