Skip to content

Commit 831d33c

Browse files
authored
Merge pull request #5 from jorrit/error
Pass GoogleMapType as `this` to error_callback
2 parents 05f5487 + 027ea2d commit 831d33c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Resources/public/js/jquery.ohgooglemaps.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'addr_field' : null,
1616
'callback' : function (location, gmap) {},
1717
'error_callback' : function(status) {
18-
$this.settings.search_error_el.text(status);
18+
this.settings.search_error_el.text(status);
1919
},
2020
}, settings);
2121

@@ -72,7 +72,7 @@
7272
$this.insertMarker(results[0].geometry.location);
7373
$this.setAddress(results[0].formatted_address)
7474
} else {
75-
$this.settings.error_callback(status);
75+
$this.settings.error_callback.call($this, status);
7676
}
7777
});
7878
},
@@ -83,7 +83,7 @@
8383
if (status == google.maps.GeocoderStatus.OK) {
8484
$this.setAddress(results[0].formatted_address);
8585
} else {
86-
$this.settings.error_callback(status);
86+
$this.settings.error_callback.call($this, status);
8787
}
8888
});
8989
},
@@ -105,11 +105,11 @@
105105
$this.map.setZoom(16);
106106
},
107107
function(error) {
108-
$this.settings.error_callback(error);
108+
$this.settings.error_callback.call($this, error);
109109
}
110110
);
111111
} else {
112-
$this.settings.search_error_el.text('Your broswer does not support geolocation');
112+
$this.settings.search_error_el.text('Your browser does not support geolocation');
113113
}
114114

115115
},
@@ -178,7 +178,7 @@
178178
'addr_field' : null,
179179
'callback' : function (location, gmap) {},
180180
'error_callback' : function(status) {
181-
$this.settings.search_error_el.text(status);
181+
this.settings.search_error_el.text(status);
182182
}
183183
}
184184

0 commit comments

Comments
 (0)