|
1 |
| -/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-08-04 |
| 1 | +/*! jQuery Google Maps Store Locator - v1.4.9 - 2014-08-07 |
2 | 2 | * http://www.bjornblog.com/web/jquery-store-locator-plugin
|
3 | 3 | * Copyright (c) 2014 Bjorn Holine; Licensed MIT */
|
4 | 4 |
|
|
16 | 16 |
|
17 | 17 | // Variables used across multiple functions
|
18 | 18 | var $this, listTemplate, infowindowTemplate, dataTypeRead, originalData, originalDataRequest, originalZoom, nameInput, addressInput, olat, olng, storeNum, directionsDisplay, directionsService;
|
19 |
| - var featuredset, locationset, normalset, markers = []; |
20 |
| - var filters = {}; |
21 |
| - var locationData = {}; |
22 |
| - var GeoCodeCalc = {}; |
| 19 | + var featuredset = [], locationset = [], normalset = [], markers = []; |
| 20 | + var filters = {}, locationData = {}, GeoCodeCalc = {}; |
23 | 21 |
|
24 | 22 | // Create the defaults once. Do not change these settings in this file - settings should be overridden in the plugin call
|
25 | 23 | var defaults = {
|
|
165 | 163 | Handlebars.registerHelper('niceURL', function(url) {
|
166 | 164 | return url.replace('https://', '').replace('http://', '');
|
167 | 165 | });
|
| 166 | + |
| 167 | + // Do taxonomy filtering if set |
| 168 | + if (this.settings.taxonomyFilters !== null) { |
| 169 | + this.taxonomyFiltering(); |
| 170 | + } |
| 171 | + |
| 172 | + // Add modal window divs if set |
| 173 | + if (this.settings.modalWindow === true) { |
| 174 | + $this.wrap('<div class="' + this.settings.overlayDiv + '"><div class="' + this.settings.modalWindowDiv + '"><div class="' + this.settings.modalContentDiv + '">'); |
| 175 | + $('.' + this.settings.modalWindowDiv).prepend('<div class="' + this.settings.closeIconDiv + '"></div>'); |
| 176 | + $('.' + this.settings.overlayDiv).hide(); |
| 177 | + } |
168 | 178 |
|
169 | 179 | // Load the templates and continue from there
|
170 | 180 | this.loadTemplates();
|
|
242 | 252 | * Primary locator function runs after the templates are loaded
|
243 | 253 | */
|
244 | 254 | locator: function () {
|
245 |
| - // Do taxonomy filtering if set |
246 |
| - if (this.settings.taxonomyFilters !== null) { |
247 |
| - this.taxonomyFiltering(); |
248 |
| - } |
249 |
| - |
250 |
| - // Add modal window divs if set |
251 |
| - if (this.settings.modalWindow === true) { |
252 |
| - $this.wrap('<div class="' + this.settings.overlayDiv + '"><div class="' + this.settings.modalWindowDiv + '"><div class="' + this.settings.modalContentDiv + '">'); |
253 |
| - $('.' + this.settings.modalWindowDiv).prepend('<div class="' + this.settings.closeIconDiv + '"></div>'); |
254 |
| - $('.' + this.settings.overlayDiv).hide(); |
255 |
| - } |
256 |
| - |
257 | 255 | if (this.settings.slideMap === true) {
|
258 | 256 | // Let's hide the map container to begin
|
259 | 257 | $this.hide();
|
|
947 | 945 | */
|
948 | 946 | mapping: function (mappingObj) {
|
949 | 947 | var _this = this;
|
950 |
| - var firstRun, marker, bounds, storeStart, storeNumToShow, myOptions; |
| 948 | + var orig_lat, orig_lng, origin, name, maxDistance, page, firstRun, marker, bounds, storeStart, storeNumToShow, myOptions; |
951 | 949 | var i = 0;
|
952 |
| - var orig_lat = mappingObj.lat; |
953 |
| - var orig_lng = mappingObj.lng; |
954 |
| - var origin = mappingObj.origin; |
955 |
| - var name = mappingObj.name; |
956 |
| - var maxDistance = mappingObj.distance; |
957 |
| - var page = mappingObj.page; |
| 950 | + if (!this.isEmptyObject(mappingObj)) { |
| 951 | + orig_lat = mappingObj.lat; |
| 952 | + orig_lng = mappingObj.lng; |
| 953 | + origin = mappingObj.origin; |
| 954 | + name = mappingObj.name; |
| 955 | + maxDistance = mappingObj.distance; |
| 956 | + page = mappingObj.page; |
| 957 | + } |
958 | 958 |
|
959 | 959 | // Remove the no results message if it was previously displayed
|
960 | 960 | if($('.bh-sl-noresults').length) {
|
|
0 commit comments