Skip to content

Commit 21eb080

Browse files
committed
Fixed issue with taxonomy filtering and autoGeocode setting where HTML Geocoding API would run on every filter change
1 parent 2989fa3 commit 21eb080

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

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

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

@@ -1587,7 +1587,7 @@
15871587
this.settings.callbackFormVals.call(this, addressInput, searchInput, distance, region);
15881588
}
15891589

1590-
if (addressInput === '' && searchInput === '') {
1590+
if (addressInput === '' && searchInput === '' && this.settings.autoGeocode !== true) {
15911591
this._start();
15921592
}
15931593
else if(addressInput !== '') {
@@ -1633,6 +1633,15 @@
16331633
mappingObj.name = searchInput;
16341634
_this.mapping(mappingObj);
16351635
}
1636+
else if (this.settings.autoGeocode === true) {
1637+
// Run the mapping function
1638+
mappingObj.lat = olat;
1639+
mappingObj.lng = olng;
1640+
mappingObj.origin = addressInput;
1641+
mappingObj.name = searchInput;
1642+
mappingObj.distance = distance;
1643+
_this.mapping(mappingObj);
1644+
}
16361645
},
16371646

16381647
/**

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

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

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ filtering.
4040
* Added callbackAutoGeoSuccess callback that fires after the geolocation API returns a successful result.
4141
* Added callbackFormVals callback that fires after the form values have been processed from the form.
4242
* Fixed issue where HTML5 Geolocation was skipped when using the fullMapStartBlank setting.
43+
* Fixed issue with taxonomy filtering and autoGeocode setting where HTML Geocoding API would run on every filter change.
4344

4445
### Version 2.7.4
4546

src/js/jquery.storelocator.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@
15841584
this.settings.callbackFormVals.call(this, addressInput, searchInput, distance, region);
15851585
}
15861586

1587-
if (addressInput === '' && searchInput === '') {
1587+
if (addressInput === '' && searchInput === '' && this.settings.autoGeocode !== true) {
15881588
this._start();
15891589
}
15901590
else if(addressInput !== '') {
@@ -1630,6 +1630,15 @@
16301630
mappingObj.name = searchInput;
16311631
_this.mapping(mappingObj);
16321632
}
1633+
else if (this.settings.autoGeocode === true) {
1634+
// Run the mapping function
1635+
mappingObj.lat = olat;
1636+
mappingObj.lng = olng;
1637+
mappingObj.origin = addressInput;
1638+
mappingObj.name = searchInput;
1639+
mappingObj.distance = distance;
1640+
_this.mapping(mappingObj);
1641+
}
16331642
},
16341643

16351644
/**

0 commit comments

Comments
 (0)