dist/assets/js/plugins/storeLocator/jquery.storelocator.js
function (position) {
			this.writeDebug('autoGeocodeQuery',arguments);
			var _this = this,
				distance = null,
				$distanceInput = $('#' + this.settings.maxDistanceID),
				originAddress;

			// Query string parameters
			if (this.settings.querystringParams === true) {
				// Check for distance query string parameters
				if (this.getQueryString(this.settings.maxDistanceID)){
					distance = this.getQueryString(this.settings.maxDistanceID);

					if ($distanceInput.val() !== '') {
						distance = $distanceInput.val();
					}
				}
				else{
					// Get the distance if set
					if (this.settings.maxDistance === true) {
						distance = $distanceInput.val() || '';
					}
				}
			}
			else {
				// Get the distance if set
				if (this.settings.maxDistance === true) {
					distance = $distanceInput.val() || '';
				}
			}

			// The address needs to be determined for the directions link
			var r = new this.reverseGoogleGeocode(this);
			var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
			r.geocode({'latLng': latlng}, function (data) {
				if (data !== null) {
					originAddress = addressInput = data.address;
					olat = mappingObj.lat = position.coords.latitude;
					olng = mappingObj.lng = position.coords.longitude;
					mappingObj.origin = originAddress;
					mappingObj.distance = distance;
					_this.mapping(mappingObj);

					// Fill in the search box.
					if (typeof originAddress !== 'undefined') {
						$('#' + _this.settings.addressID).val(originAddress);
					}
				} else {
					// Unable to geocode
					_this.notify(_this.settings.addressErrorAlert);
				}
			});
		}
function (position) {
			this.writeDebug('autoGeocodeQuery',arguments);
			var _this = this,
				distance = null,
				$distanceInput = $('#' + this.settings.maxDistanceID),
				originAddress;

			// Query string parameters
			if (this.settings.querystringParams === true) {
				// Check for distance query string parameters
				if (this.getQueryString(this.settings.maxDistanceID)){
					distance = this.getQueryString(this.settings.maxDistanceID);

					if ($distanceInput.val() !== '') {
						distance = $distanceInput.val();
					}
				}
				else{
					// Get the distance if set
					if (this.settings.maxDistance === true) {
						distance = $distanceInput.val() || '';
					}
				}
			}
			else {
				// Get the distance if set
				if (this.settings.maxDistance === true) {
					distance = $distanceInput.val() || '';
				}
			}

			// The address needs to be determined for the directions link
			var r = new this.reverseGoogleGeocode(this);
			var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
			r.geocode({'latLng': latlng}, function (data) {
				if (data !== null) {
					originAddress = addressInput = data.address;
					olat = mappingObj.lat = position.coords.latitude;
					olng = mappingObj.lng = position.coords.longitude;
					mappingObj.origin = originAddress;
					mappingObj.distance = distance;
					_this.mapping(mappingObj);

					// Fill in the search box.
					if (typeof originAddress !== 'undefined') {
						$('#' + _this.settings.addressID).val(originAddress);
					}
				} else {
					// Unable to geocode
					_this.notify(_this.settings.addressErrorAlert);
				}
			});
		}
function ( position ) { this . writeDebug ( 'autoGeocodeQuery' , arguments ) ; var _this = this , distance = null , $distanceInput = $ ( '#' + this . settings . maxDistanceID ) , originAddress ; // Query string parameters if ( this . settings . querystringParams === true ) { // Check for distance query string parameters if ( this . getQueryString ( this . settings . maxDistanceID ) ) { distance = this . getQueryString ( this . settings . maxDistanceID ) ; if ( $distanceInput . val ( ) !== '' ) { distance = $distanceInput . val ( ) ; } } else { // Get the distance if set if ( this . settings . maxDistance === true ) { distance = $distanceInput . val ( ) || '' ; } } } else { // Get the distance if set if ( this . settings . maxDistance === true ) { distance = $distanceInput . val ( ) || '' ; } } // The address needs to be determined for the directions link var r = new this . reverseGoogleGeocode ( this ) ; var latlng = new google . maps . LatLng ( position . coords . latitude , position . coords . longitude ) ; r . geocode ( { 'latLng' : latlng } , function ( data ) { if ( data !== null ) { originAddress = addressInput = data . address ; olat = mappingObj . lat = position . coords . latitude ; olng = mappingObj . lng = position . coords . longitude ; mappingObj . origin = originAddress ; mappingObj . distance = distance ; _this . mapping ( mappingObj ) ; // Fill in the search box. if ( typeof originAddress !== 'undefined' ) { $ ( '#' + _this . settings . addressID ) . val ( originAddress ) ; } } else { // Unable to geocode _this . notify ( _this . settings . addressErrorAlert ) ; } } ) ; }
HTML5 geocoding function for automatic location detection

@param position {Object} coordinates
HTML5 geocoding function for automatic location detection