Skip to content

Commit 65dfbcd

Browse files
committed
Changed letter marker setup and added letter color override setting
1 parent 7b40a55 commit 65dfbcd

File tree

5 files changed

+36
-24
lines changed

5 files changed

+36
-24
lines changed

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

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

@@ -31,6 +31,7 @@
3131
},
3232
'markerImg' : null,
3333
'markerDim' : null,
34+
'markerAlphaColor' : '#000000',
3435
'catMarkers' : null,
3536
'selectedMarkerImg' : null,
3637
'selectedMarkerImgDim' : null,
@@ -91,7 +92,7 @@
9192
'debug' : false,
9293
'sessionStorage' : false,
9394
'markerCluster' : null,
94-
'infoBubble' : null,
95+
'infoBubble' : null,
9596
'callbackNotify' : null,
9697
'callbackBeforeSend' : null,
9798
'callbackSuccess' : null,
@@ -949,6 +950,7 @@
949950
this.writeDebug('createMarker',arguments);
950951
var marker, markerImg, letterMarkerImg;
951952
var categories = [];
953+
var _this = this;
952954

953955
// Custom multi-marker image override (different markers for different categories
954956
if(this.settings.catMarkers !== null) {
@@ -984,7 +986,11 @@
984986
}
985987

986988
// Create the default markers
987-
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))) {
989+
if (this.settings.disableAlphaMarkers === true ||
990+
this.settings.storeLimit === -1 ||
991+
this.settings.storeLimit > 26 ||
992+
this.settings.catMarkers !== null ||
993+
(this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
988994
marker = new google.maps.Marker({
989995
position : point,
990996
map : map,
@@ -993,17 +999,16 @@
993999
});
9941000
}
9951001
else {
996-
// Letter markers image
997-
letterMarkerImg = {
998-
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'
999-
};
1000-
10011002
// Letter markers
10021003
marker = new google.maps.Marker({
1003-
position : point,
1004+
draggable: false,
1005+
icon: markerImg, // Reverts to default marker if nothing is passed
10041006
map : map,
1005-
icon : letterMarkerImg,
1006-
draggable: false
1007+
label : {
1008+
text: letter,
1009+
color: _this.settings.markerAlphaColor
1010+
},
1011+
position : point
10071012
});
10081013
}
10091014

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
@@ -8,6 +8,7 @@
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. |
1112
| markerDim | null | Replacement marker dimensions object - ex value: { height: 20, width: 20 } |
1213
| 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]}
1314
| selectedMarkerImg | null | Selected marker image. |

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ filtering.
3838
### Version 2.6.3
3939

4040
* Added [InfoBubble](https://github.com/googlemaps/js-info-bubble) support and example file.
41+
* Added markerAlphaColor setting to change the marker letter color.
4142
* Added query string parameter filter check so that results can be filtered with URL query strings.
4243

4344
### Version 2.6.2

src/js/jquery.storelocator.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
'markerImg' : null,
3030
'markerDim' : null,
31+
'markerAlphaColor' : '#000000',
3132
'catMarkers' : null,
3233
'selectedMarkerImg' : null,
3334
'selectedMarkerImgDim' : null,
@@ -88,7 +89,7 @@
8889
'debug' : false,
8990
'sessionStorage' : false,
9091
'markerCluster' : null,
91-
'infoBubble' : null,
92+
'infoBubble' : null,
9293
'callbackNotify' : null,
9394
'callbackBeforeSend' : null,
9495
'callbackSuccess' : null,
@@ -946,6 +947,7 @@
946947
this.writeDebug('createMarker',arguments);
947948
var marker, markerImg, letterMarkerImg;
948949
var categories = [];
950+
var _this = this;
949951

950952
// Custom multi-marker image override (different markers for different categories
951953
if(this.settings.catMarkers !== null) {
@@ -981,7 +983,11 @@
981983
}
982984

983985
// Create the default markers
984-
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))) {
986+
if (this.settings.disableAlphaMarkers === true ||
987+
this.settings.storeLimit === -1 ||
988+
this.settings.storeLimit > 26 ||
989+
this.settings.catMarkers !== null ||
990+
(this.settings.fullMapStart === true && firstRun === true && (isNaN(this.settings.fullMapStartListLimit) || this.settings.fullMapStartListLimit > 26 || this.settings.fullMapStartListLimit === -1))) {
985991
marker = new google.maps.Marker({
986992
position : point,
987993
map : map,
@@ -990,17 +996,16 @@
990996
});
991997
}
992998
else {
993-
// Letter markers image
994-
letterMarkerImg = {
995-
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'
996-
};
997-
998999
// Letter markers
9991000
marker = new google.maps.Marker({
1000-
position : point,
1001+
draggable: false,
1002+
icon: markerImg, // Reverts to default marker if nothing is passed
10011003
map : map,
1002-
icon : letterMarkerImg,
1003-
draggable: false
1004+
label : {
1005+
text: letter,
1006+
color: _this.settings.markerAlphaColor
1007+
},
1008+
position : point
10041009
});
10051010
}
10061011

0 commit comments

Comments
 (0)