dist/assets/js/plugins/storeLocator/jquery.storelocator.js
function (lat, lng, address, geocodeData, map) {
			this.writeDebug('_getData',arguments);
			var _this = this,
				northEast = '',
				southWest = '',
				formattedAddress = '';

			// Define extra geocode result info
			if (typeof geocodeData !== 'undefined' && typeof geocodeData.geometry.bounds !== 'undefined') {
				formattedAddress = geocodeData.formatted_address;
				northEast = JSON.stringify( geocodeData.geometry.bounds.getNorthEast() );
				southWest = JSON.stringify( geocodeData.geometry.bounds.getSouthWest() );
			}

			// Before send callback
			if (this.settings.callbackBeforeSend) {
				this.settings.callbackBeforeSend.call(this, lat, lng, address, formattedAddress, northEast, southWest, map);
			}

			// Raw data
			if(_this.settings.dataRaw !== null) {
				// XML
				if( dataTypeRead === 'xml' ) {
					return $.parseXML(_this.settings.dataRaw);
				}

				// JSON
				else if (dataTypeRead === 'json') {
					if (Array.isArray && Array.isArray(_this.settings.dataRaw)) {
						return _this.settings.dataRaw;
					}
					else if (typeof _this.settings.dataRaw === 'string') {
						return JSON.parse(_this.settings.dataRaw);
					}
					else {
						return [];
					}

				}
			}
			// Remote data
			else {
				var d = $.Deferred();

				// Loading
				if (this.settings.loading === true) {
					$('.' + this.settings.formContainer).append('<div class="' + this.settings.loadingContainer +'"></div>');
				}

				// Data to pass with the AJAX request
				var ajaxData = {
					'origLat' : lat,
					'origLng' : lng,
					'origAddress': address,
					'formattedAddress': formattedAddress,
					'boundsNorthEast' : northEast,
					'boundsSouthWest' : southWest
				};

				// Set up extra object for custom extra data to be passed with the AJAX request
				if (this.settings.ajaxData !== null && typeof this.settings.ajaxData === 'object') {
					$.extend(ajaxData, this.settings.ajaxData);
				}

				// AJAX request
				$.ajax({
					type         : 'GET',
					url          : this.settings.dataLocation + (this.settings.dataType === 'jsonp' ? (this.settings.dataLocation.match(/\?/) ? '&' : '?') + 'callback=?' : ''),
					// Passing the lat, lng, address, formatted address and bounds with the AJAX request so they can optionally be used by back-end languages
					data         : ajaxData,
					dataType     : dataTypeRead,
					jsonpCallback: (this.settings.dataType === 'jsonp' ? this.settings.callbackJsonp : null)
				}).done(function(p) {
					d.resolve(p);

					// Loading remove
					if (_this.settings.loading === true) {
						$('.' + _this.settings.formContainer + ' .' + _this.settings.loadingContainer).remove();
					}
				}).fail(d.reject);
				return d.promise();
			}
		}
function (lat, lng, address, geocodeData, map) {
			this.writeDebug('_getData',arguments);
			var _this = this,
				northEast = '',
				southWest = '',
				formattedAddress = '';

			// Define extra geocode result info
			if (typeof geocodeData !== 'undefined' && typeof geocodeData.geometry.bounds !== 'undefined') {
				formattedAddress = geocodeData.formatted_address;
				northEast = JSON.stringify( geocodeData.geometry.bounds.getNorthEast() );
				southWest = JSON.stringify( geocodeData.geometry.bounds.getSouthWest() );
			}

			// Before send callback
			if (this.settings.callbackBeforeSend) {
				this.settings.callbackBeforeSend.call(this, lat, lng, address, formattedAddress, northEast, southWest, map);
			}

			// Raw data
			if(_this.settings.dataRaw !== null) {
				// XML
				if( dataTypeRead === 'xml' ) {
					return $.parseXML(_this.settings.dataRaw);
				}

				// JSON
				else if (dataTypeRead === 'json') {
					if (Array.isArray && Array.isArray(_this.settings.dataRaw)) {
						return _this.settings.dataRaw;
					}
					else if (typeof _this.settings.dataRaw === 'string') {
						return JSON.parse(_this.settings.dataRaw);
					}
					else {
						return [];
					}

				}
			}
			// Remote data
			else {
				var d = $.Deferred();

				// Loading
				if (this.settings.loading === true) {
					$('.' + this.settings.formContainer).append('<div class="' + this.settings.loadingContainer +'"></div>');
				}

				// Data to pass with the AJAX request
				var ajaxData = {
					'origLat' : lat,
					'origLng' : lng,
					'origAddress': address,
					'formattedAddress': formattedAddress,
					'boundsNorthEast' : northEast,
					'boundsSouthWest' : southWest
				};

				// Set up extra object for custom extra data to be passed with the AJAX request
				if (this.settings.ajaxData !== null && typeof this.settings.ajaxData === 'object') {
					$.extend(ajaxData, this.settings.ajaxData);
				}

				// AJAX request
				$.ajax({
					type         : 'GET',
					url          : this.settings.dataLocation + (this.settings.dataType === 'jsonp' ? (this.settings.dataLocation.match(/\?/) ? '&' : '?') + 'callback=?' : ''),
					// Passing the lat, lng, address, formatted address and bounds with the AJAX request so they can optionally be used by back-end languages
					data         : ajaxData,
					dataType     : dataTypeRead,
					jsonpCallback: (this.settings.dataType === 'jsonp' ? this.settings.callbackJsonp : null)
				}).done(function(p) {
					d.resolve(p);

					// Loading remove
					if (_this.settings.loading === true) {
						$('.' + _this.settings.formContainer + ' .' + _this.settings.loadingContainer).remove();
					}
				}).fail(d.reject);
				return d.promise();
			}
		}
