Skip to content

Commit 0a8a036

Browse files
committed
Added max distance query string compatibility, fixed options.md maxDistanceID default value
1 parent 9f32003 commit 0a8a036

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

dist/assets/js/plugins/storeLocator/jquery.storelocator.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v2.0.8 - 2015-04-21
1+
/*! jQuery Google Maps Store Locator - v2.0.8 - 2015-04-29
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2015 Bjorn Holine; Licensed MIT */
44

@@ -472,7 +472,7 @@
472472

473473
// If show full map option is true
474474
if (this.settings.fullMapStart === true) {
475-
if(this.settings.querystringParams === true && this.getQueryString(this.settings.addressID) || this.getQueryString(this.settings.searchID)) {
475+
if((this.settings.querystringParams === true && this.getQueryString(this.settings.addressID)) || (this.settings.querystringParams === true && this.getQueryString(this.settings.searchID)) || (this.settings.querystringParams === true && this.getQueryString(this.settings.maxDistanceID))) {
476476
this.processForm(null);
477477
}
478478
else {
@@ -1230,7 +1230,15 @@
12301230

12311231
// Create the array
12321232
if (this.settings.maxDistance === true && firstRun !== true && typeof maxDistance !== 'undefined' && maxDistance !== null) {
1233-
if (data.distance < maxDistance) {
1233+
if (data.distance <= maxDistance) {
1234+
locationset.push( data );
1235+
}
1236+
else {
1237+
return;
1238+
}
1239+
}
1240+
else if(this.settings.maxDistance === true && this.settings.querystringParams === true && this.settings.maxDistance === true && typeof maxDistance !== 'undefined' && maxDistance !== null) {
1241+
if (data.distance <= maxDistance) {
12341242
locationset.push( data );
12351243
}
12361244
else {

0 commit comments

Comments
 (0)