1
1
/*
2
- * storeLocator v1.4 - jQuery Google Maps store locator plugin
2
+ * storeLocator v1.4.1 - jQuery Google Maps store locator plugin
3
3
* (c) Copyright 2012, Bjorn Holine (http://www.bjornblog.com)
4
4
* Released under the MIT license
5
5
* 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) {
95
95
}
96
96
97
97
var userinput , olat , olng , marker , letter , storenum ;
98
- var locationset = new Array ( ) ;
98
+ var locationset = [ ] ;
99
99
100
100
//Calculate geocode distance functions - you could use Google's distance service instead
101
101
var GeoCodeCalc = { } ;
@@ -325,7 +325,6 @@ $.fn.storeLocator = function(options) {
325
325
326
326
//After the store locations file has been read successfully
327
327
var i = 0 ;
328
- var locationset = new Array ( ) ;
329
328
$ ( '#' + settings . mapDiv ) . addClass ( 'mapOpen' ) ;
330
329
331
330
//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) {
353
352
//Create the array
354
353
if ( settings . maxDistance === true ) {
355
354
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 ] ;
357
356
}
358
357
else {
359
358
return ;
360
359
}
361
360
}
362
361
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 ] ;
364
363
}
365
364
366
365
i ++ ;
@@ -380,14 +379,14 @@ $.fn.storeLocator = function(options) {
380
379
//Create the array
381
380
if ( settings . maxDistance === true ) {
382
381
if ( distance < maxDistance ) {
383
- locationset [ i ] = new Array ( distance , name , lat , lng , description ) ;
382
+ locationset [ i ] = [ distance , name , lat , lng , description ] ;
384
383
}
385
384
else {
386
385
return ;
387
386
}
388
387
}
389
388
else {
390
- locationset [ i ] = new Array ( distance , name , lat , lng , description ) ;
389
+ locationset [ i ] = [ distance , name , lat , lng , description ] ;
391
390
}
392
391
393
392
i ++ ;
@@ -417,14 +416,14 @@ $.fn.storeLocator = function(options) {
417
416
//Create the array
418
417
if ( settings . maxDistance === true ) {
419
418
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 ] ;
421
420
}
422
421
else {
423
422
return ;
424
423
}
425
424
}
426
425
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 ] ;
428
427
}
429
428
430
429
i ++ ;
@@ -611,7 +610,7 @@ $.fn.storeLocator = function(options) {
611
610
}
612
611
613
612
var map = new google . maps . Map ( document . getElementById ( settings . mapDiv ) , myOptions ) ;
614
- var markers = new Array ( ) ;
613
+ var markers = [ ] ;
615
614
//Create one infowindow to fill later
616
615
var infowindow = new google . maps . InfoWindow ( ) ;
617
616
@@ -679,7 +678,7 @@ $.fn.storeLocator = function(options) {
679
678
}
680
679
681
680
//Handle clicks from the list
682
- $ ( document ) . on ( 'click' , '#loc-list li' , function ( ) {
681
+ $ ( document ) . on ( 'click' , '#' + settings . listDiv + ' li', function ( ) {
683
682
var markerId = $ ( this ) . data ( 'markerid' ) ;
684
683
685
684
var selectedMarker = markers [ markerId ] ;
0 commit comments