function ( lat , lng , address , geocodeData , map ) { this . writeDebug ( '_getData' , arguments ) ; var _this = this , northEast = '' , southWest = '' , formattedAddress = '' ; // Define extra geocode result info if ( typeof geocodeData !== 'undefined' && typeof geocodeData . geometry . bounds !== 'undefined' ) { formattedAddress = geocodeData . formatted_address ; northEast = JSON . stringify ( geocodeData . geometry . bounds . getNorthEast ( ) ) ; southWest = JSON . stringify ( geocodeData . geometry . bounds . getSouthWest ( ) ) ; } // Before send callback if ( this . settings . callbackBeforeSend ) { this . settings . callbackBeforeSend . call ( this , lat , lng , address , formattedAddress , northEast , southWest , map ) ; } // Raw data if ( _this . settings . dataRaw !== null ) { // XML if ( dataTypeRead === 'xml' ) { return $ . parseXML ( _this . settings . dataRaw ) ; } // JSON else if ( dataTypeRead === 'json' ) { if ( Array . isArray && Array . isArray ( _this . settings . dataRaw ) ) { return _this . settings . dataRaw ; } else if ( typeof _this . settings . dataRaw === 'string' ) { return JSON . parse ( _this . settings . dataRaw ) ; } else { return [ ] ; } } } // Remote data else { var d = $ . Deferred ( ) ; // Loading if ( this . settings . loading === true ) { $ ( '.' + this . settings . formContainer ) . append ( '<div class="' + this . settings . loadingContainer + '"></div>' ) ; } // Data to pass with the AJAX request var ajaxData = { 'origLat' : lat , 'origLng' : lng , 'origAddress' : address , 'formattedAddress' : formattedAddress , 'boundsNorthEast' : northEast , 'boundsSouthWest' : southWest } ; // Set up extra object for custom extra data to be passed with the AJAX request if ( this . settings . ajaxData !== null && typeof this . settings . ajaxData === 'object' ) { $ . extend ( ajaxData , this . settings . ajaxData ) ; } // AJAX request $ . ajax ( { type : 'GET' , url : this . settings . dataLocation + ( this . settings . dataType === 'jsonp' ? ( this . settings . dataLocation . match ( / \? / ) ? '&' : '?' ) + 'callback=?' : '' ) , // Passing the lat, lng, address, formatted address and bounds with the AJAX request so they can optionally be used by back-end languages data : ajaxData , dataType : dataTypeRead , jsonpCallback : ( this . settings . dataType === 'jsonp' ? this . settings . callbackJsonp : null ) } ) . done ( function ( p ) { d . resolve ( p ) ; // Loading remove if ( _this . settings . loading === true ) { $ ( '.' + _this . settings . formContainer + ' .' + _this . settings . loadingContainer ) . remove ( ) ; } } ) . fail ( d . reject ) ; return d . promise ( ) ; } }
AJAX data request - private

@param lat {number} latitude
@param lng {number} longitude
@param address {string} street address
@param geocodeData {object} full Google geocode results object
@param map (object} Google Maps object.

@returns {Object} deferred object
AJAX data request - private