// A shim to implement the W3C Geolocation API Specification using Gears or the Ajax API
-if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) (function(){
+if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) { (function(){
// -- BEGIN GEARS_INIT
(function() {
}
} catch (e) {
// Safari
- if ((typeof navigator.mimeTypes != 'undefined')
- && navigator.mimeTypes["application/x-googlegears"]) {
+ if ((typeof navigator.mimeTypes != 'undefined') && navigator.mimeTypes["application/x-googlegears"]) {
factory = document.createElement("object");
factory.style.display = "none";
factory.width = 0;
return function(position) {
callback(position);
self.lastPosition = position;
- }
- }
+ };
+ };
// -- PUBLIC
return {
var queue = [];
var addLocationQueue = function(callback) {
queue.push(callback);
- }
+ };
var runLocationQueue = function() {
if (hasGoogleLoader()) {
call();
}
}
- }
+ };
window['_google_loader_apiLoaded'] = function() {
runLocationQueue();
- }
+ };
var hasGoogleLoader = function() {
return (window['google'] && google['loader']);
- }
+ };
var checkGoogleLoader = function(callback) {
- if (hasGoogleLoader()) return true;
+ if (hasGoogleLoader()) { return true; }
addLocationQueue(callback);
var self = this;
if (!checkGoogleLoader(function() {
self.getCurrentPosition(successCallback, errorCallback, options);
- })) return;
+ })) { return; }
if (google.loader.ClientLocation) {
var cl = google.loader.ClientLocation;
navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation() : AjaxGeoLocation();
})();
+}