From 7cbe6466c1384c8d0adeb39772323282e34bdda3 Mon Sep 17 00:00:00 2001 From: Bjorn Date: Sun, 21 Aug 2022 19:11:04 -0700 Subject: [PATCH] Add writedebug to new functions, update version number --- bower.json | 2 +- dist/assets/js/plugins/storeLocator/jquery.storelocator.js | 4 +++- .../assets/js/plugins/storeLocator/jquery.storelocator.min.js | 4 ++-- package.json | 2 +- src/js/jquery.storelocator.js | 2 ++ storelocator.jquery.json | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index a25ea51..7481c7f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-storelocator-plugin", - "version": "3.1.7", + "version": "3.1.8", "description": "This jQuery plugin takes advantage of Google Maps API version 3 to create an easy to implement store locator. No back-end programming is required, you just need to feed it KML, XML, or JSON data with all the location information.", "repository": { "type": "git", diff --git a/dist/assets/js/plugins/storeLocator/jquery.storelocator.js b/dist/assets/js/plugins/storeLocator/jquery.storelocator.js index 6f27cbb..9e13ff1 100644 --- a/dist/assets/js/plugins/storeLocator/jquery.storelocator.js +++ b/dist/assets/js/plugins/storeLocator/jquery.storelocator.js @@ -1,4 +1,4 @@ -/*! jQuery Google Maps Store Locator - v3.1.7 - 2022-08-20 +/*! jQuery Google Maps Store Locator - v3.1.8 - 2022-08-21 * http://www.bjornblog.com/web/jquery-store-locator-plugin * Copyright (c) 2022 Bjorn Holine; Licensed MIT */ @@ -401,6 +401,7 @@ * @returns {boolean} */ inRange(min, num, max){ + this.writeDebug('inRange',arguments); num = Math.abs(num); return isFinite(num) && (num >= min) && (num <= max); }, @@ -414,6 +415,7 @@ * @returns {boolean} */ coordinatesInRange: function (lat, lng) { + this.writeDebug('coordinatesInRange',arguments); return this.inRange(-90, lat, 90) && this.inRange(-180, lng, 180); }, diff --git a/dist/assets/js/plugins/storeLocator/jquery.storelocator.min.js b/dist/assets/js/plugins/storeLocator/jquery.storelocator.min.js index d5d402a..b42cf21 100644 --- a/dist/assets/js/plugins/storeLocator/jquery.storelocator.min.js +++ b/dist/assets/js/plugins/storeLocator/jquery.storelocator.min.js @@ -1,5 +1,5 @@ -/*! jQuery Google Maps Store Locator - v3.1.7 - 2022-08-20 +/*! jQuery Google Maps Store Locator - v3.1.8 - 2022-08-21 * http://www.bjornblog.com/web/jquery-store-locator-plugin * Copyright (c) 2022 Bjorn Holine; Licensed MIT */ -!function(B,G,E,t){"use strict";var _,a,r,c,N,j,z,Q,q,l,g,h,U,i,n,s,o,V,H,K,W,J,Z,$,u,d,p,m,X="storeLocator";function f(t,e){_=B(t),this.element=t,this.settings=B.extend({},m,e),this._defaults=m,this._name=X,this.init()}void 0===B.fn[X]&&"undefined"!=typeof google&&(m={ajaxData:null,altDistanceNoResult:!(p={}),autoComplete:!(d={}),autoCompleteDisableListener:!(u={}),autoCompleteOptions:{},autoGeocode:!($={}),bounceMarker:!0,catMarkers:null,dataLocation:"data/locations.json",dataRaw:null,dataType:"json",debug:!(Z=[]),defaultLat:null,defaultLng:null,defaultLoc:!(J=[]),disableAlphaMarkers:!(W=[]),distanceAlert:60,dragSearch:!(K=[]),exclusiveFiltering:!1,exclusiveTax:null,featuredDistance:null,featuredLocations:!1,fullMapStart:!1,fullMapStartBlank:!1,fullMapStartListLimit:!1,infoBubble:null,inlineDirections:!1,lengthUnit:"m",listColor1:"#ffffff",listColor2:"#eeeeee",loading:!1,locationsPerPage:10,mapSettings:{mapTypeId:google.maps.MapTypeId.ROADMAP,zoom:12},markerCluster:null,markerImg:null,markerDim:null,maxDistance:!1,modal:!1,nameAttribute:"name",nameSearch:!1,noForm:!1,openNearest:!1,originMarker:!1,originMarkerDim:null,originMarkerImg:null,pagination:!1,querystringParams:!1,selectedMarkerImg:null,selectedMarkerImgDim:null,sessionStorage:!1,slideMap:!0,sortBy:null,storeLimit:26,taxonomyFilters:null,visibleMarkersList:!1,xmlElement:"marker",addressID:"bh-sl-address",closeIcon:"bh-sl-close-icon",formContainer:"bh-sl-form-container",formID:"bh-sl-user-location",geocodeID:null,lengthSwapID:"bh-sl-length-swap",loadingContainer:"bh-sl-loading",locationList:"bh-sl-loc-list",mapID:"bh-sl-map",maxDistanceID:"bh-sl-maxdistance",modalContent:"bh-sl-modal-content",modalWindow:"bh-sl-modal-window",orderID:"bh-sl-order",overlay:"bh-sl-overlay",regionID:"bh-sl-region",searchID:"bh-sl-search",sortID:"bh-sl-sort",taxonomyFiltersContainer:"bh-sl-filters-container",infowindowTemplatePath:"assets/js/plugins/storeLocator/templates/infowindow-description.html",listTemplatePath:"assets/js/plugins/storeLocator/templates/location-list-description.html",KMLinfowindowTemplatePath:"assets/js/plugins/storeLocator/templates/kml-infowindow-description.html",KMLlistTemplatePath:"assets/js/plugins/storeLocator/templates/kml-location-list-description.html",listTemplateID:null,infowindowTemplateID:null,callbackAutoGeoSuccess:null,callbackBeforeSend:null,callbackCloseDirections:null,callbackCreateMarker:null,callbackDirectionsRequest:null,callbackFilters:null,callbackFormVals:null,callbackGeocodeRestrictions:null,callbackJsonp:null,callbackListClick:null,callbackMapSet:null,callbackMarkerClick:null,callbackModalClose:null,callbackModalOpen:null,callbackModalReady:null,callbackNearestLoc:null,callbackNoResults:null,callbackNotify:null,callbackOrder:null,callbackPageChange:null,callbackRegion:null,callbackSorting:null,callbackSuccess:null,addressErrorAlert:"Unable to find address",autoGeocodeErrorAlert:"Automatic location detection failed. Please fill in your address or zip code.",distanceErrorAlert:"Unfortunately, our closest location is more than ",kilometerLang:"kilometer",kilometersLang:"kilometers",mileLang:"mile",milesLang:"miles",noResultsTitle:"No results",noResultsDesc:"No locations were found with the given criteria. Please modify your selections or input.",nextPage:"Next »",prevPage:"« Prev"},B.extend(f.prototype,{init:function(){var t,e=this;this.writeDebug("init"),"km"===this.settings.lengthUnit?d.EarthRadius=6367:d.EarthRadius=3956,c="kml"===this.settings.dataType?"xml":this.settings.dataType,!0===this.settings.inlineDirections&&B("."+this.settings.locationList).prepend('
'),z=this.settings.mapSettings.zoom,Handlebars.registerHelper("niceURL",function(t){if(t)return t.replace("https://","").replace("http://","")}),null!==this.settings.taxonomyFilters&&this.taxonomyFiltering(),this.sorting(),this.order(),!0===this.settings.modal&&(null!==this.settings.taxonomyFilters&&B("."+this.settings.taxonomyFiltersContainer).clone(!0,!0).prependTo(_),_.wrap('
'),B("."+this.settings.modalWindow).prepend('
'),B("."+this.settings.overlay).hide()),!0===this.settings.autoComplete&&(t=E.getElementById(this.settings.addressID),t=new google.maps.places.Autocomplete(t,this.settings.autoCompleteOptions),!0===this.settings.autoComplete&&!0!==this.settings.autoCompleteDisableListener&&t.addListener("place_changed",function(t){e.processForm(t)})),this._loadTemplates()},destroy:function(){this.writeDebug("destroy"),this.reset();var t=B("#"+this.settings.mapID);if(Z.length)for(var e=0;e<=Z.length;e++)google.maps.event.removeListener(Z[e]);B("."+this.settings.locationList+" ul").empty(),t.hasClass("bh-sl-map-open")&&t.empty().removeClass("bh-sl-map-open"),!0===this.settings.modal&&B(". "+this.settings.overlay).remove(),t.attr("style",""),_.hide(),B.removeData(_.get(0)),B(E).off(X),_.unbind()},reset:function(){var t;this.writeDebug("reset"),W=[],K=[],J=[],V=!(Z=[]),B(E).off("click."+X,"."+this.settings.locationList+" li"),B("."+this.settings.locationList+" .bh-sl-close-directions-container").length&&B(".bh-sl-close-directions-container").remove(),!0===this.settings.inlineDirections&&(0<(t=B("."+this.settings.locationList+" .adp")).length&&(t.remove(),B("."+this.settings.locationList+" ul").fadeIn()),B(E).off("click","."+this.settings.locationList+" li .loc-directions a")),!0===this.settings.pagination&&B(E).off("click."+X,".bh-sl-pagination li")},formFiltersReset:function(){var t,e;this.writeDebug("formFiltersReset"),null!==this.settings.taxonomyFilters&&(t=B("."+this.settings.taxonomyFiltersContainer+" input"),e=B("."+this.settings.taxonomyFiltersContainer+" select"),"object"==typeof t&&(t.each(function(){(B(this).is('input[type="checkbox"]')||B(this).is('input[type="radio"]'))&&B(this).prop("checked",!1)}),e.each(function(){B(this).prop("selectedIndex",0)})))},mapReload:function(){this.writeDebug("mapReload"),this.reset(),H=!0,null!==this.settings.taxonomyFilters&&(this.formFiltersReset(),this.taxonomyFiltersInit()),g&&h?(this.settings.mapSettings.zoom=z,this.processForm()):this.mapping(p)},notify:function(t){this.writeDebug("notify",t),this.settings.callbackNotify?this.settings.callbackNotify.call(this,t):alert(t)},geoCodeCalcToRadian:function(t){return this.writeDebug("geoCodeCalcToRadian",t),t*(Math.PI/180)},geoCodeCalcDiffRadian:function(t,e){return this.writeDebug("geoCodeCalcDiffRadian",arguments),this.geoCodeCalcToRadian(e)-this.geoCodeCalcToRadian(t)},geoCodeCalcCalcDistance:function(t,e,s,i,n){return this.writeDebug("geoCodeCalcCalcDistance",arguments),2*n*Math.asin(Math.min(1,Math.sqrt(Math.pow(Math.sin(this.geoCodeCalcDiffRadian(t,s)/2),2)+Math.cos(this.geoCodeCalcToRadian(t))*Math.cos(this.geoCodeCalcToRadian(s))*Math.pow(Math.sin(this.geoCodeCalcDiffRadian(e,i)/2),2))))},inRange:function(t,e,s){return e=Math.abs(e),isFinite(e)&&t<=e&&e<=s},coordinatesInRange:function(t,e){return this.inRange(-90,t,90)&&this.inRange(-180,e,180)},getQueryString:function(t){if(this.writeDebug("getQueryString",t),t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");t=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},getMap:function(){return this.map},_loadTemplates:function(){var e;this.writeDebug("_loadTemplates");var t=this,s='
Error: Could not load plugin templates. Check the paths and ensure they have been uploaded. Paths will be wrong if you do not run this from a web server.
';"kml"===this.settings.dataType&&null===this.settings.listTemplateID&&null===this.settings.infowindowTemplateID?B.when(B.get(this.settings.KMLinfowindowTemplatePath,function(t){e=t,r=Handlebars.compile(e)}),B.get(this.settings.KMLlistTemplatePath,function(t){e=t,a=Handlebars.compile(e)})).then(function(){t.locator()},function(){throw B("."+t.settings.formContainer).append(s),new Error("Could not load storeLocator plugin templates")}):null!==this.settings.listTemplateID&&null!==this.settings.infowindowTemplateID?(r=Handlebars.compile(B("#"+this.settings.infowindowTemplateID).html()),a=Handlebars.compile(B("#"+this.settings.listTemplateID).html()),t.locator()):B.when(B.get(this.settings.infowindowTemplatePath,function(t){e=t,r=Handlebars.compile(e)}),B.get(this.settings.listTemplatePath,function(t){e=t,a=Handlebars.compile(e)})).then(function(){t.locator()},function(){throw B("."+t.settings.formContainer).append(s),new Error("Could not load storeLocator plugin templates")})},locator:function(){this.writeDebug("locator"),!0===this.settings.slideMap&&_.hide(),this._start(),this._formEventHandler()},_formEventHandler:function(){this.writeDebug("_formEventHandler");var e=this;!0===this.settings.noForm?(B(E).on("click."+X,"."+this.settings.formContainer+" button",function(t){e.processForm(t)}),B(E).on("keydown."+X,function(t){13===t.keyCode&&B("#"+e.settings.addressID).is(":focus")&&e.processForm(t)})):B(E).on("submit."+X,"#"+this.settings.formID,function(t){e.processForm(t)}),B(".bh-sl-reset").length&&B("#"+this.settings.mapID).length&&B(E).on("click."+X,".bh-sl-reset",function(){e.mapReload()})},_getData:function(t,e,s,i,n){this.writeDebug("_getData",arguments);var a=this,o="",r="",l="";if(void 0!==i&&void 0!==i.geometry.bounds&&(l=i.formatted_address,o=JSON.stringify(i.geometry.bounds.getNorthEast()),r=JSON.stringify(i.geometry.bounds.getSouthWest())),this.settings.callbackBeforeSend&&this.settings.callbackBeforeSend.call(this,t,e,s,l,o,r,n),null!==a.settings.dataRaw)return"xml"===c?B.parseXML(a.settings.dataRaw):"json"===c?Array.isArray&&Array.isArray(a.settings.dataRaw)?a.settings.dataRaw:"string"==typeof a.settings.dataRaw?JSON.parse(a.settings.dataRaw):[]:void 0;var g=B.Deferred();!0===this.settings.loading&&B("."+this.settings.formContainer).append('
');r={origLat:t,origLng:e,origAddress:s,formattedAddress:l,boundsNorthEast:o,boundsSouthWest:r};return null!==this.settings.ajaxData&&"object"==typeof this.settings.ajaxData&&B.extend(r,this.settings.ajaxData),B.ajax({type:"GET",url:this.settings.dataLocation+("jsonp"===this.settings.dataType?(this.settings.dataLocation.match(/\?/)?"&":"?")+"callback=?":""),data:r,dataType:c,jsonpCallback:"jsonp"===this.settings.dataType?this.settings.callbackJsonp:null}).done(function(t){g.resolve(t),!0===a.settings.loading&&B("."+a.settings.formContainer+" ."+a.settings.loadingContainer).remove()}).fail(g.reject),g.promise()},_start:function(){this.writeDebug("_start");var t,e,s=this,i=this.settings.autoGeocode;!1!==s.settings.fullMapStartBlank?(B("#"+s.settings.mapID).addClass("bh-sl-map-open"),(e=s.settings.mapSettings).zoom=s.settings.fullMapStartBlank,t=new google.maps.LatLng(this.settings.defaultLat,this.settings.defaultLng),e.center=t,s.map=new google.maps.Map(E.getElementById(s.settings.mapID),e),google.maps.event.addDomListener(G,"resize",function(){var t=s.map.getCenter();google.maps.event.trigger(s.map,"resize"),s.map.setCenter(t)}),s.settings.fullMapStartBlank=!1,e.zoom=z):(!0===this.settings.defaultLoc&&this.defaultLocation(),""!==B.trim(B("#"+this.settings.addressID).val())?(s.writeDebug("Using Address Field"),s.processForm(null),i=!1):!0===this.settings.fullMapStart&&!1===this.settings.defaultLoc&&(!0===this.settings.querystringParams&&this.getQueryString(this.settings.addressID)||!0===this.settings.querystringParams&&this.getQueryString(this.settings.searchID)||!0===this.settings.querystringParams&&this.getQueryString(this.settings.maxDistanceID)?(s.writeDebug("Using Query String"),this.processForm(null),i=!1):this.mapping(null))),!0===this.settings.autoGeocode&&!0===i&&(s.writeDebug("Auto Geo"),s.htmlGeocode()),null!==this.settings.autoGeocode&&(s.writeDebug("Button Geo"),B(E).on("click."+X,"#"+this.settings.geocodeID,function(){s.htmlGeocode()}))},htmlGeocode:function(){this.writeDebug("htmlGeocode",arguments);var e=this;if(!0===e.settings.sessionStorage&&G.sessionStorage&&G.sessionStorage.getItem("myGeo"))return e.writeDebug("Using Session Saved Values for GEO"),e.autoGeocodeQuery(JSON.parse(G.sessionStorage.getItem("myGeo"))),!1;navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){e.writeDebug("Current Position Result");t={coords:{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy}};!0===e.settings.sessionStorage&&G.sessionStorage&&G.sessionStorage.setItem("myGeo",JSON.stringify(t)),e.settings.callbackAutoGeoSuccess&&e.settings.callbackAutoGeoSuccess.call(this,t),e.autoGeocodeQuery(t)},function(t){e._autoGeocodeError(t)})},googleGeocode:function(t){t.writeDebug("googleGeocode",arguments);var e=new google.maps.Geocoder;this.geocode=function(t,s){e.geocode(t,function(t,e){if(e!==google.maps.GeocoderStatus.OK)throw s(null),new Error("Geocode was not successful for the following reason: "+e);e={};e.latitude=t[0].geometry.location.lat(),e.longitude=t[0].geometry.location.lng(),e.geocodeResult=t[0],s(e)})}},reverseGoogleGeocode:function(t){t.writeDebug("reverseGoogleGeocode",arguments);var e=new google.maps.Geocoder;this.geocode=function(t,s){e.geocode(t,function(t,e){if(e!==google.maps.GeocoderStatus.OK)throw s(null),new Error("Reverse geocode was not successful for the following reason: "+e);t[0]&&((e={}).address=t[0].formatted_address,e.fullResult=t[0],s(e))})}},roundNumber:function(t,e){return this.writeDebug("roundNumber",arguments),Math.round(t*Math.pow(10,e))/Math.pow(10,e)},isEmptyObject:function(t){for(var e in this.writeDebug("isEmptyObject",arguments),t)if(t.hasOwnProperty(e))return!1;return!0},hasEmptyObjectVals:function(t){this.writeDebug("hasEmptyObjectVals",arguments);var e,s=!0;for(e in t)t.hasOwnProperty(e)&&""!==t[e]&&0!==t[e].length&&(s=!1);return s},modalClose:function(){this.writeDebug("modalClose"),this.settings.callbackModalClose&&this.settings.callbackModalClose.call(this),$={},B("."+this.settings.overlay+" select").prop("selectedIndex",0),B("."+this.settings.overlay+" input").prop("checked",!1),B("."+this.settings.overlay).hide()},_createLocationVariables:function(t){var e,s;for(s in this.writeDebug("_createLocationVariables",arguments),u={},W[t])W[t].hasOwnProperty(s)&&(e=W[t][s],"distance"!==s&&"altdistance"!==s||(e=this.roundNumber(e,2)),u[s]=e)},sortAlpha:function(t){this.writeDebug("sortAlpha",arguments);var s=this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"name";this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return e[s].toLowerCase().localeCompare(t[s].toLowerCase())}):t.sort(function(t,e){return t[s].toLowerCase().localeCompare(e[s].toLowerCase())})},sortDate:function(t){this.writeDebug("sortDate",arguments);var s=this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"date";this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return new Date(e[s]).getTime()-new Date(t[s]).getTime()}):t.sort(function(t,e){return new Date(t[s]).getTime()-new Date(e[s]).getTime()})},sortNumerically:function(t,e){this.writeDebug("sortNumerically",arguments);var s=null!==this.settings.sortBy&&this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"distance";void 0!==e&&!0===e&&(s="distance"),null!==this.settings.sortBy&&this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return e[s]t[s]?1:0}):t.sort(function(t,e){return t[s]e[s]?1:0})},sortCustom:function(t){this.writeDebug("sortCustom",arguments),this.settings.sortBy.hasOwnProperty("method")&&"alpha"===this.settings.sortBy.method.toString()?this.sortAlpha(t):this.settings.sortBy.hasOwnProperty("method")&&"date"===this.settings.sortBy.method.toString()?this.sortDate(t):this.sortNumerically(t)},filterMatching:function(t,e,s){return this.writeDebug("inclusiveFilter",arguments),void 0!==e&&(t=!0===(s=void 0===s||s)?t.join(""):t.join("|"),!!new RegExp(t,"i").test(e.replace(/([.*+?^=!:${}()|\[\]\/\\]|&\s+)/g,"")))},filterData:function(t,e){this.writeDebug("filterData",arguments);var s,i=!0;for(s in e)if(e.hasOwnProperty(s)){for(var n=[],a=0;a'+this.settings.prevPage+"");for(var n=0;n'+a+"":'
  • '+a+"
  • "}return i'+this.settings.nextPage+""),s},paginationSetup:function(t){this.writeDebug("paginationSetup",arguments);var e="",s=B(".bh-sl-pagination-container .bh-sl-pagination"),i=-1===this.settings.storeLimit||W.length ul").append(s)},changeSelectedMarker:function(t){var e;void 0!==o&&o.setIcon(s),e=null===this.settings.selectedMarkerImgDim?this.markerImage(this.settings.selectedMarkerImg):this.markerImage(this.settings.selectedMarkerImg,this.settings.selectedMarkerImgDim.width,this.settings.selectedMarkerImgDim.height),s=t.icon,t.setIcon(e),o=t},createInfowindow:function(s,t,i,e,n){this.writeDebug("createInfowindow",arguments);var a=this,n=this._defineLocationData(s,e,n),o=r(n);"left"===t?(i.setContent(o),i.open(s.get("map"),s)):google.maps.event.addListener(s,"click",function(){i.setContent(o),i.open(s.get("map"),s);var t=s.get("id"),e=B("."+a.settings.locationList+" li[data-markerid="+t+"]");0
    ')),B(E).off("click","."+this.settings.locationList+" li .loc-directions a")},closeDirections:function(){this.writeDebug("closeDirections"),this.settings.callbackCloseDirections&&this.settings.callbackCloseDirections.call(this),this.reset(),g&&h&&(0===this.countFilters()?this.settings.mapSettings.zoom=z:this.settings.mapSettings.zoom=0,this.processForm(null)),B(E).off("click."+X,"."+this.settings.locationList+" .bh-sl-close-icon")},lengthUnitSwap:function(t){this.writeDebug("lengthUnitSwap",arguments),"alt-distance"===t.val()?(B("."+this.settings.locationList+" .loc-alt-dist").show(),B("."+this.settings.locationList+" .loc-default-dist").hide()):"default-distance"===t.val()&&(B("."+this.settings.locationList+" .loc-default-dist").show(),B("."+this.settings.locationList+" .loc-alt-dist").hide())},processForm:function(t){this.writeDebug("processForm",arguments);var e=this,s=null,i={},n=B("#"+this.settings.addressID),a=B("#"+this.settings.searchID),o=B("#"+this.settings.maxDistanceID),r="";null!=t&&t.preventDefault(),B("."+e.settings.formContainer+" input, ."+e.settings.formContainer+" select").blur(),!0===this.settings.querystringParams&&(this.getQueryString(this.settings.addressID)||this.getQueryString(this.settings.searchID)||this.getQueryString(this.settings.maxDistanceID))?(l=this.getQueryString(this.settings.addressID),q=this.getQueryString(this.settings.searchID),s=this.getQueryString(this.settings.maxDistanceID),""!==n.val()&&(l=n.val()),""!==a.val()&&(q=a.val()),""!==o.val()&&(s=o.val())):(l=n.val()||"",q=a.val()||"",!0===this.settings.maxDistance&&(s=o.val()||"")),r=this.settings.callbackRegion?this.settings.callbackRegion.call(this,l,q,s):B("#"+this.settings.regionID).val(),this.settings.callbackFormVals&&this.settings.callbackFormVals.call(this,l,q,s,r),void 0!==r&&(i={country:r}),"function"==typeof this.settings.callbackGeocodeRestrictions&&(i=this.settings.callbackGeocodeRestrictions.call(this,l,q,s)),""===l&&""===q&&!0!==this.settings.autoGeocode?this._start():""!==l?(""===q&&$.hasOwnProperty("name")&&delete $.name,void 0!==N&&void 0!==g&&void 0!==h&&l===N?(p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,e.mapping(p)):new this.googleGeocode(this).geocode({address:l,componentRestrictions:i,region:r},function(t){null!==t?(g=t.latitude,h=t.longitude,p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,p.geocodeResult=t.geocodeResult,e.mapping(p)):e.notify(e.settings.addressErrorAlert)})):""!==q?(""===l&&delete p.origin,p.name=q,e.mapping(p)):!0===this.settings.autoGeocode&&(p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,e.mapping(p))},locationsSetup:function(t,e,s,i,n){this.writeDebug("locationsSetup",arguments),void 0!==i&&(t.distance||(t.distance=this.geoCodeCalcCalcDistance(e,s,t.lat,t.lng,d.EarthRadius),"m"===this.settings.lengthUnit?t.altdistance=1.609344*parseFloat(t.distance):"km"===this.settings.lengthUnit&&(t.altdistance=parseFloat(t.distance)/1.609344))),this.coordinatesInRange(t.lat,t.lng)?!0===this.settings.maxDistance&&null!=n?t.distance<=n?W.push(t):this.writeDebug("locationsSetup","location ignored because it is out of maxDistance: "+n,t):!0!==this.settings.maxDistance||!0!==this.settings.querystringParams||null==n||t.distance<=n?W.push(t):this.writeDebug("locationsSetup","location ignored because it is out of maxDistance: "+n,t):this.writeDebug("locationsSetup","location ignored because coordinates out of range: "+n,t)},sorting:function(){this.writeDebug("sorting",arguments);var s=this,i=B("#"+s.settings.mapID),t=B("#"+s.settings.sortID);0!==t.length&&t.on("change."+X,function(t){var e;t.stopPropagation(),!0===s.settings.pagination&&s.paginationChange(0),e=void 0!==B(this).find(":selected").attr("data-method")?B(this).find(":selected").attr("data-method"):"distance",t=B(this).val(),s.settings.sortBy.method=e,s.settings.sortBy.prop=t,s.settings.callbackSorting&&s.settings.callbackSorting.call(this,s.settings.sortBy),i.hasClass("bh-sl-map-open")&&s.mapping(p)})},order:function(){this.writeDebug("order",arguments);var e=this,s=B("#"+e.settings.mapID),t=B("#"+e.settings.orderID);0!==t.length&&t.on("change."+X,function(t){t.stopPropagation(),!0===e.settings.pagination&&e.paginationChange(0),e.settings.sortBy.order=B(this).val(),e.settings.callbackOrder&&e.settings.callbackOrder.call(this,e.settings.order),s.hasClass("bh-sl-map-open")&&e.mapping(p)})},countFilters:function(){this.writeDebug("countFilters");var t=0;if(!this.isEmptyObject($))for(var e in $)$.hasOwnProperty(e)&&(t+=$[e].length);return t},_existingCheckedFilters:function(e){this.writeDebug("_existingCheckedFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" input[type=checkbox]").each(function(){var t;!B(this).prop("checked")||void 0!==(t=B(this).val())&&""!==t&&-1===$[e].indexOf(t)&&$[e].push(t)})},_existingSelectedFilters:function(e){this.writeDebug("_existingSelectedFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" select").each(function(){var t=B(this).val();void 0!==t&&""!==t&&-1===$[e].indexOf(t)&&($[e]=[t])})},_existingRadioFilters:function(e){this.writeDebug("_existingRadioFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" input[type=radio]").each(function(){var t;!B(this).prop("checked")||void 0!==(t=B(this).val())&&""!==t&&-1===$[e].indexOf(t)&&($[e]=[t])})},checkFilters:function(){for(var t in this.writeDebug("checkFilters"),this.settings.taxonomyFilters)this.settings.taxonomyFilters.hasOwnProperty(t)&&(this._existingCheckedFilters(t),this._existingSelectedFilters(t),this._existingRadioFilters(t))},selectQueryStringFilters:function(t,e){this.writeDebug("selectQueryStringFilters",arguments);var s=B("#"+this.settings.taxonomyFilters[t]);if(s.find('input[type="checkbox"]').length)for(var i=0;i ul").append(i))}),B("."+this.settings.locationList+" ul li:even").css("background",this.settings.listColor1),B("."+this.settings.locationList+" ul li:odd").css("background",this.settings.listColor2)},dragSearch:function(t){this.writeDebug("dragSearch",arguments);var e=t.getCenter(),s=this;this.settings.mapSettings.zoom=t.getZoom(),g=p.lat=e.lat(),h=p.lng=e.lng();t=new this.reverseGoogleGeocode(this),e=new google.maps.LatLng(p.lat,p.lng);t.geocode({latLng:e},function(t){null!==t?(p.origin=l=t.address,s.mapping(p)):s.notify(s.settings.addressErrorAlert)})},emptyResult:function(){this.writeDebug("emptyResult",arguments);var t=B("."+this.settings.locationList+" ul"),e=this.settings.mapSettings;this.map=new google.maps.Map(E.getElementById(this.settings.mapID),e),this.settings.callbackNoResults&&this.settings.callbackNoResults.call(this,this.map,e),t.empty(),e=B('
  • '+this.settings.noResultsTitle+'

    '+this.settings.noResultsDesc+"
  • ").hide().fadeIn(),t.append(e),e=g&&h?new google.maps.LatLng(g,h):new google.maps.LatLng(0,0),this.map.setCenter(e),z&&this.map.setZoom(z)},originMarker:function(t,e,s){var i;this.writeDebug("originMarker",arguments),!0===this.settings.originMarker&&(i="",void 0!==e&&(i=null!==this.settings.originMarkerImg?null===this.settings.originMarkerDim?this.markerImage(this.settings.originMarkerImg):this.markerImage(this.settings.originMarkerImg,this.settings.originMarkerDim.width,this.settings.originMarkerDim.height):{url:"https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png"},new google.maps.Marker({position:s,map:t,icon:i,draggable:!1})))},modalWindow:function(){var e;this.writeDebug("modalWindow"),!0===this.settings.modal&&((e=this).settings.callbackModalOpen&&e.settings.callbackModalOpen.call(this),B("."+e.settings.overlay).fadeIn(),B(E).on("click."+X,"."+e.settings.closeIcon+", ."+e.settings.overlay,function(){e.modalClose()}),B(E).on("click."+X,"."+e.settings.modalWindow,function(t){t.stopPropagation()}),B(E).on("keyup."+X,function(t){27===t.keyCode&&e.modalClose()}))},openNearestLocation:function(t,e,s,i){var n,a;this.writeDebug("openNearestLocation",arguments),!0!==this.settings.openNearest||void 0===t||!0===this.settings.fullMapStart&&!0===V&&!1===this.settings.querystringParams||!0===this.settings.defaultLoc&&!0===V&&!1===this.settings.querystringParams||((n=this).settings.callbackNearestLoc&&n.settings.callbackNearestLoc.call(this,n.map,t,e,s,i),a=t.hasOwnProperty("markerid")?t.markerid:0,t=Z[a],n.createInfowindow(t,"left",e,s,i),i=B("."+n.settings.locationList),a=B("."+n.settings.locationList+" li[data-markerid="+a+"]"),B("."+n.settings.locationList+" li").removeClass("list-focus"),a.addClass("list-focus"),i.animate({scrollTop:a.offset().top-i.offset().top+i.scrollTop()}))},listClick:function(s,i,n,a){this.writeDebug("listClick",arguments);var o=this;B(E).on("click."+X,"."+o.settings.locationList+" li",function(){var t=B(this).data("markerid"),e=Z[t];o.settings.callbackListClick&&o.settings.callbackListClick.call(this,t,e,W[t],s),s.panTo(e.getPosition());!0===o.settings.bounceMarker?(e.setAnimation(google.maps.Animation.BOUNCE),setTimeout(function(){e.setAnimation(null),o.createInfowindow(e,"left",i,n,a)},700)):o.createInfowindow(e,"left",i,n,a),null!==o.settings.selectedMarkerImg&&o.changeSelectedMarker(e),B("."+o.settings.locationList+" li").removeClass("list-focus"),B("."+o.settings.locationList+" li[data-markerid="+t+"]").addClass("list-focus")}),B(E).on("click."+X,"."+o.settings.locationList+" li a",function(t){t.stopPropagation()})},resultsTotalCount:function(t){this.writeDebug("resultsTotalCount",arguments);var e=B(".bh-sl-total-results");void 0===t||t<=0||0===e.length||e.text(t)},inlineDirections:function(e,s){var i;this.writeDebug("inlineDirections",arguments),!0===this.settings.inlineDirections&&void 0!==s&&(i=this,B(E).on("click."+X,"."+i.settings.locationList+" li .loc-directions a",function(t){t.preventDefault();t=B(this).closest("li").attr("data-markerid");i.directionsRequest(s,parseInt(t),e),B(E).on("click."+X,"."+i.settings.locationList+" .bh-sl-close-icon",function(){i.closeDirections()})}))},visibleMarkersList:function(t,e){var s;this.writeDebug("visibleMarkersList",arguments),!0===this.settings.visibleMarkersList&&(s=this,google.maps.event.addListenerOnce(t,"idle",function(){s.checkVisibleMarkers(e,t)}),google.maps.event.addListener(t,"center_changed",function(){s.checkVisibleMarkers(e,t)}),google.maps.event.addListener(t,"zoom_changed",function(){s.checkVisibleMarkers(e,t)}))},featuredDistanceRestriction:function(){this.writeDebug("featuredDistanceRestriction",arguments);var e=this;return K=B.grep(K,function(t){if(t.hasOwnProperty("distance"))return parseFloat(t.distance)<=parseFloat(e.settings.featuredDistance)})},featuredRestrictions:function(t){return this.writeDebug("featuredRestrictions",arguments),null===this.settings.featuredDistance||null!==this.settings.featuredDistance&&(K=this.featuredDistanceRestriction(t)),K},mapping:function(e){this.writeDebug("mapping",arguments);var t,s,i,n,a,o,r=this;this.isEmptyObject(e)||(t=e.lat,s=e.lng,i=e.geocodeResult,n=e.origin,o=e.page),!0===r.settings.pagination&&(void 0!==o&&N===l||(o=0)),Q=void 0===n&&!0===this.settings.nameSearch?r._getData():(a=new google.maps.LatLng(t,s),void 0!==N&&n===N&&void 0!==j?(n=N,j):r._getData(g,h,n,i,e)),null!==r.settings.taxonomyFilters&&r.hasEmptyObjectVals($)&&r.checkFilters(),null!==r.settings.dataRaw?r.processData(e,a,Q,o):Q.done(function(t){r.processData(e,a,t,o)})},processData:function(t,e,s,i){this.writeDebug("processData",arguments);var n,a,o,r,l,g,c,h,u,d,p,m=this,f=0,b={},y=B("#"+m.settings.lengthSwapID);this.isEmptyObject(t)||(n=t.lat,a=t.lng,o=t.origin,t.name,r=t.distance);var k,v=B("#"+m.settings.mapID),w="km"===m.settings.lengthUnit?m.settings.kilometersLang:m.settings.milesLang;if(j=Q,void 0!==o&&(N=o),m.settings.callbackSuccess&&m.settings.callbackSuccess.call(this,t,e,s,i),u=v.hasClass("bh-sl-map-open"),!0===m.settings.fullMapStart&&!1===u||!0===m.settings.autoGeocode&&!1===u||!0===m.settings.defaultLoc&&!1===u||!0===H?V=!0:m.reset(),v.addClass("bh-sl-map-open"),"json"===m.settings.dataType||"jsonp"===m.settings.dataType)for(var D=0;fr)&&m.notify(m.settings.distanceErrorAlert+r+" "+w);else{if(void 0===W[0])throw new Error("No locations found. Please check the dataLocation setting and path.");-1!==m.settings.distanceAlert&&W[0].distance>m.settings.distanceAlert&&(m.notify(m.settings.distanceErrorAlert+m.settings.distanceAlert+" "+w),h=!0)}void 0!==W[0]&&(p=W[0])}if(!0===m.settings.featuredLocations&&(K=B.grep(W,function(t){if(t.hasOwnProperty("featured"))return"true"===t.featured}),K=m.featuredRestrictions(t),J=B.grep(W,function(t){if(t.hasOwnProperty("featured"))return"true"!==t.featured}),W=[],W=K.concat(J)),!0===m.settings.slideMap&&_.slideDown(),!0===m.settings.pagination&&m.paginationSetup(i),!0===m.settings.altDistanceNoResult&&p.distance>m.settings.distanceAlert)m.emptyResult();else if(m.isEmptyObject(W)||"none"===W[0].result)m.emptyResult();else{m.modalWindow(),U=-1===m.settings.storeLimit||W.lengthW.length&&(c=m.settings.locationsPerPage-(g+c-W.length)),W=W.slice(g,g+c),U=W.length):(c=U,g=0),m.resultsTotalCount(W.length),!0===m.settings.fullMapStart&&!0===V&&!0!==m.settings.querystringParams||0===m.settings.mapSettings.zoom||void 0===o||!0===h||!0===m.settings.maxDistance&&!1===V&&0m.settings.fullMapStartListLimit)for(var A=0;A li:even").css("background",m.settings.listColor1),B("."+m.settings.locationList+" ul > li:odd").css("background",m.settings.listColor2),m.visibleMarkersList(m.map,Z),!0===m.settings.modal&&m.settings.callbackModalReady&&m.settings.callbackModalReady.call(this,t),m.settings.callbackFilters&&m.settings.callbackFilters.call(this,$,t)}},writeDebug:function(){G.console&&this.settings.debug&&(Function.prototype.bind?this.writeDebug=Function.prototype.bind.call(console.log,console,"StoreLocator :"):this.writeDebug=function(){arguments[0]="StoreLocator : "+arguments[0],Function.prototype.apply.call(console.log,console,arguments)},this.writeDebug.apply(this,arguments))}}),B.fn[X]=function(e){var s,i=arguments;return e===t||"object"==typeof e?this.each(function(){B.data(this,"plugin_"+X)||B.data(this,"plugin_"+X,new f(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(this.each(function(){var t=B.data(this,"plugin_"+X);t instanceof f&&"function"==typeof t[e]&&(s=t[e].apply(t,Array.prototype.slice.call(i,1))),"destroy"===e&&B.data(this,"plugin_"+X,null)}),s!==t?s:this):void 0})}(jQuery,window,document); \ No newline at end of file +!function(B,G,E,t){"use strict";var _,a,r,c,N,j,z,Q,q,l,g,h,U,i,n,s,o,V,H,K,W,J,Z,$,u,d,p,m,X="storeLocator";function f(t,e){_=B(t),this.element=t,this.settings=B.extend({},m,e),this._defaults=m,this._name=X,this.init()}void 0===B.fn[X]&&"undefined"!=typeof google&&(m={ajaxData:null,altDistanceNoResult:!(p={}),autoComplete:!(d={}),autoCompleteDisableListener:!(u={}),autoCompleteOptions:{},autoGeocode:!($={}),bounceMarker:!0,catMarkers:null,dataLocation:"data/locations.json",dataRaw:null,dataType:"json",debug:!(Z=[]),defaultLat:null,defaultLng:null,defaultLoc:!(J=[]),disableAlphaMarkers:!(W=[]),distanceAlert:60,dragSearch:!(K=[]),exclusiveFiltering:!1,exclusiveTax:null,featuredDistance:null,featuredLocations:!1,fullMapStart:!1,fullMapStartBlank:!1,fullMapStartListLimit:!1,infoBubble:null,inlineDirections:!1,lengthUnit:"m",listColor1:"#ffffff",listColor2:"#eeeeee",loading:!1,locationsPerPage:10,mapSettings:{mapTypeId:google.maps.MapTypeId.ROADMAP,zoom:12},markerCluster:null,markerImg:null,markerDim:null,maxDistance:!1,modal:!1,nameAttribute:"name",nameSearch:!1,noForm:!1,openNearest:!1,originMarker:!1,originMarkerDim:null,originMarkerImg:null,pagination:!1,querystringParams:!1,selectedMarkerImg:null,selectedMarkerImgDim:null,sessionStorage:!1,slideMap:!0,sortBy:null,storeLimit:26,taxonomyFilters:null,visibleMarkersList:!1,xmlElement:"marker",addressID:"bh-sl-address",closeIcon:"bh-sl-close-icon",formContainer:"bh-sl-form-container",formID:"bh-sl-user-location",geocodeID:null,lengthSwapID:"bh-sl-length-swap",loadingContainer:"bh-sl-loading",locationList:"bh-sl-loc-list",mapID:"bh-sl-map",maxDistanceID:"bh-sl-maxdistance",modalContent:"bh-sl-modal-content",modalWindow:"bh-sl-modal-window",orderID:"bh-sl-order",overlay:"bh-sl-overlay",regionID:"bh-sl-region",searchID:"bh-sl-search",sortID:"bh-sl-sort",taxonomyFiltersContainer:"bh-sl-filters-container",infowindowTemplatePath:"assets/js/plugins/storeLocator/templates/infowindow-description.html",listTemplatePath:"assets/js/plugins/storeLocator/templates/location-list-description.html",KMLinfowindowTemplatePath:"assets/js/plugins/storeLocator/templates/kml-infowindow-description.html",KMLlistTemplatePath:"assets/js/plugins/storeLocator/templates/kml-location-list-description.html",listTemplateID:null,infowindowTemplateID:null,callbackAutoGeoSuccess:null,callbackBeforeSend:null,callbackCloseDirections:null,callbackCreateMarker:null,callbackDirectionsRequest:null,callbackFilters:null,callbackFormVals:null,callbackGeocodeRestrictions:null,callbackJsonp:null,callbackListClick:null,callbackMapSet:null,callbackMarkerClick:null,callbackModalClose:null,callbackModalOpen:null,callbackModalReady:null,callbackNearestLoc:null,callbackNoResults:null,callbackNotify:null,callbackOrder:null,callbackPageChange:null,callbackRegion:null,callbackSorting:null,callbackSuccess:null,addressErrorAlert:"Unable to find address",autoGeocodeErrorAlert:"Automatic location detection failed. Please fill in your address or zip code.",distanceErrorAlert:"Unfortunately, our closest location is more than ",kilometerLang:"kilometer",kilometersLang:"kilometers",mileLang:"mile",milesLang:"miles",noResultsTitle:"No results",noResultsDesc:"No locations were found with the given criteria. Please modify your selections or input.",nextPage:"Next »",prevPage:"« Prev"},B.extend(f.prototype,{init:function(){var t,e=this;this.writeDebug("init"),"km"===this.settings.lengthUnit?d.EarthRadius=6367:d.EarthRadius=3956,c="kml"===this.settings.dataType?"xml":this.settings.dataType,!0===this.settings.inlineDirections&&B("."+this.settings.locationList).prepend('
    '),z=this.settings.mapSettings.zoom,Handlebars.registerHelper("niceURL",function(t){if(t)return t.replace("https://","").replace("http://","")}),null!==this.settings.taxonomyFilters&&this.taxonomyFiltering(),this.sorting(),this.order(),!0===this.settings.modal&&(null!==this.settings.taxonomyFilters&&B("."+this.settings.taxonomyFiltersContainer).clone(!0,!0).prependTo(_),_.wrap('
    '),B("."+this.settings.modalWindow).prepend('
    '),B("."+this.settings.overlay).hide()),!0===this.settings.autoComplete&&(t=E.getElementById(this.settings.addressID),t=new google.maps.places.Autocomplete(t,this.settings.autoCompleteOptions),!0===this.settings.autoComplete&&!0!==this.settings.autoCompleteDisableListener&&t.addListener("place_changed",function(t){e.processForm(t)})),this._loadTemplates()},destroy:function(){this.writeDebug("destroy"),this.reset();var t=B("#"+this.settings.mapID);if(Z.length)for(var e=0;e<=Z.length;e++)google.maps.event.removeListener(Z[e]);B("."+this.settings.locationList+" ul").empty(),t.hasClass("bh-sl-map-open")&&t.empty().removeClass("bh-sl-map-open"),!0===this.settings.modal&&B(". "+this.settings.overlay).remove(),t.attr("style",""),_.hide(),B.removeData(_.get(0)),B(E).off(X),_.unbind()},reset:function(){var t;this.writeDebug("reset"),W=[],K=[],J=[],V=!(Z=[]),B(E).off("click."+X,"."+this.settings.locationList+" li"),B("."+this.settings.locationList+" .bh-sl-close-directions-container").length&&B(".bh-sl-close-directions-container").remove(),!0===this.settings.inlineDirections&&(0<(t=B("."+this.settings.locationList+" .adp")).length&&(t.remove(),B("."+this.settings.locationList+" ul").fadeIn()),B(E).off("click","."+this.settings.locationList+" li .loc-directions a")),!0===this.settings.pagination&&B(E).off("click."+X,".bh-sl-pagination li")},formFiltersReset:function(){var t,e;this.writeDebug("formFiltersReset"),null!==this.settings.taxonomyFilters&&(t=B("."+this.settings.taxonomyFiltersContainer+" input"),e=B("."+this.settings.taxonomyFiltersContainer+" select"),"object"==typeof t&&(t.each(function(){(B(this).is('input[type="checkbox"]')||B(this).is('input[type="radio"]'))&&B(this).prop("checked",!1)}),e.each(function(){B(this).prop("selectedIndex",0)})))},mapReload:function(){this.writeDebug("mapReload"),this.reset(),H=!0,null!==this.settings.taxonomyFilters&&(this.formFiltersReset(),this.taxonomyFiltersInit()),g&&h?(this.settings.mapSettings.zoom=z,this.processForm()):this.mapping(p)},notify:function(t){this.writeDebug("notify",t),this.settings.callbackNotify?this.settings.callbackNotify.call(this,t):alert(t)},geoCodeCalcToRadian:function(t){return this.writeDebug("geoCodeCalcToRadian",t),t*(Math.PI/180)},geoCodeCalcDiffRadian:function(t,e){return this.writeDebug("geoCodeCalcDiffRadian",arguments),this.geoCodeCalcToRadian(e)-this.geoCodeCalcToRadian(t)},geoCodeCalcCalcDistance:function(t,e,s,i,n){return this.writeDebug("geoCodeCalcCalcDistance",arguments),2*n*Math.asin(Math.min(1,Math.sqrt(Math.pow(Math.sin(this.geoCodeCalcDiffRadian(t,s)/2),2)+Math.cos(this.geoCodeCalcToRadian(t))*Math.cos(this.geoCodeCalcToRadian(s))*Math.pow(Math.sin(this.geoCodeCalcDiffRadian(e,i)/2),2))))},inRange:function(t,e,s){return this.writeDebug("inRange",arguments),e=Math.abs(e),isFinite(e)&&t<=e&&e<=s},coordinatesInRange:function(t,e){return this.writeDebug("coordinatesInRange",arguments),this.inRange(-90,t,90)&&this.inRange(-180,e,180)},getQueryString:function(t){if(this.writeDebug("getQueryString",t),t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");t=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},getMap:function(){return this.map},_loadTemplates:function(){var e;this.writeDebug("_loadTemplates");var t=this,s='
    Error: Could not load plugin templates. Check the paths and ensure they have been uploaded. Paths will be wrong if you do not run this from a web server.
    ';"kml"===this.settings.dataType&&null===this.settings.listTemplateID&&null===this.settings.infowindowTemplateID?B.when(B.get(this.settings.KMLinfowindowTemplatePath,function(t){e=t,r=Handlebars.compile(e)}),B.get(this.settings.KMLlistTemplatePath,function(t){e=t,a=Handlebars.compile(e)})).then(function(){t.locator()},function(){throw B("."+t.settings.formContainer).append(s),new Error("Could not load storeLocator plugin templates")}):null!==this.settings.listTemplateID&&null!==this.settings.infowindowTemplateID?(r=Handlebars.compile(B("#"+this.settings.infowindowTemplateID).html()),a=Handlebars.compile(B("#"+this.settings.listTemplateID).html()),t.locator()):B.when(B.get(this.settings.infowindowTemplatePath,function(t){e=t,r=Handlebars.compile(e)}),B.get(this.settings.listTemplatePath,function(t){e=t,a=Handlebars.compile(e)})).then(function(){t.locator()},function(){throw B("."+t.settings.formContainer).append(s),new Error("Could not load storeLocator plugin templates")})},locator:function(){this.writeDebug("locator"),!0===this.settings.slideMap&&_.hide(),this._start(),this._formEventHandler()},_formEventHandler:function(){this.writeDebug("_formEventHandler");var e=this;!0===this.settings.noForm?(B(E).on("click."+X,"."+this.settings.formContainer+" button",function(t){e.processForm(t)}),B(E).on("keydown."+X,function(t){13===t.keyCode&&B("#"+e.settings.addressID).is(":focus")&&e.processForm(t)})):B(E).on("submit."+X,"#"+this.settings.formID,function(t){e.processForm(t)}),B(".bh-sl-reset").length&&B("#"+this.settings.mapID).length&&B(E).on("click."+X,".bh-sl-reset",function(){e.mapReload()})},_getData:function(t,e,s,i,n){this.writeDebug("_getData",arguments);var a=this,o="",r="",l="";if(void 0!==i&&void 0!==i.geometry.bounds&&(l=i.formatted_address,o=JSON.stringify(i.geometry.bounds.getNorthEast()),r=JSON.stringify(i.geometry.bounds.getSouthWest())),this.settings.callbackBeforeSend&&this.settings.callbackBeforeSend.call(this,t,e,s,l,o,r,n),null!==a.settings.dataRaw)return"xml"===c?B.parseXML(a.settings.dataRaw):"json"===c?Array.isArray&&Array.isArray(a.settings.dataRaw)?a.settings.dataRaw:"string"==typeof a.settings.dataRaw?JSON.parse(a.settings.dataRaw):[]:void 0;var g=B.Deferred();!0===this.settings.loading&&B("."+this.settings.formContainer).append('
    ');r={origLat:t,origLng:e,origAddress:s,formattedAddress:l,boundsNorthEast:o,boundsSouthWest:r};return null!==this.settings.ajaxData&&"object"==typeof this.settings.ajaxData&&B.extend(r,this.settings.ajaxData),B.ajax({type:"GET",url:this.settings.dataLocation+("jsonp"===this.settings.dataType?(this.settings.dataLocation.match(/\?/)?"&":"?")+"callback=?":""),data:r,dataType:c,jsonpCallback:"jsonp"===this.settings.dataType?this.settings.callbackJsonp:null}).done(function(t){g.resolve(t),!0===a.settings.loading&&B("."+a.settings.formContainer+" ."+a.settings.loadingContainer).remove()}).fail(g.reject),g.promise()},_start:function(){this.writeDebug("_start");var t,e,s=this,i=this.settings.autoGeocode;!1!==s.settings.fullMapStartBlank?(B("#"+s.settings.mapID).addClass("bh-sl-map-open"),(e=s.settings.mapSettings).zoom=s.settings.fullMapStartBlank,t=new google.maps.LatLng(this.settings.defaultLat,this.settings.defaultLng),e.center=t,s.map=new google.maps.Map(E.getElementById(s.settings.mapID),e),google.maps.event.addDomListener(G,"resize",function(){var t=s.map.getCenter();google.maps.event.trigger(s.map,"resize"),s.map.setCenter(t)}),s.settings.fullMapStartBlank=!1,e.zoom=z):(!0===this.settings.defaultLoc&&this.defaultLocation(),""!==B.trim(B("#"+this.settings.addressID).val())?(s.writeDebug("Using Address Field"),s.processForm(null),i=!1):!0===this.settings.fullMapStart&&!1===this.settings.defaultLoc&&(!0===this.settings.querystringParams&&this.getQueryString(this.settings.addressID)||!0===this.settings.querystringParams&&this.getQueryString(this.settings.searchID)||!0===this.settings.querystringParams&&this.getQueryString(this.settings.maxDistanceID)?(s.writeDebug("Using Query String"),this.processForm(null),i=!1):this.mapping(null))),!0===this.settings.autoGeocode&&!0===i&&(s.writeDebug("Auto Geo"),s.htmlGeocode()),null!==this.settings.autoGeocode&&(s.writeDebug("Button Geo"),B(E).on("click."+X,"#"+this.settings.geocodeID,function(){s.htmlGeocode()}))},htmlGeocode:function(){this.writeDebug("htmlGeocode",arguments);var e=this;if(!0===e.settings.sessionStorage&&G.sessionStorage&&G.sessionStorage.getItem("myGeo"))return e.writeDebug("Using Session Saved Values for GEO"),e.autoGeocodeQuery(JSON.parse(G.sessionStorage.getItem("myGeo"))),!1;navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){e.writeDebug("Current Position Result");t={coords:{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy}};!0===e.settings.sessionStorage&&G.sessionStorage&&G.sessionStorage.setItem("myGeo",JSON.stringify(t)),e.settings.callbackAutoGeoSuccess&&e.settings.callbackAutoGeoSuccess.call(this,t),e.autoGeocodeQuery(t)},function(t){e._autoGeocodeError(t)})},googleGeocode:function(t){t.writeDebug("googleGeocode",arguments);var e=new google.maps.Geocoder;this.geocode=function(t,s){e.geocode(t,function(t,e){if(e!==google.maps.GeocoderStatus.OK)throw s(null),new Error("Geocode was not successful for the following reason: "+e);e={};e.latitude=t[0].geometry.location.lat(),e.longitude=t[0].geometry.location.lng(),e.geocodeResult=t[0],s(e)})}},reverseGoogleGeocode:function(t){t.writeDebug("reverseGoogleGeocode",arguments);var e=new google.maps.Geocoder;this.geocode=function(t,s){e.geocode(t,function(t,e){if(e!==google.maps.GeocoderStatus.OK)throw s(null),new Error("Reverse geocode was not successful for the following reason: "+e);t[0]&&((e={}).address=t[0].formatted_address,e.fullResult=t[0],s(e))})}},roundNumber:function(t,e){return this.writeDebug("roundNumber",arguments),Math.round(t*Math.pow(10,e))/Math.pow(10,e)},isEmptyObject:function(t){for(var e in this.writeDebug("isEmptyObject",arguments),t)if(t.hasOwnProperty(e))return!1;return!0},hasEmptyObjectVals:function(t){this.writeDebug("hasEmptyObjectVals",arguments);var e,s=!0;for(e in t)t.hasOwnProperty(e)&&""!==t[e]&&0!==t[e].length&&(s=!1);return s},modalClose:function(){this.writeDebug("modalClose"),this.settings.callbackModalClose&&this.settings.callbackModalClose.call(this),$={},B("."+this.settings.overlay+" select").prop("selectedIndex",0),B("."+this.settings.overlay+" input").prop("checked",!1),B("."+this.settings.overlay).hide()},_createLocationVariables:function(t){var e,s;for(s in this.writeDebug("_createLocationVariables",arguments),u={},W[t])W[t].hasOwnProperty(s)&&(e=W[t][s],"distance"!==s&&"altdistance"!==s||(e=this.roundNumber(e,2)),u[s]=e)},sortAlpha:function(t){this.writeDebug("sortAlpha",arguments);var s=this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"name";this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return e[s].toLowerCase().localeCompare(t[s].toLowerCase())}):t.sort(function(t,e){return t[s].toLowerCase().localeCompare(e[s].toLowerCase())})},sortDate:function(t){this.writeDebug("sortDate",arguments);var s=this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"date";this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return new Date(e[s]).getTime()-new Date(t[s]).getTime()}):t.sort(function(t,e){return new Date(t[s]).getTime()-new Date(e[s]).getTime()})},sortNumerically:function(t,e){this.writeDebug("sortNumerically",arguments);var s=null!==this.settings.sortBy&&this.settings.sortBy.hasOwnProperty("prop")&&void 0!==this.settings.sortBy.prop?this.settings.sortBy.prop:"distance";void 0!==e&&!0===e&&(s="distance"),null!==this.settings.sortBy&&this.settings.sortBy.hasOwnProperty("order")&&"desc"===this.settings.sortBy.order.toString()?t.sort(function(t,e){return e[s]t[s]?1:0}):t.sort(function(t,e){return t[s]e[s]?1:0})},sortCustom:function(t){this.writeDebug("sortCustom",arguments),this.settings.sortBy.hasOwnProperty("method")&&"alpha"===this.settings.sortBy.method.toString()?this.sortAlpha(t):this.settings.sortBy.hasOwnProperty("method")&&"date"===this.settings.sortBy.method.toString()?this.sortDate(t):this.sortNumerically(t)},filterMatching:function(t,e,s){return this.writeDebug("inclusiveFilter",arguments),void 0!==e&&(t=!0===(s=void 0===s||s)?t.join(""):t.join("|"),!!new RegExp(t,"i").test(e.replace(/([.*+?^=!:${}()|\[\]\/\\]|&\s+)/g,"")))},filterData:function(t,e){this.writeDebug("filterData",arguments);var s,i=!0;for(s in e)if(e.hasOwnProperty(s)){for(var n=[],a=0;a'+this.settings.prevPage+"");for(var n=0;n'+a+"":'
  • '+a+"
  • "}return i'+this.settings.nextPage+""),s},paginationSetup:function(t){this.writeDebug("paginationSetup",arguments);var e="",s=B(".bh-sl-pagination-container .bh-sl-pagination"),i=-1===this.settings.storeLimit||W.length ul").append(s)},changeSelectedMarker:function(t){var e;void 0!==o&&o.setIcon(s),e=null===this.settings.selectedMarkerImgDim?this.markerImage(this.settings.selectedMarkerImg):this.markerImage(this.settings.selectedMarkerImg,this.settings.selectedMarkerImgDim.width,this.settings.selectedMarkerImgDim.height),s=t.icon,t.setIcon(e),o=t},createInfowindow:function(s,t,i,e,n){this.writeDebug("createInfowindow",arguments);var a=this,n=this._defineLocationData(s,e,n),o=r(n);"left"===t?(i.setContent(o),i.open(s.get("map"),s)):google.maps.event.addListener(s,"click",function(){i.setContent(o),i.open(s.get("map"),s);var t=s.get("id"),e=B("."+a.settings.locationList+" li[data-markerid="+t+"]");0
    ')),B(E).off("click","."+this.settings.locationList+" li .loc-directions a")},closeDirections:function(){this.writeDebug("closeDirections"),this.settings.callbackCloseDirections&&this.settings.callbackCloseDirections.call(this),this.reset(),g&&h&&(0===this.countFilters()?this.settings.mapSettings.zoom=z:this.settings.mapSettings.zoom=0,this.processForm(null)),B(E).off("click."+X,"."+this.settings.locationList+" .bh-sl-close-icon")},lengthUnitSwap:function(t){this.writeDebug("lengthUnitSwap",arguments),"alt-distance"===t.val()?(B("."+this.settings.locationList+" .loc-alt-dist").show(),B("."+this.settings.locationList+" .loc-default-dist").hide()):"default-distance"===t.val()&&(B("."+this.settings.locationList+" .loc-default-dist").show(),B("."+this.settings.locationList+" .loc-alt-dist").hide())},processForm:function(t){this.writeDebug("processForm",arguments);var e=this,s=null,i={},n=B("#"+this.settings.addressID),a=B("#"+this.settings.searchID),o=B("#"+this.settings.maxDistanceID),r="";null!=t&&t.preventDefault(),B("."+e.settings.formContainer+" input, ."+e.settings.formContainer+" select").blur(),!0===this.settings.querystringParams&&(this.getQueryString(this.settings.addressID)||this.getQueryString(this.settings.searchID)||this.getQueryString(this.settings.maxDistanceID))?(l=this.getQueryString(this.settings.addressID),q=this.getQueryString(this.settings.searchID),s=this.getQueryString(this.settings.maxDistanceID),""!==n.val()&&(l=n.val()),""!==a.val()&&(q=a.val()),""!==o.val()&&(s=o.val())):(l=n.val()||"",q=a.val()||"",!0===this.settings.maxDistance&&(s=o.val()||"")),r=this.settings.callbackRegion?this.settings.callbackRegion.call(this,l,q,s):B("#"+this.settings.regionID).val(),this.settings.callbackFormVals&&this.settings.callbackFormVals.call(this,l,q,s,r),void 0!==r&&(i={country:r}),"function"==typeof this.settings.callbackGeocodeRestrictions&&(i=this.settings.callbackGeocodeRestrictions.call(this,l,q,s)),""===l&&""===q&&!0!==this.settings.autoGeocode?this._start():""!==l?(""===q&&$.hasOwnProperty("name")&&delete $.name,void 0!==N&&void 0!==g&&void 0!==h&&l===N?(p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,e.mapping(p)):new this.googleGeocode(this).geocode({address:l,componentRestrictions:i,region:r},function(t){null!==t?(g=t.latitude,h=t.longitude,p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,p.geocodeResult=t.geocodeResult,e.mapping(p)):e.notify(e.settings.addressErrorAlert)})):""!==q?(""===l&&delete p.origin,p.name=q,e.mapping(p)):!0===this.settings.autoGeocode&&(p.lat=g,p.lng=h,p.origin=l,p.name=q,p.distance=s,e.mapping(p))},locationsSetup:function(t,e,s,i,n){this.writeDebug("locationsSetup",arguments),void 0!==i&&(t.distance||(t.distance=this.geoCodeCalcCalcDistance(e,s,t.lat,t.lng,d.EarthRadius),"m"===this.settings.lengthUnit?t.altdistance=1.609344*parseFloat(t.distance):"km"===this.settings.lengthUnit&&(t.altdistance=parseFloat(t.distance)/1.609344))),this.coordinatesInRange(t.lat,t.lng)?!0===this.settings.maxDistance&&null!=n?t.distance<=n?W.push(t):this.writeDebug("locationsSetup","location ignored because it is out of maxDistance: "+n,t):!0!==this.settings.maxDistance||!0!==this.settings.querystringParams||null==n||t.distance<=n?W.push(t):this.writeDebug("locationsSetup","location ignored because it is out of maxDistance: "+n,t):this.writeDebug("locationsSetup","location ignored because coordinates out of range: "+n,t)},sorting:function(){this.writeDebug("sorting",arguments);var s=this,i=B("#"+s.settings.mapID),t=B("#"+s.settings.sortID);0!==t.length&&t.on("change."+X,function(t){var e;t.stopPropagation(),!0===s.settings.pagination&&s.paginationChange(0),e=void 0!==B(this).find(":selected").attr("data-method")?B(this).find(":selected").attr("data-method"):"distance",t=B(this).val(),s.settings.sortBy.method=e,s.settings.sortBy.prop=t,s.settings.callbackSorting&&s.settings.callbackSorting.call(this,s.settings.sortBy),i.hasClass("bh-sl-map-open")&&s.mapping(p)})},order:function(){this.writeDebug("order",arguments);var e=this,s=B("#"+e.settings.mapID),t=B("#"+e.settings.orderID);0!==t.length&&t.on("change."+X,function(t){t.stopPropagation(),!0===e.settings.pagination&&e.paginationChange(0),e.settings.sortBy.order=B(this).val(),e.settings.callbackOrder&&e.settings.callbackOrder.call(this,e.settings.order),s.hasClass("bh-sl-map-open")&&e.mapping(p)})},countFilters:function(){this.writeDebug("countFilters");var t=0;if(!this.isEmptyObject($))for(var e in $)$.hasOwnProperty(e)&&(t+=$[e].length);return t},_existingCheckedFilters:function(e){this.writeDebug("_existingCheckedFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" input[type=checkbox]").each(function(){var t;!B(this).prop("checked")||void 0!==(t=B(this).val())&&""!==t&&-1===$[e].indexOf(t)&&$[e].push(t)})},_existingSelectedFilters:function(e){this.writeDebug("_existingSelectedFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" select").each(function(){var t=B(this).val();void 0!==t&&""!==t&&-1===$[e].indexOf(t)&&($[e]=[t])})},_existingRadioFilters:function(e){this.writeDebug("_existingRadioFilters",arguments),B("#"+this.settings.taxonomyFilters[e]+" input[type=radio]").each(function(){var t;!B(this).prop("checked")||void 0!==(t=B(this).val())&&""!==t&&-1===$[e].indexOf(t)&&($[e]=[t])})},checkFilters:function(){for(var t in this.writeDebug("checkFilters"),this.settings.taxonomyFilters)this.settings.taxonomyFilters.hasOwnProperty(t)&&(this._existingCheckedFilters(t),this._existingSelectedFilters(t),this._existingRadioFilters(t))},selectQueryStringFilters:function(t,e){this.writeDebug("selectQueryStringFilters",arguments);var s=B("#"+this.settings.taxonomyFilters[t]);if(s.find('input[type="checkbox"]').length)for(var i=0;i ul").append(i))}),B("."+this.settings.locationList+" ul li:even").css("background",this.settings.listColor1),B("."+this.settings.locationList+" ul li:odd").css("background",this.settings.listColor2)},dragSearch:function(t){this.writeDebug("dragSearch",arguments);var e=t.getCenter(),s=this;this.settings.mapSettings.zoom=t.getZoom(),g=p.lat=e.lat(),h=p.lng=e.lng();t=new this.reverseGoogleGeocode(this),e=new google.maps.LatLng(p.lat,p.lng);t.geocode({latLng:e},function(t){null!==t?(p.origin=l=t.address,s.mapping(p)):s.notify(s.settings.addressErrorAlert)})},emptyResult:function(){this.writeDebug("emptyResult",arguments);var t=B("."+this.settings.locationList+" ul"),e=this.settings.mapSettings;this.map=new google.maps.Map(E.getElementById(this.settings.mapID),e),this.settings.callbackNoResults&&this.settings.callbackNoResults.call(this,this.map,e),t.empty(),e=B('
  • '+this.settings.noResultsTitle+'

    '+this.settings.noResultsDesc+"
  • ").hide().fadeIn(),t.append(e),e=g&&h?new google.maps.LatLng(g,h):new google.maps.LatLng(0,0),this.map.setCenter(e),z&&this.map.setZoom(z)},originMarker:function(t,e,s){var i;this.writeDebug("originMarker",arguments),!0===this.settings.originMarker&&(i="",void 0!==e&&(i=null!==this.settings.originMarkerImg?null===this.settings.originMarkerDim?this.markerImage(this.settings.originMarkerImg):this.markerImage(this.settings.originMarkerImg,this.settings.originMarkerDim.width,this.settings.originMarkerDim.height):{url:"https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png"},new google.maps.Marker({position:s,map:t,icon:i,draggable:!1})))},modalWindow:function(){var e;this.writeDebug("modalWindow"),!0===this.settings.modal&&((e=this).settings.callbackModalOpen&&e.settings.callbackModalOpen.call(this),B("."+e.settings.overlay).fadeIn(),B(E).on("click."+X,"."+e.settings.closeIcon+", ."+e.settings.overlay,function(){e.modalClose()}),B(E).on("click."+X,"."+e.settings.modalWindow,function(t){t.stopPropagation()}),B(E).on("keyup."+X,function(t){27===t.keyCode&&e.modalClose()}))},openNearestLocation:function(t,e,s,i){var n,a;this.writeDebug("openNearestLocation",arguments),!0!==this.settings.openNearest||void 0===t||!0===this.settings.fullMapStart&&!0===V&&!1===this.settings.querystringParams||!0===this.settings.defaultLoc&&!0===V&&!1===this.settings.querystringParams||((n=this).settings.callbackNearestLoc&&n.settings.callbackNearestLoc.call(this,n.map,t,e,s,i),a=t.hasOwnProperty("markerid")?t.markerid:0,t=Z[a],n.createInfowindow(t,"left",e,s,i),i=B("."+n.settings.locationList),a=B("."+n.settings.locationList+" li[data-markerid="+a+"]"),B("."+n.settings.locationList+" li").removeClass("list-focus"),a.addClass("list-focus"),i.animate({scrollTop:a.offset().top-i.offset().top+i.scrollTop()}))},listClick:function(s,i,n,a){this.writeDebug("listClick",arguments);var o=this;B(E).on("click."+X,"."+o.settings.locationList+" li",function(){var t=B(this).data("markerid"),e=Z[t];o.settings.callbackListClick&&o.settings.callbackListClick.call(this,t,e,W[t],s),s.panTo(e.getPosition());!0===o.settings.bounceMarker?(e.setAnimation(google.maps.Animation.BOUNCE),setTimeout(function(){e.setAnimation(null),o.createInfowindow(e,"left",i,n,a)},700)):o.createInfowindow(e,"left",i,n,a),null!==o.settings.selectedMarkerImg&&o.changeSelectedMarker(e),B("."+o.settings.locationList+" li").removeClass("list-focus"),B("."+o.settings.locationList+" li[data-markerid="+t+"]").addClass("list-focus")}),B(E).on("click."+X,"."+o.settings.locationList+" li a",function(t){t.stopPropagation()})},resultsTotalCount:function(t){this.writeDebug("resultsTotalCount",arguments);var e=B(".bh-sl-total-results");void 0===t||t<=0||0===e.length||e.text(t)},inlineDirections:function(e,s){var i;this.writeDebug("inlineDirections",arguments),!0===this.settings.inlineDirections&&void 0!==s&&(i=this,B(E).on("click."+X,"."+i.settings.locationList+" li .loc-directions a",function(t){t.preventDefault();t=B(this).closest("li").attr("data-markerid");i.directionsRequest(s,parseInt(t),e),B(E).on("click."+X,"."+i.settings.locationList+" .bh-sl-close-icon",function(){i.closeDirections()})}))},visibleMarkersList:function(t,e){var s;this.writeDebug("visibleMarkersList",arguments),!0===this.settings.visibleMarkersList&&(s=this,google.maps.event.addListenerOnce(t,"idle",function(){s.checkVisibleMarkers(e,t)}),google.maps.event.addListener(t,"center_changed",function(){s.checkVisibleMarkers(e,t)}),google.maps.event.addListener(t,"zoom_changed",function(){s.checkVisibleMarkers(e,t)}))},featuredDistanceRestriction:function(){this.writeDebug("featuredDistanceRestriction",arguments);var e=this;return K=B.grep(K,function(t){if(t.hasOwnProperty("distance"))return parseFloat(t.distance)<=parseFloat(e.settings.featuredDistance)})},featuredRestrictions:function(t){return this.writeDebug("featuredRestrictions",arguments),null===this.settings.featuredDistance||null!==this.settings.featuredDistance&&(K=this.featuredDistanceRestriction(t)),K},mapping:function(e){this.writeDebug("mapping",arguments);var t,s,i,n,a,o,r=this;this.isEmptyObject(e)||(t=e.lat,s=e.lng,i=e.geocodeResult,n=e.origin,o=e.page),!0===r.settings.pagination&&(void 0!==o&&N===l||(o=0)),Q=void 0===n&&!0===this.settings.nameSearch?r._getData():(a=new google.maps.LatLng(t,s),void 0!==N&&n===N&&void 0!==j?(n=N,j):r._getData(g,h,n,i,e)),null!==r.settings.taxonomyFilters&&r.hasEmptyObjectVals($)&&r.checkFilters(),null!==r.settings.dataRaw?r.processData(e,a,Q,o):Q.done(function(t){r.processData(e,a,t,o)})},processData:function(t,e,s,i){this.writeDebug("processData",arguments);var n,a,o,r,l,g,c,h,u,d,p,m=this,f=0,b={},y=B("#"+m.settings.lengthSwapID);this.isEmptyObject(t)||(n=t.lat,a=t.lng,o=t.origin,t.name,r=t.distance);var k,v=B("#"+m.settings.mapID),w="km"===m.settings.lengthUnit?m.settings.kilometersLang:m.settings.milesLang;if(j=Q,void 0!==o&&(N=o),m.settings.callbackSuccess&&m.settings.callbackSuccess.call(this,t,e,s,i),u=v.hasClass("bh-sl-map-open"),!0===m.settings.fullMapStart&&!1===u||!0===m.settings.autoGeocode&&!1===u||!0===m.settings.defaultLoc&&!1===u||!0===H?V=!0:m.reset(),v.addClass("bh-sl-map-open"),"json"===m.settings.dataType||"jsonp"===m.settings.dataType)for(var D=0;fr)&&m.notify(m.settings.distanceErrorAlert+r+" "+w);else{if(void 0===W[0])throw new Error("No locations found. Please check the dataLocation setting and path.");-1!==m.settings.distanceAlert&&W[0].distance>m.settings.distanceAlert&&(m.notify(m.settings.distanceErrorAlert+m.settings.distanceAlert+" "+w),h=!0)}void 0!==W[0]&&(p=W[0])}if(!0===m.settings.featuredLocations&&(K=B.grep(W,function(t){if(t.hasOwnProperty("featured"))return"true"===t.featured}),K=m.featuredRestrictions(t),J=B.grep(W,function(t){if(t.hasOwnProperty("featured"))return"true"!==t.featured}),W=[],W=K.concat(J)),!0===m.settings.slideMap&&_.slideDown(),!0===m.settings.pagination&&m.paginationSetup(i),!0===m.settings.altDistanceNoResult&&p.distance>m.settings.distanceAlert)m.emptyResult();else if(m.isEmptyObject(W)||"none"===W[0].result)m.emptyResult();else{m.modalWindow(),U=-1===m.settings.storeLimit||W.lengthW.length&&(c=m.settings.locationsPerPage-(g+c-W.length)),W=W.slice(g,g+c),U=W.length):(c=U,g=0),m.resultsTotalCount(W.length),!0===m.settings.fullMapStart&&!0===V&&!0!==m.settings.querystringParams||0===m.settings.mapSettings.zoom||void 0===o||!0===h||!0===m.settings.maxDistance&&!1===V&&0m.settings.fullMapStartListLimit)for(var A=0;A li:even").css("background",m.settings.listColor1),B("."+m.settings.locationList+" ul > li:odd").css("background",m.settings.listColor2),m.visibleMarkersList(m.map,Z),!0===m.settings.modal&&m.settings.callbackModalReady&&m.settings.callbackModalReady.call(this,t),m.settings.callbackFilters&&m.settings.callbackFilters.call(this,$,t)}},writeDebug:function(){G.console&&this.settings.debug&&(Function.prototype.bind?this.writeDebug=Function.prototype.bind.call(console.log,console,"StoreLocator :"):this.writeDebug=function(){arguments[0]="StoreLocator : "+arguments[0],Function.prototype.apply.call(console.log,console,arguments)},this.writeDebug.apply(this,arguments))}}),B.fn[X]=function(e){var s,i=arguments;return e===t||"object"==typeof e?this.each(function(){B.data(this,"plugin_"+X)||B.data(this,"plugin_"+X,new f(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(this.each(function(){var t=B.data(this,"plugin_"+X);t instanceof f&&"function"==typeof t[e]&&(s=t[e].apply(t,Array.prototype.slice.call(i,1))),"destroy"===e&&B.data(this,"plugin_"+X,null)}),s!==t?s:this):void 0})}(jQuery,window,document); \ No newline at end of file diff --git a/package.json b/package.json index e6e007a..7b93fe8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-storelocator-plugin", - "version": "3.1.7", + "version": "3.1.8", "description": "This jQuery plugin takes advantage of Google Maps API version 3 to create an easy to implement store locator. No back-end programming is required, you just need to feed it KML, XML, or JSON data with all the location information.", "repository": { "type": "git", diff --git a/src/js/jquery.storelocator.js b/src/js/jquery.storelocator.js index 0cbf52b..6c09b70 100644 --- a/src/js/jquery.storelocator.js +++ b/src/js/jquery.storelocator.js @@ -397,6 +397,7 @@ * @returns {boolean} */ inRange(min, num, max){ + this.writeDebug('inRange',arguments); num = Math.abs(num); return isFinite(num) && (num >= min) && (num <= max); }, @@ -410,6 +411,7 @@ * @returns {boolean} */ coordinatesInRange: function (lat, lng) { + this.writeDebug('coordinatesInRange',arguments); return this.inRange(-90, lat, 90) && this.inRange(-180, lng, 180); }, diff --git a/storelocator.jquery.json b/storelocator.jquery.json index 6b0a34e..1c555ec 100644 --- a/storelocator.jquery.json +++ b/storelocator.jquery.json @@ -3,10 +3,10 @@ "title": "jQuery Google Maps Store Locator", "description": "This jQuery plugin takes advantage of Google Maps API version 3 to create an easy to implement store locator. No back-end programming is required, you just need to feed it KML, XML, or JSON data with all the location information.", "keywords": ["jquery","locator","store","dealer","location", "locations", "maps", "map", "stores", "find"], - "version": "3.1.7", + "version": "3.1.8", "author": { "name": "Bjorn Holine", - "url": "http://www.bjornblog.com/" + "url": "https://www.bjornblog.com/" }, "repository": { "type": "git",