Skip to content

Commit 28065ef

Browse files
committed
Update jquery.storelocator.js
Store the map object into the jQuery object in order to retrieve it by calling $object.data('map')
1 parent 28a0318 commit 28065ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/jquery.storelocator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ $.fn.storeLocator = function(options) {
377377
if(settings.dataType === 'json' || settings.dataType === 'jsonp'){
378378
//Process JSON
379379
$.each(data, function(){
380-
var key, value, locationData = {};
380+
var key, value, locationData = {};
381381

382382
// Parse each data variables
383383
for ( key in this ) {
@@ -645,6 +645,8 @@ $.fn.storeLocator = function(options) {
645645
}
646646

647647
var map = new google.maps.Map(document.getElementById(settings.mapDiv),myOptions);
648+
$this.data('map', map);
649+
648650
//Create one infowindow to fill later
649651
var infowindow = new google.maps.InfoWindow();
650652

0 commit comments

Comments
 (0)