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AA0B,GAAC,GAAG,GAACQ,2BAA2B,GAAC,eAAe;EAEvHe,CAAC,CAAC,QAAQ,CAAC,CAACC,IAAI,CAAC,KAAK,EAACF,OAAO,CAAC;EAE/BC,CAAC,CAAC,MAAM,CAAC,CAACE,IAAI,CAACzB,0BAA0B,CAAC;EAE1CuB,CAAC,CAAC,OAAO,CAAC,CAACE,IAAI,CAACjB,2BAA2B,CAAC;EAG5C,OAAOY,2BAA2B;AAEnC;AAAC;AAED,SAASxB,SAASA,CAAC8B,KAAK,EAAE;EAEzB,QAAOA,KAAK,CAACC,IAAI;IAEhB,KAAKD,KAAK,CAACE,iBAAiB;MAE3BR,2BAA2B,GAAGS,wBAAwB;;MAEtD;;MAEA1B,YAAY,CAACC,OAAO,CAACC,gDAAgD,EAAE,CAAC,CAAC;MAEzE,OAAO,KAAK;MAEZ;IAED,KAAKqB,KAAK,CAACI,oBAAoB;MAE9BV,2BAA2B,GAAGW,2BAA2B;MAEzD,OAAO,KAAK;MAEZ;IAED,KAAKL,KAAK,CAACM,OAAO;MAEjBZ,2BAA2B,GAAGa,cAAc;MAE5C,OAAO,KAAK;MAEZ;IAED,KAAKP,KAAK,CAACQ,aAAa;MAEvBd,2BAA2B,GAAGe,oBAAoB;MAElD,OAAO,KAAK;MAEZ;IAED;MAAU,OAAO,KAAK;EAEvB;EAAC;EAED,OAAOf,2BAA2B;AAEnC;AAAC","sources":["webpack://smetio/./developement/js/functions/geolocation/geolocation.js"],"sourcesContent":["/*\n * CONTAINES FUNCTIONS THAT ARE USEFUL FOR FINDING GEOLOCATION\n * \n \n */ \n\n\tfunction getDeviceCurrentLocation(){\n\t\n\t\tif (navigator.geolocation) {\n\t\t\t\n\t\t\tlet options = {\n\t\t\t\t\t\n\t\t\t\t\tenableHighAccuracy : true,\n\t\t\t\t\ttimeout : 5000,\n\t\t\t\t\tmaximumAge : 0\n\t\t\t\t\t\n\t\t\t};\n\t\n\t\t\t//return navigator.geolocation.getCurrentPosition(showPosition, showError);\n\t\t\t\n\t\t\tsmetio_isGeolocationSupported = true;\n\t\t\t\n\t\t\tsmetio_watchDevicePositionId = navigator.geolocation.watchPosition(showPosition, showError, options);\n\t\t\t\n\t\t\treturn SMETIO_GEOLOCATION_AVAILABLE;\n\t\n\t\t}else{\n\t\t\t\n\t\t\tsmetio_isGeolocationSupported = false;\n\t\t\t\n\t\t\treturn SMETIO_GEOLOCATION_UNAVAILABLE;\n\t\t\t\n\t\t};\n\t\n\t};\n\t\n\t//$(\"body\").on(\"load\",function(){\n\t\t\t\t\t\t\n\t\tif(smetio_isLocationPermissionAlreadyGranted == 1 && smetio_latitudeOfTheDevice == SMETIO_UNKNOWN){\n\t\t\t\t\t\t\n\t\t\tgetDeviceCurrentLocation();\n\t\t\t\n\t\t};\n\t\t\t\n\t//});\n\t\n\tfunction showPosition(position){\n\t\t\n\t\t/* STORE ON LOCATION STORAGE THAT PERMISSION HAS BEEN GRANTED TO ACCESS LOCATION */\n\t\t\n\t\tlocalStorage.setItem(SMETIO_LOCAL_STORAGE_LOCATION_PERMISSION_GRANTED, 1);\n\t\t\n\t\tsmetio_isLocationPermissionAlreadyGranted = 1;\n\t\t\n\t\t\n\t\t\n\t\t// ALL THE SMETIO VARIABLES HERE ARE GLOBAL VARIABLES\n\t \n\t\tsmetio_latitudeOfTheDevice = position.coords.latitude;\n\n\t\tsmetio_longitudeOfTheDevice = position.coords.longitude;\n\t\t\n\t\tsmetio_accuracyOfDeviceLocation = position.coords.accuracy;\n\t\t\n\t\tsmetio_altitudeOfDevice = position.coords.altitude;\n\t\t\n\t\tsmetio_altitudeAccuracyOfDevice = position.coords.altitudeAccuracy;\n\t\t\n\t\tsmetio_deviceIsheading = position.coords.heading;\n\t\t\n\t\tsmetio_deviceSpeed = position.coords.speed;\n\t\t\t\n\t\tsmetio_deviceLocationStatus = SMETIO_LOCATION_KNOWN;\n\t\t\t\t\n\t\tlet gmapSrc = \"https://maps.google.co.uk?q=\"+smetio_latitudeOfTheDevice+\",\"+smetio_longitudeOfTheDevice+\"&output=embed\";\n\t\t\n\t\t$(\"#gmaps\").attr(\"src\",gmapSrc);\n\t\t\n\t\t$(\".lat\").html(smetio_latitudeOfTheDevice);\n\t\t\n\t\t$(\".long\").html(smetio_longitudeOfTheDevice);\n\t\t\n\t\t\n\t\treturn smetio_deviceLocationStatus;\n\t\t\t\n\t};\n\t\n\tfunction showError(error) {\n\t\t\t\n\t\tswitch(error.code) {\n\t\n\t\t\tcase error.PERMISSION_DENIED:\n\t\n\t\t\t\tsmetio_deviceLocationStatus = SMETIO_PERMISSION_DENIED;\n\t\t\t\t\n\t\t\t\t/* STORE ON LOCATION STORAGE THAT PERMISSION WAS NOT GRANTED TO ACCESS LOCATION */\n\t\t\t\t\n\t\t\t\tlocalStorage.setItem(SMETIO_LOCAL_STORAGE_LOCATION_PERMISSION_GRANTED, 0);\n\t\n\t\t\t\treturn false; \n\t\n\t\t\t\tbreak;\n\t\n\t\t\tcase error.POSITION_UNAVAILABLE:\n\t\n\t\t\t\tsmetio_deviceLocationStatus = SMETIO_POSITION_UNAVAILABLE;\n\t\n\t\t\t\treturn false; \n\t\n\t\t\t\tbreak;\n\t\n\t\t\tcase error.TIMEOUT:\n\t\n\t\t\t\tsmetio_deviceLocationStatus = SMETIO_TIMEOUT;\n\t\n\t\t\t\treturn false; \n\t\n\t\t\t\tbreak;\n\t\n\t\t\tcase error.UNKNOWN_ERROR:\n\t\n\t\t\t\tsmetio_deviceLocationStatus = SMETIO_UNKNOWN_ERROR;\n\t\n\t\t\t\treturn false; \n\t\n\t\t\t\tbreak;\n\t\n\t\t\tdefault : return false;\n\t\n\t\t};\n\t\t\n\t\treturn smetio_deviceLocationStatus;\n\t\n\t};\n\t\n\t\n\t\n\t\n\t\n\t"],"names":["getDeviceCurrentLocation","navigator","geolocation","options","enableHighAccuracy","timeout","maximumAge","smetio_isGeolocationSupported","smetio_watchDevicePositionId","watchPosition","showPosition","showError","SMETIO_GEOLOCATION_AVAILABLE","SMETIO_GEOLOCATION_UNAVAILABLE","smetio_isLocationPermissionAlreadyGranted","smetio_latitudeOfTheDevice","SMETIO_UNKNOWN","position","localStorage","setItem","SMETIO_LOCAL_STORAGE_LOCATION_PERMISSION_GRANTED","coords","latitude","smetio_longitudeOfTheDevice","longitude","smetio_accuracyOfDeviceLocation","accuracy","smetio_altitudeOfDevice","altitude","smetio_altitudeAccuracyOfDevice","altitudeAccuracy","smetio_deviceIsheading","heading","smetio_deviceSpeed","speed","smetio_deviceLocationStatus","SMETIO_LOCATION_KNOWN","gmapSrc","$","attr","html","error","code","PERMISSION_DENIED","SMETIO_PERMISSION_DENIED","POSITION_UNAVAILABLE","SMETIO_POSITION_UNAVAILABLE","TIMEOUT","SMETIO_TIMEOUT","UNKNOWN_ERROR","SMETIO_UNKNOWN_ERROR"],"sourceRoot":""}