'; if (error.code === 1) { generateNoty('warning', 'Debes permitir usar tu ubicación para revisar que gasolinerias estan cerca de tí.' + m_info); } else if (error.code === 2) { generateNoty('warning', 'Posicion no disponible'); } else { generateNoty('warning', error.message); } } function useCurrPos(btn_v) { var btn = typeof (btn_v) !== 'undefined' ? btn_v : false; navigator.geolocation.getCurrentPosition(function (objPosition) { var lon = objPosition.coords.longitude; var lat = objPosition.coords.latitude; var coords = {}; coords.latitude = lat; coords.longitude = lon; coords.accuracy = ''; var pos = {}; pos.coords = coords; findGasolineras(pos); }, function (objPositionError) { if (!btn) { $.getJSON('https://ipinfo.io/geo', function (response) { var loc = response.loc.split(','); var coords = { latitude: loc[0], longitude: loc[1] }; var pos = {}; pos.coords = coords; findGasolineras(pos); }); } else { errorGeo3(objPositionError); } }, { maximumAge: 75000, timeout: 15000 }); } ...