Skip to content

Commit f208830

Browse files
committed
Added callbackMapSet callback that fires after the map has been set up, fixed issue where locations without attributes could get those attribute values from prior locations
1 parent 304c34d commit f208830

File tree

8 files changed

+26
-7
lines changed

8 files changed

+26
-7
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.6.1",
3+
"version": "2.6.2",
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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jQuery Google Maps Store Locator - v2.6.1 - 2016-07-02
1+
/*! jQuery Google Maps Store Locator - v2.6.2 - 2016-07-16
22
* http://www.bjornblog.com/web/jquery-store-locator-plugin
33
* Copyright (c) 2016 Bjorn Holine; Licensed MIT */
44

@@ -105,6 +105,7 @@
105105
'callbackListClick' : null,
106106
'callbackMarkerClick' : null,
107107
'callbackFilters' : null,
108+
'callbackMapSet' : null,
108109
// Language options
109110
'addressErrorAlert' : 'Unable to find address',
110111
'autoGeocodeErrorAlert' : 'Automatic location detection failed. Please fill in your address or zip code.',
@@ -752,6 +753,7 @@
752753
_createLocationVariables: function (loopcount) {
753754
this.writeDebug('_createLocationVariables',arguments);
754755
var value;
756+
locationData = {};
755757

756758
for (var key in locationset[loopcount]) {
757759
if (locationset[loopcount].hasOwnProperty(key)) {
@@ -2228,6 +2230,11 @@
22282230
// Load the map
22292231
$this.data(_this.settings.mapID.replace('#', ''), map);
22302232

2233+
// Map set callback.
2234+
if (_this.settings.callbackMapSet) {
2235+
_this.settings.callbackMapSet.call(this, map, originPoint, originalZoom, myOptions);
2236+
}
2237+
22312238
// Initialize the infowondow
22322239
var infowindow = new google.maps.InfoWindow();
22332240

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.

options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
| callbackListClick | null | Callback that fires when a list element is clicked in the location list. |
8484
| callbackMarkerClick | null | Callback that fires when a map marker is clicked. |
8585
| callbackFilters | null | Callback that fires when a filter is changed. |
86+
| callbackMapSet | null | Callback that fires after the map is set up. |
8687
| addressErrorAlert | 'Unable to find address' | Language setting |
8788
| autoGeocodeErrorAlert | 'Automatic location detection failed. Please fill in your address or zip code.' | Language setting |
8889
| distanceErrorAlert | 'Unfortunately, our closest location is more than ' | Language setting |

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.6.1",
3+
"version": "2.6.2",
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 2.6.2
39+
* Added callbackMapSet callback that fires after the map has been set up.
40+
* Fixed issue where locations without attributes could get those attribute values from prior locations.
41+
3842
### Version 2.6.1
3943

4044
* Added additional error handling when the plugin checks the closest location.

src/js/jquery.storelocator.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
'callbackListClick' : null,
103103
'callbackMarkerClick' : null,
104104
'callbackFilters' : null,
105+
'callbackMapSet' : null,
105106
// Language options
106107
'addressErrorAlert' : 'Unable to find address',
107108
'autoGeocodeErrorAlert' : 'Automatic location detection failed. Please fill in your address or zip code.',
@@ -749,6 +750,7 @@
749750
_createLocationVariables: function (loopcount) {
750751
this.writeDebug('_createLocationVariables',arguments);
751752
var value;
753+
locationData = {};
752754

753755
for (var key in locationset[loopcount]) {
754756
if (locationset[loopcount].hasOwnProperty(key)) {
@@ -2225,6 +2227,11 @@
22252227
// Load the map
22262228
$this.data(_this.settings.mapID.replace('#', ''), map);
22272229

2230+
// Map set callback.
2231+
if (_this.settings.callbackMapSet) {
2232+
_this.settings.callbackMapSet.call(this, map, originPoint, originalZoom, myOptions);
2233+
}
2234+
22282235
// Initialize the infowondow
22292236
var infowindow = new google.maps.InfoWindow();
22302237

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", "location", "locations", "maps", "map", "stores", "find"],
6-
"version": "2.6.1",
6+
"version": "2.6.2",
77
"author": {
88
"name": "Bjorn Holine",
99
"url": "http://www.bjornblog.com/"

0 commit comments

Comments
 (0)