Skip to content

Commit 29dd0d8

Browse files
committed
Added full map start list limit setting
1 parent 86cca3c commit 29dd0d8

File tree

8 files changed

+33
-13
lines changed

8 files changed

+33
-13
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-storelocator-plugin",
3-
"version": "2.3.4",
3+
"version": "2.4.0",
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

+13-4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
'maxDistanceID' : 'bh-sl-maxdistance',
6363
'fullMapStart' : false,
6464
'fullMapStartBlank' : false,
65+
'fullMapStartListLimit' : false,
6566
'noForm' : false,
6667
'loading' : false,
6768
'loadingContainer' : 'bh-sl-loading',
@@ -2122,10 +2123,18 @@
21222123
locList.append(noResults);
21232124
}
21242125
else {
2125-
$(markers).each(function (x) {
2126-
var currentMarker = markers[x];
2127-
_this.listSetup(currentMarker, storeStart, page);
2128-
});
2126+
// Set up the location list markup
2127+
if (_this.settings.fullMapStartListLimit !== false && ! isNaN(_this.settings.fullMapStartListLimit)) {
2128+
for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
2129+
var currentMarker = markers[m];
2130+
_this.listSetup(currentMarker, storeStart, page);
2131+
}
2132+
} else {
2133+
$(markers).each(function (x) {
2134+
var currentMarker = markers[x];
2135+
_this.listSetup(currentMarker, storeStart, page);
2136+
});
2137+
}
21292138
}
21302139

21312140
// Handle clicks from the list

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

options.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
| maxDistanceID | 'bh-sl-maxdistance' | ID of the select element for the maximum distance options. |
4040
| fullMapStart | false | Set to true if you want to immediately show a map of all locations. The map will center and zoom automatically. |
4141
| fullMapStartBlank | false | Set to a zoom integer if you want to immediately show a blank map without any locations. |
42+
| fullMapStartListLimit | false | Set to a number to limit the number of items displayed in the location list with full map start. |
4243
| noForm | false | Set to true if you aren't able to use form tags (ASP.net WebForms). |
4344
| loading | false | Set to true to display a loading animated gif next to the submit button. |
4445
| loadingContainer | 'bh-sl-loading' | Class of element container that displays the loading animated gif. |

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-storelocator-plugin",
3-
"version": "2.3.4",
3+
"version": "2.4.0",
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ filtering.
3535

3636
## Changelog
3737

38-
### Version 2.3.4
38+
### Version 2.4.0
3939

4040
* Added new selected marker image options to highlight clicked marker.
4141
* Added Google Places autocomplete option and example.
42+
* Added full map start location list limit setting.
4243

4344
### Version 2.3.3
4445

src/js/jquery.storelocator.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
'maxDistanceID' : 'bh-sl-maxdistance',
6060
'fullMapStart' : false,
6161
'fullMapStartBlank' : false,
62+
'fullMapStartListLimit' : false,
6263
'noForm' : false,
6364
'loading' : false,
6465
'loadingContainer' : 'bh-sl-loading',
@@ -2119,10 +2120,18 @@
21192120
locList.append(noResults);
21202121
}
21212122
else {
2122-
$(markers).each(function (x) {
2123-
var currentMarker = markers[x];
2124-
_this.listSetup(currentMarker, storeStart, page);
2125-
});
2123+
// Set up the location list markup
2124+
if (_this.settings.fullMapStartListLimit !== false && ! isNaN(_this.settings.fullMapStartListLimit)) {
2125+
for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
2126+
var currentMarker = markers[m];
2127+
_this.listSetup(currentMarker, storeStart, page);
2128+
}
2129+
} else {
2130+
$(markers).each(function (x) {
2131+
var currentMarker = markers[x];
2132+
_this.listSetup(currentMarker, storeStart, page);
2133+
});
2134+
}
21262135
}
21272136

21282137
// Handle clicks from the list

storelocator.jquery.json

+1-1
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.3.4",
6+
"version": "2.4.0",
77
"author": {
88
"name": "Bjorn Holine",
99
"url": "http://www.bjornblog.com/"

0 commit comments

Comments
 (0)