Skip to content

Commit 6d6e9f3

Browse files
committed
Reverted createMarker method and markerAlphaColor setting because of a Google Maps bug with animation an label markers https://code.google.com/p/gmaps-api-issues/issues/detail?id=8573, added a no results condition
1 parent 15fb407 commit 6d6e9f3

File tree

4 files changed

+36
-47
lines changed

4 files changed

+36
-47
lines changed

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

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

@@ -31,7 +31,6 @@
3131
},
3232
'markerImg' : null,
3333
'markerDim' : null,
34-
'markerAlphaColor' : '#000000',
3534
'catMarkers' : null,
3635
'selectedMarkerImg' : null,
3736
'selectedMarkerImgDim' : null,
@@ -1010,7 +1009,6 @@
10101009
this.writeDebug('createMarker',arguments);
10111010
var marker, markerImg, letterMarkerImg;
10121011
var categories = [];
1013-
var _this = this;
10141012

10151013
// Custom multi-marker image override (different markers for different categories
10161014
if(this.settings.catMarkers !== null) {
@@ -1037,20 +1035,16 @@
10371035

10381036
// Custom single marker image override
10391037
if(this.settings.markerImg !== null) {
1040-
if(this.settings.markerDim === null) {
1041-
markerImg = this.markerImage(this.settings.markerImg);
1042-
}
1043-
else {
1044-
markerImg = this.markerImage(this.settings.markerImg, this.settings.markerDim.width, this.settings.markerDim.height);
1045-
}
1038+
if(this.settings.markerDim === null) {
1039+
markerImg = this.markerImage(this.settings.markerImg);
1040+
}
1041+
else {
1042+
markerImg = this.markerImage(this.settings.markerImg, this.settings.markerDim.width, this.settings.markerDim.height);
1043+
}
10461044
}
10471045

10481046
// Create the default markers
1049-
if (this.settings.disableAlphaMarkers === true ||
1050-
this.settings.storeLimit === -1 ||
1051-
this.settings.storeLimit > 26 ||
1052-
this.settings.catMarkers !== null ||
1053-
(this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
1047+
if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
10541048
marker = new google.maps.Marker({
10551049
position : point,
10561050
map : map,
@@ -1059,16 +1053,17 @@
10591053
});
10601054
}
10611055
else {
1056+
// Letter markers image
1057+
letterMarkerImg = {
1058+
url: 'https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-b.png&text=' + letter + '&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48'
1059+
};
1060+
10621061
// Letter markers
10631062
marker = new google.maps.Marker({
1064-
draggable: false,
1065-
icon: markerImg, // Reverts to default marker if nothing is passed
1063+
position : point,
10661064
map : map,
1067-
label : {
1068-
text: letter,
1069-
color: _this.settings.markerAlphaColor
1070-
},
1071-
position : point
1065+
icon : letterMarkerImg,
1066+
draggable: false
10721067
});
10731068
}
10741069

@@ -2434,7 +2429,7 @@
24342429
}
24352430

24362431
// Handle no results
2437-
if (_this.isEmptyObject(locationset)) {
2432+
if (_this.isEmptyObject(locationset) || locationset[0].result === 'none') {
24382433
_this.emptyResult();
24392434
return;
24402435
}

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
| regionID | 'bh-sl-region' | ID of the region select form field for country region biasing. |
99
| mapSettings | { zoom : 12, mapTypeId: google.maps.MapTypeId.ROADMAP } | Google maps settings object. Add all settings including zoom and map type if overriding. Set zoom to 0 to automatically center and zoom to show all display markers on the map |
1010
| markerImg | null | Replacement marker image used for all locations |
11-
| markerAlphaColor | '#000000' | Marker letter color. |
1211
| markerDim | null | Replacement marker dimensions object - ex value: { height: 20, width: 20 } |
1312
| catMarkers | null | Multiple replacement marker images based on categories object. Value should be array with image path followed by dimensions - ex value: catMarkers : {'Restaurant' : ['img/red-marker.svg', 32, 32]}
1413
| selectedMarkerImg | null | Selected marker image. |

src/js/jquery.storelocator.js

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
},
2929
'markerImg' : null,
3030
'markerDim' : null,
31-
'markerAlphaColor' : '#000000',
3231
'catMarkers' : null,
3332
'selectedMarkerImg' : null,
3433
'selectedMarkerImgDim' : null,
@@ -1007,7 +1006,6 @@
10071006
this.writeDebug('createMarker',arguments);
10081007
var marker, markerImg, letterMarkerImg;
10091008
var categories = [];
1010-
var _this = this;
10111009

10121010
// Custom multi-marker image override (different markers for different categories
10131011
if(this.settings.catMarkers !== null) {
@@ -1034,20 +1032,16 @@
10341032

10351033
// Custom single marker image override
10361034
if(this.settings.markerImg !== null) {
1037-
if(this.settings.markerDim === null) {
1038-
markerImg = this.markerImage(this.settings.markerImg);
1039-
}
1040-
else {
1041-
markerImg = this.markerImage(this.settings.markerImg, this.settings.markerDim.width, this.settings.markerDim.height);
1042-
}
1035+
if(this.settings.markerDim === null) {
1036+
markerImg = this.markerImage(this.settings.markerImg);
1037+
}
1038+
else {
1039+
markerImg = this.markerImage(this.settings.markerImg, this.settings.markerDim.width, this.settings.markerDim.height);
1040+
}
10431041
}
10441042

10451043
// Create the default markers
1046-
if (this.settings.disableAlphaMarkers === true ||
1047-
this.settings.storeLimit === -1 ||
1048-
this.settings.storeLimit > 26 ||
1049-
this.settings.catMarkers !== null ||
1050-
(this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
1044+
if (this.settings.disableAlphaMarkers === true || this.settings.storeLimit === -1 || this.settings.storeLimit > 26 || this.settings.catMarkers !== null || this.settings.markerImg !== null || (this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
10511045
marker = new google.maps.Marker({
10521046
position : point,
10531047
map : map,
@@ -1056,16 +1050,17 @@
10561050
});
10571051
}
10581052
else {
1053+
// Letter markers image
1054+
letterMarkerImg = {
1055+
url: 'https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-b.png&text=' + letter + '&psize=16&font=fonts/Roboto-Regular.ttf&color=ff333333&ax=44&ay=48'
1056+
};
1057+
10591058
// Letter markers
10601059
marker = new google.maps.Marker({
1061-
draggable: false,
1062-
icon: markerImg, // Reverts to default marker if nothing is passed
1060+
position : point,
10631061
map : map,
1064-
label : {
1065-
text: letter,
1066-
color: _this.settings.markerAlphaColor
1067-
},
1068-
position : point
1062+
icon : letterMarkerImg,
1063+
draggable: false
10691064
});
10701065
}
10711066

@@ -2431,7 +2426,7 @@
24312426
}
24322427

24332428
// Handle no results
2434-
if (_this.isEmptyObject(locationset)) {
2429+
if (_this.isEmptyObject(locationset) || locationset[0].result === 'none') {
24352430
_this.emptyResult();
24362431
return;
24372432
}

0 commit comments

Comments
 (0)