Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Slightly improve compilation size.

  • Loading branch information...
commit 773aa62ab56e2c2cdc87cd52a315dd6afc808136 1 parent 052b63c
@tristandunn authored
Showing with 9 additions and 10 deletions.
  1. +5 −6 jquery.auto-geocoder.js
  2. +4 −4 jquery.auto-geocoder.min.js
View
11 jquery.auto-geocoder.js
@@ -1,10 +1,9 @@
(function($) {
var geocoder = new google.maps.Geocoder();
- $.fn.autoGeocoder = function(options) {
- var autoGeocoder = $.fn.autoGeocoder,
- options = $.extend(true, {}, autoGeocoder.defaults, options || {}),
- setup = options.setup || autoGeocoder.base;
+ var autoGeocoder = $.fn.autoGeocoder = function(options) {
+ var options = $.extend(true, {}, autoGeocoder.defaults, options || {}),
+ setup = options.setup || autoGeocoder.base;
for (property in setup) {
var methods = setup[property];
@@ -17,7 +16,7 @@
return this.trigger('auto-geocoder.initialize');
};
- $.fn.autoGeocoder.base = {
+ autoGeocoder.base = {
initialize: [function(options) {
options.initial.center = new google.maps.LatLng(
options.initial.center[0],
@@ -122,7 +121,7 @@
onGeocodeFailure: []
};
- $.fn.autoGeocoder.defaults = {
+ autoGeocoder.defaults = {
className : 'jquery-auto-geocoder-map',
position : 'after',
delay : 500,
View
8 jquery.auto-geocoder.min.js
@@ -1,4 +1,4 @@
-(function(e){var j=new google.maps.Geocoder;e.fn.autoGeocoder=function(b){var a=e.fn.autoGeocoder;b=e.extend(!0,{},a.defaults,b||{});a=b.setup||a.base;for(property in a)for(var d=a[property],c=0,f=d.length;c<f;c++)d[c].call(this,b);return this.trigger("auto-geocoder.initialize")};e.fn.autoGeocoder.base={initialize:[function(b){b.initial.center=new google.maps.LatLng(b.initial.center[0],b.initial.center[1]);this.on("auto-geocoder.initialize",function(){e(this).trigger("auto-geocoder.createMap").trigger("auto-geocoder.onKeyUp")})}],
-createMap:[function(b){this.on("auto-geocoder.createMap",function(){var a=e(this),d=e("<div>",{"class":b.className}),c=b.position;if("before"==c||"after"==c)a[c](d);else e(c).append(d);a.on("keyup.auto-geocoder",function(){a.trigger("auto-geocoder.onKeyUp")});this.map=new google.maps.Map(d[0],b.initial)})}],onKeyUp:[function(b){this.on("auto-geocoder.onKeyUp",function(){var a=this,d=e(a),c=e.trim(d.val()).replace(/\s+/g," ").toLowerCase(),f=this.timeout,g=this.previousAddress;f&&clearTimeout(f);g&&
-g==c||(""==c?d.trigger("auto-geocoder.onGeocodeResult",[[],""]):this.timeout=setTimeout(function(){a.previousAddress=c;j.geocode({address:c},function(a,b){d.trigger("auto-geocoder.onGeocodeResult",[a,b])})},b.delay))})}],onGeocodeResult:[function(b){this.on("auto-geocoder.onGeocodeResult",function(a,d,c){a=this.map;var f=this.marker=this.marker||new google.maps.Marker;if(c==google.maps.GeocoderStatus.OK){var g=d[0].geometry,h=g.location;"auto"==b.success.zoom?a.fitBounds(g.viewport):(a.setZoom(b.success.zoom),
-a.setCenter(h));f.setPosition(h);f.setMap(a);e(this).trigger("auto-geocoder.onGeocodeSuccess",[d,c])}else g=b.initial,f&&f.setMap(null),a.setZoom(g.zoom),a.setCenter(g.center),e(this).trigger("auto-geocoder.onGeocodeFailure",[d,c])})}],onGeocodeSuccess:[],onGeocodeFailure:[]};e.fn.autoGeocoder.defaults={className:"jquery-auto-geocoder-map",position:"after",delay:500,success:{zoom:"auto"},initial:{zoom:1,center:[34,0],draggable:!1,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1}}})(jQuery);
+(function(e){var j=new google.maps.Geocoder,h=e.fn.autoGeocoder=function(a){a=e.extend(!0,{},h.defaults,a||{});var b=a.setup||h.base;for(property in b)for(var d=b[property],c=0,f=d.length;c<f;c++)d[c].call(this,a);return this.trigger("auto-geocoder.initialize")};h.base={initialize:[function(a){a.initial.center=new google.maps.LatLng(a.initial.center[0],a.initial.center[1]);this.on("auto-geocoder.initialize",function(){e(this).trigger("auto-geocoder.createMap").trigger("auto-geocoder.onKeyUp")})}],
+createMap:[function(a){this.on("auto-geocoder.createMap",function(){var b=e(this),d=e("<div>",{"class":a.className}),c=a.position;if("before"==c||"after"==c)b[c](d);else e(c).append(d);b.on("keyup.auto-geocoder",function(){b.trigger("auto-geocoder.onKeyUp")});this.map=new google.maps.Map(d[0],a.initial)})}],onKeyUp:[function(a){this.on("auto-geocoder.onKeyUp",function(){var b=this,d=e(b),c=e.trim(d.val()).replace(/\s+/g," ").toLowerCase(),f=this.timeout,g=this.previousAddress;f&&clearTimeout(f);g&&
+g==c||(""==c?d.trigger("auto-geocoder.onGeocodeResult",[[],""]):this.timeout=setTimeout(function(){b.previousAddress=c;j.geocode({address:c},function(a,b){d.trigger("auto-geocoder.onGeocodeResult",[a,b])})},a.delay))})}],onGeocodeResult:[function(a){this.on("auto-geocoder.onGeocodeResult",function(b,d,c){b=this.map;var f=this.marker=this.marker||new google.maps.Marker;if(c==google.maps.GeocoderStatus.OK){var g=d[0].geometry,h=g.location;"auto"==a.success.zoom?b.fitBounds(g.viewport):(b.setZoom(a.success.zoom),
+b.setCenter(h));f.setPosition(h);f.setMap(b);e(this).trigger("auto-geocoder.onGeocodeSuccess",[d,c])}else g=a.initial,f&&f.setMap(null),b.setZoom(g.zoom),b.setCenter(g.center),e(this).trigger("auto-geocoder.onGeocodeFailure",[d,c])})}],onGeocodeSuccess:[],onGeocodeFailure:[]};h.defaults={className:"jquery-auto-geocoder-map",position:"after",delay:500,success:{zoom:"auto"},initial:{zoom:1,center:[34,0],draggable:!1,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1}}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.