Skip to content

Commit e86b863

Browse files
committed
Added autoCompleteDisableListener setting to disable the listener that immediately triggers a search when an auto complete location option is selected, fixed Handlebars targeting issue triggered by placing an unordered list within the location list template
1 parent 69e7ea5 commit e86b863

File tree

8 files changed

+232
-221
lines changed

8 files changed

+232
-221
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": "2.7.2",
3+
"version": "2.7.3",
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: 109 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! jQuery Google Maps Store Locator - v2.7.2 - 2016-12-03
1+
/*! jQuery Google Maps Store Locator - v2.7.3 - 2017-03-21
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
3-
* Copyright (c) 2016 Bjorn Holine; Licensed MIT */
3+
* Copyright (c) 2017 Bjorn Holine; Licensed MIT */
44

55
;(function ($, window, document, undefined) {
66
'use strict';
@@ -19,109 +19,111 @@
1919

2020
// Create the defaults once. DO NOT change these settings in this file - settings should be overridden in the plugin call
2121
var defaults = {
22-
'mapID' : 'bh-sl-map',
23-
'locationList' : 'bh-sl-loc-list',
24-
'formContainer' : 'bh-sl-form-container',
25-
'formID' : 'bh-sl-user-location',
26-
'addressID' : 'bh-sl-address',
27-
'regionID' : 'bh-sl-region',
28-
'mapSettings' : {
29-
zoom : 12,
30-
mapTypeId: google.maps.MapTypeId.ROADMAP
31-
},
32-
'markerImg' : null,
33-
'markerDim' : null,
34-
'catMarkers' : null,
35-
'selectedMarkerImg' : null,
36-
'selectedMarkerImgDim' : null,
37-
'disableAlphaMarkers' : false,
38-
'lengthUnit' : 'm',
39-
'storeLimit' : 26,
40-
'distanceAlert' : 60,
41-
'dataType' : 'xml',
42-
'dataLocation' : 'data/locations.xml',
43-
'dataRaw' : null,
44-
'xmlElement' : 'marker',
45-
'listColor1' : '#ffffff',
46-
'listColor2' : '#eeeeee',
47-
'originMarker' : false,
48-
'originMarkerImg' : null,
49-
'originMarkerDim' : null,
50-
'bounceMarker' : true,
51-
'slideMap' : true,
52-
'modal' : false,
53-
'overlay' : 'bh-sl-overlay',
54-
'modalWindow' : 'bh-sl-modal-window',
55-
'modalContent' : 'bh-sl-modal-content',
56-
'closeIcon' : 'bh-sl-close-icon',
57-
'defaultLoc' : false,
58-
'defaultLat' : null,
59-
'defaultLng' : null,
60-
'autoComplete' : false,
61-
'autoCompleteOptions' : {},
62-
'autoGeocode' : false,
63-
'geocodeID' : null,
64-
'maxDistance' : false,
65-
'maxDistanceID' : 'bh-sl-maxdistance',
66-
'fullMapStart' : false,
67-
'fullMapStartBlank' : false,
68-
'fullMapStartListLimit' : false,
69-
'noForm' : false,
70-
'loading' : false,
71-
'loadingContainer' : 'bh-sl-loading',
72-
'featuredLocations' : false,
73-
'pagination' : false,
74-
'locationsPerPage' : 10,
75-
'inlineDirections' : false,
76-
'nameSearch' : false,
77-
'searchID' : 'bh-sl-search',
78-
'nameAttribute' : 'name',
79-
'visibleMarkersList' : false,
80-
'dragSearch' : false,
81-
'infowindowTemplatePath' : 'assets/js/plugins/storeLocator/templates/infowindow-description.html',
82-
'listTemplatePath' : 'assets/js/plugins/storeLocator/templates/location-list-description.html',
83-
'KMLinfowindowTemplatePath': 'assets/js/plugins/storeLocator/templates/kml-infowindow-description.html',
84-
'KMLlistTemplatePath' : 'assets/js/plugins/storeLocator/templates/kml-location-list-description.html',
85-
'listTemplateID' : null,
86-
'infowindowTemplateID' : null,
87-
'taxonomyFilters' : null,
88-
'taxonomyFiltersContainer' : 'bh-sl-filters-container',
89-
'exclusiveFiltering' : false,
90-
'querystringParams' : false,
91-
'debug' : false,
92-
'sessionStorage' : false,
93-
'markerCluster' : null,
94-
'infoBubble' : null,
22+
'mapID' : 'bh-sl-map',
23+
'locationList' : 'bh-sl-loc-list',
24+
'formContainer' : 'bh-sl-form-container',
25+
'formID' : 'bh-sl-user-location',
26+
'addressID' : 'bh-sl-address',
27+
'regionID' : 'bh-sl-region',
28+
'mapSettings': {
29+
gestureHandling: 'cooperative',
30+
mapTypeId: google.maps.MapTypeId.ROADMAP,
31+
zoom: 12
32+
},
33+
'markerImg' : null,
34+
'markerDim' : null,
35+
'catMarkers' : null,
36+
'selectedMarkerImg' : null,
37+
'selectedMarkerImgDim' : null,
38+
'disableAlphaMarkers' : false,
39+
'lengthUnit' : 'm',
40+
'storeLimit' : 26,
41+
'distanceAlert' : 60,
42+
'dataType' : 'xml',
43+
'dataLocation' : 'data/locations.xml',
44+
'dataRaw' : null,
45+
'xmlElement' : 'marker',
46+
'listColor1' : '#ffffff',
47+
'listColor2' : '#eeeeee',
48+
'originMarker' : false,
49+
'originMarkerImg' : null,
50+
'originMarkerDim' : null,
51+
'bounceMarker' : true,
52+
'slideMap' : true,
53+
'modal' : false,
54+
'overlay' : 'bh-sl-overlay',
55+
'modalWindow' : 'bh-sl-modal-window',
56+
'modalContent' : 'bh-sl-modal-content',
57+
'closeIcon' : 'bh-sl-close-icon',
58+
'defaultLoc' : false,
59+
'defaultLat' : null,
60+
'defaultLng' : null,
61+
'autoComplete' : false,
62+
'autoCompleteOptions' : {},
63+
'autoCompleteDisableListener': false,
64+
'autoGeocode' : false,
65+
'geocodeID' : null,
66+
'maxDistance' : false,
67+
'maxDistanceID' : 'bh-sl-maxdistance',
68+
'fullMapStart' : false,
69+
'fullMapStartBlank' : false,
70+
'fullMapStartListLimit' : false,
71+
'noForm' : false,
72+
'loading' : false,
73+
'loadingContainer' : 'bh-sl-loading',
74+
'featuredLocations' : false,
75+
'pagination' : false,
76+
'locationsPerPage' : 10,
77+
'inlineDirections' : false,
78+
'nameSearch' : false,
79+
'searchID' : 'bh-sl-search',
80+
'nameAttribute' : 'name',
81+
'visibleMarkersList' : false,
82+
'dragSearch' : false,
83+
'infowindowTemplatePath' : 'assets/js/plugins/storeLocator/templates/infowindow-description.html',
84+
'listTemplatePath' : 'assets/js/plugins/storeLocator/templates/location-list-description.html',
85+
'KMLinfowindowTemplatePath' : 'assets/js/plugins/storeLocator/templates/kml-infowindow-description.html',
86+
'KMLlistTemplatePath' : 'assets/js/plugins/storeLocator/templates/kml-location-list-description.html',
87+
'listTemplateID' : null,
88+
'infowindowTemplateID' : null,
89+
'taxonomyFilters' : null,
90+
'taxonomyFiltersContainer' : 'bh-sl-filters-container',
91+
'exclusiveFiltering' : false,
92+
'querystringParams' : false,
93+
'debug' : false,
94+
'sessionStorage' : false,
95+
'markerCluster' : null,
96+
'infoBubble' : null,
9597
// Callbacks
96-
'callbackNotify' : null,
97-
'callbackRegion' : null,
98-
'callbackBeforeSend' : null,
99-
'callbackSuccess' : null,
100-
'callbackModalOpen' : null,
101-
'callbackModalReady' : null,
102-
'callbackModalClose' : null,
103-
'callbackJsonp' : null,
104-
'callbackCreateMarker' : null,
105-
'callbackPageChange' : null,
106-
'callbackDirectionsRequest': null,
107-
'callbackCloseDirections' : null,
108-
'callbackNoResults' : null,
109-
'callbackListClick' : null,
110-
'callbackMarkerClick' : null,
111-
'callbackFilters' : null,
112-
'callbackMapSet' : null,
98+
'callbackNotify' : null,
99+
'callbackRegion' : null,
100+
'callbackBeforeSend' : null,
101+
'callbackSuccess' : null,
102+
'callbackModalOpen' : null,
103+
'callbackModalReady' : null,
104+
'callbackModalClose' : null,
105+
'callbackJsonp' : null,
106+
'callbackCreateMarker' : null,
107+
'callbackPageChange' : null,
108+
'callbackDirectionsRequest' : null,
109+
'callbackCloseDirections' : null,
110+
'callbackNoResults' : null,
111+
'callbackListClick' : null,
112+
'callbackMarkerClick' : null,
113+
'callbackFilters' : null,
114+
'callbackMapSet' : null,
113115
// Language options
114-
'addressErrorAlert' : 'Unable to find address',
115-
'autoGeocodeErrorAlert' : 'Automatic location detection failed. Please fill in your address or zip code.',
116-
'distanceErrorAlert' : 'Unfortunately, our closest location is more than ',
117-
'mileLang' : 'mile',
118-
'milesLang' : 'miles',
119-
'kilometerLang' : 'kilometer',
120-
'kilometersLang' : 'kilometers',
121-
'noResultsTitle' : 'No results',
122-
'noResultsDesc' : 'No locations were found with the given criteria. Please modify your selections or input.',
123-
'nextPage' : 'Next »',
124-
'prevPage' : '« Prev'
116+
'addressErrorAlert' : 'Unable to find address',
117+
'autoGeocodeErrorAlert' : 'Automatic location detection failed. Please fill in your address or zip code.',
118+
'distanceErrorAlert' : 'Unfortunately, our closest location is more than ',
119+
'mileLang' : 'mile',
120+
'milesLang' : 'miles',
121+
'kilometerLang' : 'kilometer',
122+
'kilometersLang' : 'kilometers',
123+
'noResultsTitle' : 'No results',
124+
'noResultsDesc' : 'No locations were found with the given criteria. Please modify your selections or input.',
125+
'nextPage' : 'Next »',
126+
'prevPage' : '« Prev'
125127
};
126128

127129
// Plugin constructor
@@ -200,7 +202,7 @@
200202
var autoPlaces = new google.maps.places.Autocomplete(searchInput, this.settings.autoCompleteOptions);
201203

202204
// Add listener when autoComplete selection changes.
203-
if (this.settings.autoComplete === true) {
205+
if (this.settings.autoComplete === true && this.settings.autoCompleteDisableListener !== true) {
204206
autoPlaces.addListener('place_changed', function(e) {
205207
_this.processForm(e);
206208
});
@@ -1159,7 +1161,7 @@
11591161

11601162
// Set up the list template with the location data
11611163
var listHtml = listTemplate(locations);
1162-
$('.' + this.settings.locationList + ' ul').append(listHtml);
1164+
$('.' + this.settings.locationList + ' > ul').append(listHtml);
11631165
},
11641166

11651167
/**
@@ -1807,7 +1809,7 @@
18071809

18081810
// Set up the filters
18091811
_this.taxonomyFiltersInit();
1810-
1812+
18111813
// Check query string for taxonomy parameter keys.
18121814
_this.checkQueryStringFilters();
18131815

@@ -1931,7 +1933,7 @@
19311933

19321934
// Set up the list template with the location data
19331935
listHtml = listTemplate(locations);
1934-
$('.' + _this.settings.locationList + ' ul').append(listHtml);
1936+
$('.' + _this.settings.locationList + ' > ul').append(listHtml);
19351937
}
19361938
});
19371939

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

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

options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
| defaultLng | null | If using defaultLoc, set this to the default location longitude. |
3838
| autoComplete | false | Set to true to enable Google Places autocomplete. Note the slight markup differences in the example file. |
3939
| autoCompleteOptions | {} | Google Places autocomplete [options object](https://developers.google.com/maps/documentation/javascript/places-autocomplete#add_autocomplete). |
40+
| autoCompleteDisableListener | false | Disable the listener that immediately triggers a search when an auto complete location option is selected. |
4041
| autoGeocode | false | Set to true if you want to use the HTML5 geolocation API (good for mobile) to geocode the user's location. |
4142
| geocodeID | null | Set to the ID of an element to connect the HTML5 geolocation API to a button instead of firing automatically. |
4243
| maxDistance | false | Set to true if you want to give users an option to limit the distance from their location to the markers. |

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": "2.7.2",
3+
"version": "2.7.3",
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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ filtering.
3535

3636
## Changelog
3737

38+
### Version 2.7.3
39+
40+
* Added autoCompleteDisableListener setting to disable the listener that immediately triggers a search when an auto complete location option is selected.
41+
* Added gestureHandling to mapSettings with cooperative as the default for mobile scrolling.
42+
* Fixed Handlebars targeting issue triggered by placing an unordered list within the location list template.
43+
3844
### Version 2.7.2
3945

4046
* Added [callbackRegion](callbacks/callback-region.md) callback, which allows region to be set before being sent to the Google Maps Geocoding API.
@@ -446,4 +452,4 @@ Left a couple of console.logs in my code, which was causing IE to hang.
446452

447453
### Version 1.0
448454

449-
This is my first jQuery plugin and the first time I’ve published anything on Github. Let me know if I can improve something or if I’m making some kind of mistake.
455+
This is my first jQuery plugin and the first time I’ve published anything on Github. Let me know if I can improve something or if I’m making some kind of mistake.

0 commit comments

Comments
 (0)