Skip to content

Commit 1e64e92

Browse files
committed
Fixed centering issue on initial search with maxDistance enabled introduced with fitBounds updates in last update.
1 parent d389e86 commit 1e64e92

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-storelocator-plugin",
3-
"version": "3.1.5",
3+
"version": "3.1.6",
44
"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.",
55
"repository": {
66
"type": "git",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v3.1.5 - 2021-09-27
1+
/*! jQuery Google Maps Store Locator - v3.1.6 - 2021-12-04
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2021 Bjorn Holine; Licensed MIT */
44

@@ -2978,7 +2978,7 @@
29782978
(_this.settings.mapSettings.zoom === 0) ||
29792979
(typeof origin === 'undefined') ||
29802980
(distError === true) ||
2981-
(_this.settings.maxDistance === true && firstRun === false)
2981+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
29822982
) {
29832983
myOptions = _this.settings.mapSettings;
29842984
bounds = new google.maps.LatLngBounds();
@@ -3070,7 +3070,7 @@
30703070
(_this.settings.mapSettings.zoom === 0) ||
30713071
(typeof origin === 'undefined') ||
30723072
(distError === true) ||
3073-
(_this.settings.maxDistance === true && firstRun === false)
3073+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
30743074
) {
30753075
bounds.extend(point);
30763076
}
@@ -3084,7 +3084,7 @@
30843084
(_this.settings.mapSettings.zoom === 0) ||
30853085
(typeof origin === 'undefined') ||
30863086
(distError === true) ||
3087-
(_this.settings.maxDistance === true && firstRun === false)
3087+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
30883088
) {
30893089
_this.map.fitBounds(bounds);
30903090

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

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-storelocator-plugin",
3-
"version": "3.1.5",
3+
"version": "3.1.6",
44
"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.",
55
"repository": {
66
"type": "git",

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ filtering.
3535

3636
## Changelog
3737

38+
### Version 3.1.6
39+
40+
* Fixed centering issue on initial search with maxDistance enabled introduced with fitBounds updates in last update.
41+
3842
### Version 3.1.5
3943
* Added Google Maps object as a parameter for [callbackMarkerClick](callbacks/callback-markerclick.md) callback.
4044
* Added a zoom listener after fitBounds is used to prevent high zoom levels after name search and taxonomy filtering.

src/js/jquery.storelocator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,7 +2974,7 @@
29742974
(_this.settings.mapSettings.zoom === 0) ||
29752975
(typeof origin === 'undefined') ||
29762976
(distError === true) ||
2977-
(_this.settings.maxDistance === true && firstRun === false)
2977+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
29782978
) {
29792979
myOptions = _this.settings.mapSettings;
29802980
bounds = new google.maps.LatLngBounds();
@@ -3066,7 +3066,7 @@
30663066
(_this.settings.mapSettings.zoom === 0) ||
30673067
(typeof origin === 'undefined') ||
30683068
(distError === true) ||
3069-
(_this.settings.maxDistance === true && firstRun === false)
3069+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
30703070
) {
30713071
bounds.extend(point);
30723072
}
@@ -3080,7 +3080,7 @@
30803080
(_this.settings.mapSettings.zoom === 0) ||
30813081
(typeof origin === 'undefined') ||
30823082
(distError === true) ||
3083-
(_this.settings.maxDistance === true && firstRun === false)
3083+
((_this.settings.maxDistance === true && firstRun === false) && this.countFilters() > 0)
30843084
) {
30853085
_this.map.fitBounds(bounds);
30863086

storelocator.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "jQuery Google Maps Store Locator",
44
"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.",
55
"keywords": ["jquery","locator","store","dealer","location", "locations", "maps", "map", "stores", "find"],
6-
"version": "3.1.5",
6+
"version": "3.1.6",
77
"author": {
88
"name": "Bjorn Holine",
99
"url": "http://www.bjornblog.com/"

0 commit comments

Comments
 (0)