|
1 |
| -/*! jQuery Google Maps Store Locator - v3.1.5 - 2021-09-26 |
| 1 | +/*! jQuery Google Maps Store Locator - v3.1.5 - 2021-09-27 |
2 | 2 | * http://www.bjornblog.com/web/jquery-store-locator-plugin
|
3 | 3 | * Copyright (c) 2021 Bjorn Holine; Licensed MIT */
|
4 | 4 |
|
|
2899 | 2899 |
|
2900 | 2900 | // Create array for featured locations
|
2901 | 2901 | featuredset = $.grep(locationset, function (val) {
|
2902 |
| - |
2903 | 2902 | if (val.hasOwnProperty('featured')) {
|
2904 | 2903 | return val.featured === 'true';
|
2905 | 2904 | }
|
|
2910 | 2909 |
|
2911 | 2910 | // Create array for normal locations
|
2912 | 2911 | normalset = $.grep(locationset, function (val) {
|
2913 |
| - |
2914 | 2912 | if (val.hasOwnProperty('featured')) {
|
2915 |
| - return val.featured !== 'true'; |
| 2913 | + return val.featured !== 'true'; |
2916 | 2914 | }
|
2917 | 2915 | });
|
2918 | 2916 |
|
|
2975 | 2973 | _this.resultsTotalCount(locationset.length);
|
2976 | 2974 |
|
2977 | 2975 | // Google maps settings
|
2978 |
| - if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) { |
| 2976 | + if ( |
| 2977 | + (_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || |
| 2978 | + (_this.settings.mapSettings.zoom === 0) || |
| 2979 | + (typeof origin === 'undefined') || |
| 2980 | + (distError === true) || |
| 2981 | + (_this.settings.maxDistance === true && firstRun === false) |
| 2982 | + ) { |
2979 | 2983 | myOptions = _this.settings.mapSettings;
|
2980 | 2984 | bounds = new google.maps.LatLngBounds();
|
2981 | 2985 | }
|
|
3061 | 3065 | marker = _this.createMarker(point, locationset[y].name, locationset[y].address, letter, _this.map, locationset[y].category);
|
3062 | 3066 | marker.set('id', y);
|
3063 | 3067 | markers[y] = marker;
|
3064 |
| - if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) { |
| 3068 | + if ( |
| 3069 | + (_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || |
| 3070 | + (_this.settings.mapSettings.zoom === 0) || |
| 3071 | + (typeof origin === 'undefined') || |
| 3072 | + (distError === true) || |
| 3073 | + (_this.settings.maxDistance === true && firstRun === false) |
| 3074 | + ) { |
3065 | 3075 | bounds.extend(point);
|
3066 | 3076 | }
|
3067 | 3077 | // Pass variables to the pop-up infowindows
|
3068 | 3078 | _this.createInfowindow(marker, null, infowindow, storeStart, page);
|
3069 | 3079 | }
|
3070 | 3080 |
|
3071 | 3081 | // Center and zoom if no origin or zoom was provided, or distance of first marker is greater than distanceAlert
|
3072 |
| - if ((_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || (_this.settings.mapSettings.zoom === 0) || (typeof origin === 'undefined') || (distError === true)) { |
| 3082 | + if ( |
| 3083 | + (_this.settings.fullMapStart === true && firstRun === true && _this.settings.querystringParams !== true) || |
| 3084 | + (_this.settings.mapSettings.zoom === 0) || |
| 3085 | + (typeof origin === 'undefined') || |
| 3086 | + (distError === true) || |
| 3087 | + (_this.settings.maxDistance === true && firstRun === false) |
| 3088 | + ) { |
3073 | 3089 | _this.map.fitBounds(bounds);
|
3074 | 3090 |
|
3075 | 3091 | // Prevent zooming in too far after fitBounds
|
|
3086 | 3102 | locList.empty();
|
3087 | 3103 |
|
3088 | 3104 | // Set up the location list markup
|
3089 |
| - if (firstRun && _this.settings.fullMapStartListLimit !== false && !isNaN(_this.settings.fullMapStartListLimit) && _this.settings.fullMapStartListLimit !== -1 && markers.length > _this.settings.fullMapStartListLimit) { |
| 3105 | + if ( |
| 3106 | + firstRun && |
| 3107 | + _this.settings.fullMapStartListLimit !== false && |
| 3108 | + !isNaN(_this.settings.fullMapStartListLimit) && |
| 3109 | + _this.settings.fullMapStartListLimit !== -1 && |
| 3110 | + markers.length > _this.settings.fullMapStartListLimit |
| 3111 | + ) { |
3090 | 3112 | for (var m = 0; m < _this.settings.fullMapStartListLimit; m++) {
|
3091 | 3113 | var currentMarker = markers[m];
|
3092 | 3114 | _this.listSetup(currentMarker, storeStart, page);
|
|
0 commit comments