(function (I) { I.getGPS = function () { return new Promise(resolve => { if (!navigator.geolocation) { resolve(null); return; } navigator.geolocation.getCurrentPosition( p => resolve({ lat: p.coords.latitude, lng: p.coords.longitude, accuracy: p.coords.accuracy }), () => resolve(null), { enableHighAccuracy: true, timeout: 5000, maximumAge: 30000 } ); }); }; })(window.App.Infrastructure);