Skip to content

Commit 2dc756a

Browse files
committed
1.4.1 minor updates
1 parent 74dee02 commit 2dc756a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

js/jquery.storelocator.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* storeLocator v1.4 - jQuery Google Maps store locator plugin
2+
* storeLocator v1.4.1 - jQuery Google Maps store locator plugin
33
* (c) Copyright 2012, Bjorn Holine (http://www.bjornblog.com)
44
* Released under the MIT license
55
* Distance calculation function by Chris Pietschmann: http://pietschsoft.com/post/2008/02/01/Calculate-Distance-Between-Geocodes-in-C-and-JavaScript.aspx
@@ -95,7 +95,7 @@ $.fn.storeLocator = function(options) {
9595
}
9696

9797
var userinput, olat, olng, marker, letter, storenum;
98-
var locationset = new Array();
98+
var locationset = [];
9999

100100
//Calculate geocode distance functions - you could use Google's distance service instead
101101
var GeoCodeCalc = {};
@@ -325,7 +325,6 @@ $.fn.storeLocator = function(options) {
325325

326326
//After the store locations file has been read successfully
327327
var i = 0;
328-
var locationset = new Array();
329328
$('#' + settings.mapDiv).addClass('mapOpen');
330329

331330
//Depending on your data structure and what you want to include in the maps, you may need to change the following variables or comment them out
@@ -353,14 +352,14 @@ $.fn.storeLocator = function(options) {
353352
//Create the array
354353
if(settings.maxDistance === true){
355354
if(distance < maxDistance){
356-
locationset[i] = new Array(distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3);
355+
locationset[i] = [distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3];
357356
}
358357
else{
359358
return;
360359
}
361360
}
362361
else{
363-
locationset[i] = new Array(distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3);
362+
locationset[i] = [distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3];
364363
}
365364

366365
i++;
@@ -380,14 +379,14 @@ $.fn.storeLocator = function(options) {
380379
//Create the array
381380
if(settings.maxDistance === true){
382381
if(distance < maxDistance){
383-
locationset[i] = new Array(distance, name, lat, lng, description);
382+
locationset[i] = [distance, name, lat, lng, description];
384383
}
385384
else{
386385
return;
387386
}
388387
}
389388
else{
390-
locationset[i] = new Array(distance, name, lat, lng, description);
389+
locationset[i] = [distance, name, lat, lng, description];
391390
}
392391

393392
i++;
@@ -417,14 +416,14 @@ $.fn.storeLocator = function(options) {
417416
//Create the array
418417
if(settings.maxDistance === true){
419418
if(distance < maxDistance){
420-
locationset[i] = new Array(distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3);
419+
locationset[i] = [distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3];
421420
}
422421
else{
423422
return;
424423
}
425424
}
426425
else{
427-
locationset[i] = new Array(distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3);
426+
locationset[i] = [distance, name, lat, lng, address, address2, city, state, postal, phone, web, hours1, hours2, hours3];
428427
}
429428

430429
i++;
@@ -611,7 +610,7 @@ $.fn.storeLocator = function(options) {
611610
}
612611

613612
var map = new google.maps.Map(document.getElementById(settings.mapDiv),myOptions);
614-
var markers = new Array();
613+
var markers = [];
615614
//Create one infowindow to fill later
616615
var infowindow = new google.maps.InfoWindow();
617616

@@ -679,7 +678,7 @@ $.fn.storeLocator = function(options) {
679678
}
680679

681680
//Handle clicks from the list
682-
$(document).on('click', '#loc-list li', function(){
681+
$(document).on('click', '#' + settings.listDiv + ' li', function(){
683682
var markerId = $(this).data('markerid');
684683

685684
var selectedMarker = markers[markerId];

0 commit comments

Comments
 (0)