{"_id":"geocomplete","_rev":"23-2c2f8e2ad82f62ca7e9edae5fe1b4d63","name":"geocomplete","dist-tags":{"latest":"1.7.0"},"versions":{"1.6.5":{"name":"geocomplete","version":"1.6.5","author":"","license":"ISC","_id":"geocomplete@1.6.5","maintainers":[{"name":"aemkei","email":"kleppe@ubilabs.net"}],"homepage":"https://github.com/ubilabs/geocomplete","bugs":{"url":"https://github.com/ubilabs/geocomplete/issues"},"dist":{"shasum":"c55bfc4d51ad8b36f6b1c4fbe221eb2b61d63128","tarball":"https://registry.npmjs.org/geocomplete/-/geocomplete-1.6.5.tgz","integrity":"sha512-A5BMujlyhH3nqHKCITlGyTJEmgbfI844x5ZiB3UYy0CtCx7HJ/NiPQgDmFrKvr5swXuKPr0mx7SHzxvuRITJzg==","signatures":[{"sig":"MEUCIQDJ/bNcvshjg3DBuEV/xpZyejHaZDxG5oZSnZM4Crtc5gIgC6MiNqs31jO7i+LbmaM/veRtUr8N/78v6itYoWF20fU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"jquery.geocomplete.js","_from":".","_shasum":"c55bfc4d51ad8b36f6b1c4fbe221eb2b61d63128","gitHead":"94debf955b692e16a1496c455d74e22797cd4f9a","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aemkei","email":"kleppe@ubilabs.net"},"repository":{"url":"https://github.com/ubilabs/geocomplete.git","type":"git"},"_npmVersion":"1.5.0-alpha-4","description":"An advanced jQuery plugin that wraps the Google Maps API's [Geocoding](https://code.google.com/apis/maps/documentation/javascript/geocoding.html) and [Places Autocomplete](https://code.google.com/apis/maps/documentation/javascript/places.html#places_autoc","directories":{"example":"examples"},"dependencies":{"docco":"^0.6.3","uglifyjs":"^2.3.6"},"devDependencies":{"grunt":"^0.4.5","grunt-release":"^0.7.0"}},"1.7.0":{"name":"geocomplete","version":"1.7.0","author":"","license":"ISC","_id":"geocomplete@1.7.0","maintainers":[{"name":"aemkei","email":"kleppe@ubilabs.net"}],"homepage":"https://github.com/ubilabs/geocomplete","bugs":{"url":"https://github.com/ubilabs/geocomplete/issues"},"dist":{"shasum":"c244765c853575261b5ee016f75b77cd382e4a1e","tarball":"https://registry.npmjs.org/geocomplete/-/geocomplete-1.7.0.tgz","integrity":"sha512-8DS+9iwY7ApzP0vqR5diBmA/FlcNgmPHCCINm0zMuw5fBNBTYQeBR2Ran+Y0mJ3CHY0RrZwP7h2fSMYRpXBnaw==","signatures":[{"sig":"MEUCIQCmyR0XF0YU6M3R92M6RwnjfrTskc9pKSLDkjSEIXZBPwIgCOsX3yWjvTEwDn1Rwc42o4bUsCh68oI3fF8qTHW03VI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"jquery.geocomplete.js","_from":".","_shasum":"c244765c853575261b5ee016f75b77cd382e4a1e","gitHead":"533c01c9db02de1772ade81ab93ee4819f8f896e","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aemkei","email":"kleppe@ubilabs.net"},"repository":{"url":"git+https://github.com/ubilabs/geocomplete.git","type":"git"},"_npmVersion":"3.9.5","description":"An advanced jQuery plugin that wraps the Google Maps API's [Geocoding](https://code.google.com/apis/maps/documentation/javascript/geocoding.html) and [Places Autocomplete](https://code.google.com/apis/maps/documentation/javascript/places.html#places_autoc","directories":{"example":"examples"},"_nodeVersion":"6.2.2","dependencies":{"docco":"^0.6.3","uglifyjs":"^2.3.6"},"devDependencies":{"grunt":"^0.4.5","grunt-release":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/geocomplete-1.7.0.tgz_1469456780686_0.29885679529979825","host":"packages-16-east.internal.npmjs.com"}}},"time":{"created":"2015-10-22T08:47:27.892Z","modified":"2025-10-30T09:16:48.922Z","1.6.5":"2015-10-22T08:47:27.892Z","1.7.0":"2016-07-25T14:26:22.812Z"},"bugs":{"url":"https://github.com/ubilabs/geocomplete/issues"},"license":"ISC","homepage":"https://github.com/ubilabs/geocomplete","repository":{"url":"git+https://github.com/ubilabs/geocomplete.git","type":"git"},"description":"An advanced jQuery plugin that wraps the Google Maps API's [Geocoding](https://code.google.com/apis/maps/documentation/javascript/geocoding.html) and [Places Autocomplete](https://code.google.com/apis/maps/documentation/javascript/places.html#places_autoc","maintainers":[{"email":"kleppe@ubilabs.net","name":"aemkei"},{"email":"malte.modrow@gmail.com","name":"mrmetalwood"},{"email":"m.schuhfuss@gmail.com","name":"usefulthink"},{"email":"theamazingpt@protonmail.com","name":"theamazingpt"},{"email":"mecklenburg@ubilabs.net","name":"rich_pb"},{"email":"npm@ubilabs.com","name":"ubilabs-bot"}],"readme":"# $.geocomplete() - Version 1.7.0\n## jQuery Geocoding and Places Autocomplete Plugin\n\nAn advanced jQuery plugin that wraps the Google Maps API's [Geocoding](https://code.google.com/apis/maps/documentation/javascript/geocoding.html) and [Places Autocomplete](https://code.google.com/apis/maps/documentation/javascript/places.html#places_autocomplete) services. You simply provide an input that lets you search for locations with a nice autocomplete dropdown. Optionally add a container to show an interactive map and a form that will be populated with the address details.\n\nView the [annotated source](http://ubilabs.github.com/geocomplete/docs/).\n\n## Basic Usage\n\nTo convert an input into an autocomplete field, simply call the Geocomplete plugin:\n\n```javascript\n$(\"input\").geocomplete();  // Option 1: Call on element.\n$.fn.geocomplete(\"input\"); // Option 2: Pass element as argument.\n```\n\n## Examples\n\nHere is a list of basic uses:\n\n* [Simple](http://ubilabs.github.com/geocomplete/examples/simple.html) - Single input with an event logger.\n* [Map](http://ubilabs.github.com/geocomplete/examples/map.html) - Adding a map.\n* [Location](http://ubilabs.github.com/geocomplete/examples/location.html) - Adding a default location.\n* [Form](http://ubilabs.github.com/geocomplete/examples/form.html) - Populate form fields.\n* [Attribute](http://ubilabs.github.com/geocomplete/examples/custom_attribute.html) - Using custom attributes to populate data.\n* [Multiple results](http://ubilabs.github.com/geocomplete/examples/multiple_results.html) - Handling multiple results from the geocoder.\n* [Draggable](http://ubilabs.github.com/geocomplete/examples/draggable.html) -  A draggable marker to redefine the position.\n* [Styled](http://ubilabs.github.com/geocomplete/examples/styled.html) -  A styled map example.\n\n## Requirements\n\nMake sure you include the Google Maps API with the Places Library before loading this plugin as described [here](https://developers.google.com/maps/documentation/javascript/places#loading_the_library).\n\n````html\n<script src=\"http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places\"></script>\n<script src=\"jquery.geocomplete.js\"></script>\n```\n\nIf you use the plugin without showing a map you must display the \"[powered by Google](https://developers.google.com/maps/documentation/javascript/places#autocomplete_no_map)\" logo under the text field.\n\n## Trigger Request\n\nTo trigger a geocoding request from outside (eg. when hitting the \"find\" button), simply trigger the \"geocode\" event on the element.\n\n````javascript\n$(\"input\").geocomplete();\n\n// Trigger geocoding request.\n$(\"button.find\").click(function(){\n  $(\"input\").trigger(\"geocode\");\n});\n```\n\n## Adding a Map Preview\n\nTo link the geocode results with an interactive map, you can pass `map` as an option to the plugin.\n\n```javascript\n$(\"#my_input\").geocomplete({\n  map: \"#my_map\"\n});\n```\n\nThe `map` option might be a selector, a jQuery object or a DOM element.\n\n## Populate Form Data\n\nYou can pass `details` as an option to specify a container that will be populated when a geocoding request was successful.\n\nBy default the plugin analyses the `name` attribute of the containers child nodes and replaces the content. You can override the `detailsAttribute` to use another attribute such as `data-geo`.\n\nIf the element is an input, the value will be replaced otherwise the plugin overrides the current text.\n\nIf you have multiple geocomplete fields on a page, use `detailsScope` option scope your 'details' container.\n\n**Note**: Some address components such as \"country\" return an additional `short_name`. You can access them by simply adding `_short` at the end of the type.\n\nSimple Example:\n\n```html\n<form>\n  Latitude:   <input name=\"lat\" type=\"text\" value=\"\">\n  Longitude:  <input name=\"lng\" type=\"text\" value=\"\">\n  Address:    <input name=\"formatted_address\" type=\"text\" value=\"\">\n</form>\n```\n\n```javascript\n$(\"input\").geocomplete({ details: \"form\" });\n```\n\nAdvanced Example:\n\n```html\n<div class=\"details\">\n  Latitude:     <span data-geo=\"lat\" />\n  Longitude:    <span data-geo=\"lng\" />\n  Address:      <span data-geo=\"formatted_address\" />\n  Country Code: <span data-geo=\"country_short\" />\n</div>\n```\n\n```javascript\n$(\"input\").geocomplete({\n  details: \".details\",\n  detailsAttribute: \"data-geo\"\n});\n```\n\n## List of Options\n\nThe following options might be passed to the plugin call. If you omit them, they fall back to the default.\n\nExample:\n\n```javascript\n$(\"#my_input\").geocomplete({\n  map: \"#my_map\",\n  mapOptions: {\n    zoom: 10\n  },\n  markerOptions: {\n    draggable: true\n  },\n  details: \"#my_form\"\n});\n```\n\n* `map` - Might be a selector, a jQuery object or a DOM element. Default is `false` which shows no map.\n* `details` - The container that should be populated with data. Defaults to `false` which ignores the setting.\n* 'detailsScope' - Allows you to scope the 'details' container and have multiple geocomplete fields on one page. Must be a parent of the input. Default is 'null'\n* `location` - Location to initialize the map on. Might be an address `string` or an `array` with [latitude, longitude] or a `google.maps.LatLng`object. Default is `false` which shows a blank map.\n* `bounds` - Whether to snap geocode search to map bounds. Default: `true` if false search globally. Alternatively pass a custom LatLngBounds object\n* `detailsAttribute` - The attribute's name to use as an indicator. Default: `\"name\"`\n* `mapOptions` - Options to pass to the `google.maps.Map` constructor. See the full list [here](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions).\n* `mapOptions.zoom` - The inital zoom level. Default: `14`\n* `mapOptions.scrollwheel` - Whether to enable the scrollwheel to zoom the map. Default: `false`\n* `mapOptions.mapTypeId` - The map type. Default: `\"roadmap\"`\n* `markerOptions` - The options to pass to the `google.maps.Marker` constructor. See the full list [here](http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerOptions).\n* `markerOptions.draggable` - If the marker is draggable. Default: `false`. Set to true to enable dragging.\n* `markerOptions.disabled` - Do not show marker. Default: `false`. Set to true to disable marker.\n* `maxZoom` - The maximum zoom level to zoom in after a geocoding response. Default: `16`\n* `componentRestrictions` - Option for Google Places Autocomplete to restrict results by country. See the [docs](https://developers.google.com/maps/documentation/javascript/places#places_autocomplete)\n* `types` - An array containing one or more of the supported types for the places request. Default: `['geocode']` See the full list [here](http://code.google.com/apis/maps/documentation/javascript/places.html#place_search_requests).\n* `blur` - Defaults to `false`. When enabled it will trigger the geocoding request whenever the geofield is blured. (See jQuery `.blur()`)\n\n## Events\n\nYou can subscribe to events of the geocode plugin by using the default jQuery syntax:\n\n````javascript\n$(\"input\")\n  .geocomplete()\n  .bind(\"geocode:result\", function(event, result){\n    console.log(result);\n  });\n```\n\nThe following events are supported:\n\n* `\"geocode:result\"` - Geocode was successful. Passes the original result as described [here](http://code.google.com/apis/maps/documentation/javascript/geocoding.html#GeocodingResults).\n* `\"geocode:error\"` - Fired when the geocode returns an error. Passes the current status as listed [here](http://code.google.com/apis/maps/documentation/javascript/geocoding.html#GeocodingStatusCodes).\n* `\"geocode:multiple\"` - Fired immediately after the \"result\" event if multiple results were found. Passes an array of all results.\n* `\"geocode:dragged\"` - Fired when the marker's position was modified manually. Passes the updated location.\n* `\"geocode:click\"` - Fired when 'click' event occurs on the map. Passes the location where the click had place.\n* `\"geocode:mapdragged\"` - Fired when the map bounds are modified by dragging manually. Passes the location of the current map center.\n* `\"geocode:idle\"` - Fired when the map becomes idle after panning or zooming. Passes the location of the current map center.\n\n## Methods and Properties\n\nYou can access all properties and methods of the plugin from outside. Simply add a string as the first argument to the `.geocomplete` method after you initialized the plugin.\n\nExample:\n\n````javascript\n// Initialize the plugin.\n$(\"input\").geocomplete({ map: \".map_canvas\" });\n\n// Call the find method with the parameter \"NYC\".\n$(\"input\").geocomplete(\"find\", \"NYC\");\n\n// Get the map and set a new zoom level.\nvar map = $(\"input\").geocomplete(\"map\");\nmap.setZoom(3);\n```\n\n## Address and Places Specific Component Types\n\nThe following types are supported by the geocoder and will be passed to the provided form or container:\n\n`street_address`, `route`, `intersection`, `political`, `country`, `administrative_area_level_1`, `administrative_area_level_2`, `administrative_area_level_3`, `colloquial_area`, `locality`, `sublocality`, `neighborhood`, `premise`, `subpremise`, `postal_code`, `natural_feature`, `airport`, `park`, `point_of_interest`, `post_box`, `street_number`, `floor`, `room`, `lat`, `lng`, `viewport`, `location`, `formatted_address`, `location_type`, `bounds`\n\nFor more information about address components visit http://code.google.com/apis/maps/documentation/geocoding/#Types\n\n\nAdditionally the following details are passed when the Places API was requested:\n\n`id`, `url`, `website`, `vicinity`, `reference`, `rating`, `international_phone_number`, `icon`, `formatted_phone_number`\n\nMore information can be found here: https://developers.google.com/maps/documentation/javascript/places#place_details_responses\n\n\n## About\n\nDeveloped by [Martin Kleppe](http://twitter.com/aemkei) at [Ubilabs](http://ubilabs.net).\n","readmeFilename":"README.md","users":{"jeandrebosch":true}}