Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added MarkerManager javascript class for managing markers on map
- Loading branch information
Bhagwat Kumar
committed
Jan 9, 2011
1 parent
71cd583
commit e8ab699
Showing
5 changed files
with
166 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
/* | ||
* jQuery geo_autocomplete plugin 1.0 | ||
* | ||
* Copyright (c) 2009 Bob Hitching | ||
* | ||
* Dual licensed under the MIT and GPL licenses: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* http://www.gnu.org/licenses/gpl.html | ||
* | ||
* Requires jQuery Autocomplete plugin by J�rn Zaefferer - see http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ | ||
* jquery.autocomplete.js requires a minor modification for geo_autocomplete to work, as shown in /lib/jquery.autocomplete_geomod.js | ||
* | ||
*/ | ||
;(function($) { | ||
|
||
$.fn.extend({ | ||
geo_autocomplete: function(_geocoder, _options) { | ||
options = $.extend({}, $.Autocompleter.defaults, { | ||
geocoder: _geocoder, | ||
parse: function(_results, _status, _query) { | ||
var _parsed = []; | ||
if (_results && _status && _status == 'OK') { | ||
$.each(_results, function(_key, _result) { | ||
if (_result.geometry && _result.geometry.viewport) { | ||
// place is first matching segment, or first segment | ||
var _place_parts = _result.formatted_address.split(','); | ||
var _place = _result.formatted_address; | ||
_parsed.push({ | ||
data: _result, | ||
value: _place, | ||
result: _place | ||
}); | ||
} | ||
}); | ||
} | ||
return _parsed; | ||
}, | ||
formatItem: function(_data, _i, _n, _value) { | ||
var _src = 'http://maps.google.com/maps/api/staticmap?visible=' + _data.geometry.viewport.getSouthWest().toUrlValue() + '|' + _data.geometry.viewport.getNorthEast().toUrlValue() + '&size=' + options.mapwidth + 'x' + options.mapheight + '&maptype=' + options.maptype + '&key=' + options.mapkey + '&sensor=' + (options.mapsensor ? 'true' : 'false'); | ||
var _place = _data.formatted_address; | ||
return _place + '<br clear="both"/>'; | ||
} | ||
}, _options); | ||
|
||
// if highlight is set to false, replace it with a do-nothing function | ||
options.highlight = options.highlight || function(value) { return value; }; | ||
|
||
// if the formatMatch option is not specified, then use formatItem for backwards compatibility | ||
options.formatMatch = options.formatMatch || options.formatItem; | ||
|
||
return this.each(function() { | ||
new $.Autocompleter(this, options); | ||
}); | ||
} | ||
}); | ||
|
||
})(jQuery); | ||
/* | ||
* jQuery geo_autocomplete plugin 1.0 | ||
* | ||
* Copyright (c) 2009 Bob Hitching | ||
* | ||
* Dual licensed under the MIT and GPL licenses: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* http://www.gnu.org/licenses/gpl.html | ||
* | ||
* Requires jQuery Autocomplete plugin by J�rn Zaefferer - see http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ | ||
* jquery.autocomplete.js requires a minor modification for geo_autocomplete to work, as shown in /lib/jquery.autocomplete_geomod.js | ||
* | ||
*/ | ||
(function($) { | ||
|
||
$.fn.extend({ | ||
geo_autocomplete: function(_geocoder, _options) { | ||
options = $.extend({}, $.Autocompleter.defaults, { | ||
geocoder: _geocoder, | ||
parse: function(_results, _status, _query) { | ||
var _parsed = []; | ||
if (_results && _status && _status == 'OK') { | ||
$.each(_results, function(_key, _result) { | ||
if (_result.geometry && _result.geometry.viewport) { | ||
// place is first matching segment, or first segment | ||
var _place_parts = _result.formatted_address.split(','); | ||
var _place = _result.formatted_address; | ||
_parsed.push({ | ||
data: _result, | ||
value: _place, | ||
result: _place | ||
}); | ||
} | ||
}); | ||
} | ||
return _parsed; | ||
}, | ||
formatItem: function(_data, _i, _n, _value) { | ||
var _src = 'http://maps.google.com/maps/api/staticmap?visible=' + _data.geometry.viewport.getSouthWest().toUrlValue() + '|' + _data.geometry.viewport.getNorthEast().toUrlValue() + '&size=' + options.mapwidth + 'x' + options.mapheight + '&maptype=' + options.maptype + '&key=' + options.mapkey + '&sensor=' + (options.mapsensor ? 'true' : 'false'); | ||
var _place = _data.formatted_address; | ||
return _place + '<br clear="both"/>'; | ||
} | ||
}, _options); | ||
|
||
// if highlight is set to false, replace it with a do-nothing function | ||
options.highlight = options.highlight || function(value) { return value; }; | ||
|
||
// if the formatMatch option is not specified, then use formatItem for backwards compatibility | ||
options.formatMatch = options.formatMatch || options.formatItem; | ||
|
||
return this.each(function() { | ||
new $.Autocompleter(this, options); | ||
}); | ||
} | ||
}); | ||
|
||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters