Permalink
Browse files

Secured setLocation.

  • Loading branch information...
1 parent 36cfa82 commit 9d98f0de44807d744f9a6dd545dfb4b868942745 @MattiSG committed Aug 14, 2010
Showing with 4 additions and 3 deletions.
  1. +1 −1 README.md
  2. +3 −2 Source/Meio.Autocomplete.Geo.js
View
@@ -1,4 +1,4 @@
-Meio.Autocomplete.Geo - Copyright (c) 2010 Matti Schneider-Ghibaudo
+Meio.Autocomplete.Geo by Matti Schneider-Ghibaudo
========================================================================
Meio.Autocomplete.Geo - a MooTools plugin based on Meio.Autocomplete that autocompletes a field with Google Local Search results and allows you to retrieve latitude, longitude, city and other info from the user's selection.
@@ -15,19 +15,20 @@ Meio.Autocomplete.Data.Geo = new Class({
Extends: Meio.Autocomplete.Data,
localSearch: new GlocalSearch(),
+ geocoderReqOpts: {},
/**
*@param geocoderReqOpts a Hash that may include the following values:
* location google.maps.LatLng or (lat, lng) array about which to search
*/
initialize: function init(geocoderReqOpts) {
this._cache = new Meio.Autocomplete.Cache();
- this.geocoderReqOpts = geocoderReqOpts; //we can't use Options because they change the prototype
+ this.setLocation(geocoderReqOpts.location || ''); //we can't use Options because they change the prototype
this.localSearch.setSearchCompleteCallback(null, this.handleResults.bind(this));
},
setLocation: function setLocation(loc) {
- this.geocoderReqOpts.location = loc;
+ this.geocoderReqOpts.location = loc || '';
},
prepare: function prepare(text){

0 comments on commit 9d98f0d

Please sign in to comment.