Skip to content

Commit 12b1e14

Browse files
committed
Fixed issue with fullMapStart where conditional was checking if isNaN was true when it should have been false on fullMapStartListLimit setting, updated zooming to prevent fitBounds from being used when query string parameters are in use and the location has been set with bh-sl-address
1 parent 6c8f88d commit 12b1e14

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
/*! jQuery Google Maps Store Locator - v2.7.3 - 2017-05-03
1+
/*! jQuery Google Maps Store Locator - v2.7.3 - 2017-05-07
2+
* http://www.bjornblog.com/web/jquery-store-locator-plugin
3+
* Copyright (c) 2017 Bjorn Holine; Licensed MIT */
4+
5+
/*! jQuery Google Maps Store Locator - v2.7.3 - 2017-05-07
26
* http://www.bjornblog.com/web/jquery-store-locator-plugin
37
* Copyright (c) 2017 Bjorn Holine; Licensed MIT */
48

@@ -2527,7 +2531,7 @@
25272531
_this.modalWindow();
25282532

25292533
// Avoid error if number of locations is less than the default of 26
2530-
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
2534+
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (!isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
25312535
storeNum = locationset.length;
25322536
}
25332537
else {
@@ -2555,7 +2559,7 @@
25552559
_this.resultsTotalCount(locationset.length);
25562560

25572561
// Google maps settings
2558-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2562+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
25592563
myOptions = _this.settings.mapSettings;
25602564
bounds = new google.maps.LatLngBounds();
25612565
}
@@ -2642,15 +2646,15 @@
26422646
marker = _this.createMarker(point, locationset[y].name, locationset[y].address, letter, _this.map, locationset[y].category);
26432647
marker.set('id', y);
26442648
markers[y] = marker;
2645-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2649+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
26462650
bounds.extend(point);
26472651
}
26482652
// Pass variables to the pop-up infowindows
26492653
_this.createInfowindow(marker, null, infowindow, storeStart, page);
26502654
}
26512655

26522656
// Center and zoom if no origin or zoom was provided, or distance of first marker is greater than distanceAlert
2653-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2657+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
26542658
_this.map.fitBounds(bounds);
26552659
}
26562660

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

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ filtering.
4040
* Added ability to indicate multiple query string parameter values (for checkboxes) with a comma separated list value.
4141
* Added autoCompleteDisableListener setting to disable the listener that immediately triggers a search when an auto complete location option is selected.
4242
* Added blur to primary location input field after form submission to hide mobile keyboards.
43-
* Added functionality to select/check filters on load from query string parameter values.
43+
* Added functionality to automatically select/check filters on load from query string parameter values.
4444
* Added location details object to callbackListClick and callbackMarkerClick objects.
4545
* Fixed broken dragSearch functionality that was introduced after map scope pull request was merged.
4646
* Fixed Handlebars targeting issue triggered by placing an unordered list within the location list template.
47+
* Fixed issue with fullMapStart where conditional was checking if isNaN was true when it should have been false on fullMapStartListLimit setting.
4748
* Updated callbackListClick documentation to include second market object parameter.
49+
* Updated zooming to prevent fitBounds from being used when query string parameters are in use and the location has been set with bh-sl-address.
4850

4951
### Version 2.7.2
5052

src/js/jquery.storelocator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@
25242524
_this.modalWindow();
25252525

25262526
// Avoid error if number of locations is less than the default of 26
2527-
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
2527+
if (_this.settings.storeLimit === -1 || locationset.length < _this.settings.storeLimit || (this.settings.fullMapStart === true && firstRun === true && (!isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
25282528
storeNum = locationset.length;
25292529
}
25302530
else {
@@ -2552,7 +2552,7 @@
25522552
_this.resultsTotalCount(locationset.length);
25532553

25542554
// Google maps settings
2555-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2555+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
25562556
myOptions = _this.settings.mapSettings;
25572557
bounds = new google.maps.LatLngBounds();
25582558
}
@@ -2639,15 +2639,15 @@
26392639
marker = _this.createMarker(point, locationset[y].name, locationset[y].address, letter, _this.map, locationset[y].category);
26402640
marker.set('id', y);
26412641
markers[y] = marker;
2642-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2642+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
26432643
bounds.extend(point);
26442644
}
26452645
// Pass variables to the pop-up infowindows
26462646
_this.createInfowindow(marker, null, infowindow, storeStart, page);
26472647
}
26482648

26492649
// Center and zoom if no origin or zoom was provided, or distance of first marker is greater than distanceAlert
2650-
if ((_this.settings.fullMapStart === true && firstRun === true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
2650+
if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) {
26512651
_this.map.fitBounds(bounds);
26522652
}
26532653

0 commit comments

Comments
 (0)