From 256cb8202b800c9da586fdd265143833f24e722c Mon Sep 17 00:00:00 2001 From: bmoren Date: Tue, 1 Dec 2015 16:37:43 -0600 Subject: [PATCH] bye --- p5.geolocation.min.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 p5.geolocation.min.js diff --git a/p5.geolocation.min.js b/p5.geolocation.min.js deleted file mode 100644 index 08c4baa..0000000 --- a/p5.geolocation.min.js +++ /dev/null @@ -1 +0,0 @@ -console.log("%c p5.geolocation Loaded ","color:pink; background:black; "),p5.prototype.geoCheck=function(){return navigator.geolocation?!0:!1},p5.prototype.getCurrentPosition=function(a,b){function d(a){console.log(a.message),c.error=a.message,"function"==typeof b&&b(a.message)}function e(b){for(var d in b.coords)c[d]=b.coords[d];"function"==typeof a&&a(b.coords)}var c={};return navigator.geolocation?navigator.geolocation.getCurrentPosition(e,d):d("geolocation not available"),c},p5.prototype.registerPreloadMethod("getCurrentPosition"),p5.prototype._intervalPosition=null,p5.prototype.intervalCurrentPosition=function(a,b,c){function e(a){console.log(a.message),"function"==typeof c&&c(a.message)}function f(b){"function"==typeof a&&a(b.coords)}var d=5e3;d=b,navigator.geolocation?_intervalPosition=setInterval(function(){console.log("pos"),navigator.geolocation.getCurrentPosition(f,e)},d):e("geolocation not available")},p5.prototype.clearIntervalPos=function(){window.clearInterval(_intervalPosition)},p5.prototype._posWatch=null,p5.prototype.watchPosition=function(a,b,c){function d(a){console.log("watch Postition Error"+a),"function"==typeof b&&b(a.message)}function e(b){"function"==typeof a&&a(b.coords)}navigator.geolocation?_posWatch=navigator.geolocation.watchPosition(e,d,c):d("geolocation not available")},p5.prototype.clearWatch=function(){navigator.geolocation.clearWatch(_posWatch)},p5.prototype.calcGeoDistance=function(a,b,c,d,e){if("km"==e)var f=6371;else var f=3959;var g=(c-a)*(Math.PI/180),h=(d-b)*(Math.PI/180),i=Math.sin(g/2)*Math.sin(g/2)+Math.cos(a*(Math.PI/180))*Math.cos(c*(Math.PI/180))*Math.sin(h/2)*Math.sin(h/2),j=2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)),k=f*j;return k},p5.prototype.geoFence=function(a,b,c,d,e,f,g){this.lat=a,this.lon=b,this.fence=c,this.units=f,this.distance=0,this.insideCallback=d,this.outsideCallback=e,this.insideFence=!1,this.options=g,this.geoError=function(a){console.log("geoFence Error :"+a)},this.success=function(a){this.distance=calcGeoDistance(this.lat,this.lon,a.coords.latitude,a.coords.longitude,this.units),this.distance<=this.fence?0==this.insideFence&&("function"==typeof this.insideFenceCallback&&this.insideFenceCallback(a.coords),this.insideFence=!0):("function"==typeof this.outsideCallback&&this.outsideCallback(a.coords),this.insideFence=!1)},navigator.geolocation?navigator.geolocation.watchPosition(this.success.bind(this),this.geoError.bind(this),this.options):geoError("geolocation not available")}; \ No newline at end of file