G(f/y)&&a("overflow"),n*=y;t=b.length+1,N=c(g-o,t,0==o),G(g/t)>f-h&&a("overflow"),h+=G(g/t),g%=t,b.splice(g++,0,h)}return u(b)}function d(e){var t,r,i,s,o,u,p,l,d,y,b,S,g,h,N,I=[];for(e=n(e),S=e.length,t=D,r=0,o=v,u=0;u=t&&bG((f-r)/g)&&a("overflow"),r+=(p-t)*g,t=p,u=0;uf&&a("overflow"),b==t){for(l=r,d=T;y=d<=o?C:d>=o+k?k:d-o,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=T-C,G=Math.floor,w=String.fromCharCode;if(N={version:"1.3.2",ucs2:{decode:n,encode:u},decode:l,encode:d,toASCII:b,toUnicode:y},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return N});else if(S&&g)if(t.exports==S)g.exports=N;else for(I in N)N.hasOwnProperty(I)&&(S[I]=N[I]);else i.punycode=N}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],434:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,s){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var n=/\+/g;e=e.split(t);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var p=e.length;u>0&&p>u&&(p=u);for(var m=0;m=0?(c=b.substr(0,S),l=b.substr(S+1)):(c=b,l=""),d=decodeURIComponent(c),y=decodeURIComponent(l),i(o,d)?a(o[d])?o[d].push(y):o[d]=[o[d],y]:o[d]=y}return o};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],435:[function(e,t,r){"use strict";function i(e,t){if(e.map)return e.map(t);for(var r=[],i=0;i0&&u>n&&(u=n);for(var p=0;p=0?(m=y.substr(0,b),c=y.substr(b+1)):(m=y,c=""),l=decodeURIComponent(m),d=decodeURIComponent(c),i(s,l)?Array.isArray(s[l])?s[l].push(d):s[l]=[s[l],d]:s[l]=d}return s}},{}],438:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(a){var s=encodeURIComponent(i(a))+r;return Array.isArray(e[a])?e[a].map(function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(e)):""}},{}],439:[function(e,t,r){arguments[4][436][0].apply(r,arguments)},{"./decode":437,"./encode":438,dup:436}],440:[function(e,t,r){(function(t,i){(function(){function a(e,t){this._id=e,this._clearFn=t}var s=e("process/browser.js").nextTick,o=Function.prototype.apply,n=Array.prototype.slice,u={},p=0;r.setTimeout=function(){return new a(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new a(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=p++,i=!(arguments.length<2)&&n.call(arguments,1);return u[t]=!0,s(function(){u[t]&&(i?e.apply(null,i):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof i?i:function(e){delete u[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":432,timers:440}],441:[function(e,t,r){function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function a(e,t,r){if(e&&p(e)&&e instanceof i)return e;var a=new i;return a.parse(e,t,r),a}function s(e){return u(e)&&(e=a(e)),e instanceof i?e.format():i.prototype.format.call(e)}function o(e,t){return a(e,!1,!0).resolve(t)}function n(e,t){return e?a(e,!1,!0).resolveObject(t):t}function u(e){return"string"==typeof e}function p(e){return"object"==typeof e&&null!==e}function m(e){return null===e}function c(e){return null==e}var l=e("punycode");r.parse=a,r.resolve=o,r.resolveObject=n,r.format=s,r.Url=i;var d=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n","\t"],S=["{","}","|","\\","^","`"].concat(b),g=["'"].concat(S),h=["%","/","?",";","#"].concat(g),N=["/","?","#"],I=/^[a-z0-9A-Z_-]{0,63}$/,f=/^([a-z0-9A-Z_-]{0,63})(.*)$/,T={javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},k={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=e("querystring");i.prototype.parse=function(e,t,r){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e;i=i.trim();var a=d.exec(i);if(a){a=a[0];var s=a.toLowerCase();this.protocol=s,i=i.substr(a.length)}if(r||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var o="//"===i.substr(0,2);!o||a&&C[a]||(i=i.substr(2),this.slashes=!0)}if(!C[a]&&(o||a&&!k[a])){for(var n=-1,p=0;p127?D+="x":D+=v[P];if(!D.match(I)){var q=S.slice(0,p),E=S.slice(p+1),M=v.match(f);M&&(q.push(M[1]),E.unshift(M[2])),E.length&&(i="/"+E.join(".")+i),this.hostname=q.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!b){for(var L=this.hostname.split("."),G=[],p=0;p0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return r.search=e.search,r.query=e.query,m(r.pathname)&&m(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var g=y.slice(-1)[0],h=(r.host||e.host)&&("."===g||".."===g)||""===g,N=0,I=y.length;I>=0;I--)g=y[I],"."==g?y.splice(I,1):".."===g?(y.splice(I,1),N++):N&&(y.splice(I,1),N--);if(!l&&!d)for(;N--;N)y.unshift("..");!l||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),h&&"/"!==y.join("/").substr(-1)&&y.push("");var f=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(b){r.hostname=r.host=f?"":y.length?y.shift():"";var S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return l=l||r.host&&y.length,l&&!f&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),m(r.pathname)&&m(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:433,querystring:436}],442:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],443:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],444:[function(e,t,r){(function(t,i){(function(){function a(e,t){var i={seen:[],stylize:o};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),b(t)?i.showHidden=t:t&&r._extend(i,t),f(i.showHidden)&&(i.showHidden=!1),f(i.depth)&&(i.depth=2),f(i.colors)&&(i.colors=!1),f(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=s),u(i,e,i.depth)}function s(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function o(e,t){return e}function n(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,i){if(e.customInspect&&t&&A(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(i,e);return N(a)||(a=u(e,a,i)),a}var s=p(e,t);if(s)return s;var o=Object.keys(t),b=n(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),R(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return m(t);if(0===o.length){if(A(t)){var S=t.name?": "+t.name:"";return e.stylize("[Function"+S+"]","special")}if(T(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(R(t))return m(t)}var g="",h=!1,I=["{","}"];if(y(t)&&(h=!0,I=["[","]"]),A(t)){g=" [Function"+(t.name?": "+t.name:"")+"]"}if(T(t)&&(g=" "+RegExp.prototype.toString.call(t)),k(t)&&(g=" "+Date.prototype.toUTCString.call(t)),R(t)&&(g=" "+m(t)),0===o.length&&(!h||0==t.length))return I[0]+g+I[1];if(i<0)return T(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var f;return f=h?c(e,t,i,b,o):o.map(function(r){return l(e,t,i,b,r,h)}),e.seen.pop(),d(f,g,I)}function p(e,t){if(f(t))return e.stylize("undefined","undefined");if(N(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return h(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):S(t)?e.stylize("null","null"):void 0}function m(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,a){for(var s=[],o=0,n=t.length;o-1&&(n=s?n.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+n.split("\n").map(function(e){return" "+e}).join("\n"))):n=e.stylize("[Circular]","special")),f(o)){if(s&&a.match(/^\d+$/))return n;o=JSON.stringify(""+a),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+n}function d(e,t,r){var i=0;return e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function S(e){return null===e}function g(e){return null==e}function h(e){return"number"==typeof e}function N(e){return"string"==typeof e}function I(e){return"symbol"==typeof e}function f(e){return void 0===e}function T(e){return C(e)&&"[object RegExp]"===D(e)}function C(e){return"object"==typeof e&&null!==e}function k(e){return C(e)&&"[object Date]"===D(e)}function R(e){return C(e)&&("[object Error]"===D(e)||e instanceof Error)}function A(e){return"function"==typeof e}function v(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function D(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}function x(){var e=new Date,t=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":");return[e.getDate(),G[e.getMonth()],t].join(" ")}function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var E=/%[sdj%]/g;r.format=function(e){if(!N(e)){for(var t=[],r=0;r=s)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}}),n=i[r];r>>((3&t)<<3)&255;return s}}},{}],448:[function(e,t,r){function i(e,t,r){var i=t&&r||0,m=t||[];e=e||{};var c=e.node||a,l=void 0!==e.clockseq?e.clockseq:s;if(null==c||null==l){var d=o();null==c&&(c=a=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==l&&(l=s=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),b=void 0!==e.nsecs?e.nsecs:p+1,S=y-u+(b-p)/1e4;if(S<0&&void 0===e.clockseq&&(l=l+1&16383),(S<0||y>u)&&void 0===e.nsecs&&(b=0),b>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=y,p=b,s=l,y+=122192928e5;var g=(1e4*(268435455&y)+b)%4294967296;m[i++]=g>>>24&255,m[i++]=g>>>16&255,m[i++]=g>>>8&255,m[i++]=255&g;var h=y/4294967296*1e4&268435455;m[i++]=h>>>8&255,m[i++]=255&h,m[i++]=h>>>24&15|16,m[i++]=h>>>16&255,m[i++]=l>>>8|128,m[i++]=255&l;for(var N=0;N<6;++N)m[i+N]=c[N];return t||n(m)}var a,s,o=e("./lib/rng"),n=e("./lib/bytesToUuid"),u=0,p=0;t.exports=i},{"./lib/bytesToUuid":446,"./lib/rng":447}],449:[function(e,t,r){function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var n=0;n<16;++n)t[i+n]=o[n];return t||s(o)}var a=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=i},{"./lib/bytesToUuid":446,"./lib/rng":447}],450:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=e("./utils/LRU"),a=1e3,s=function(){function e(e){void 0===e&&(e=a),this.maxSize=e,this.cache=new i.LRUCache(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),e.prototype.put=function(t,r){var i="string"!=typeof t?e.getKeyString(t):t,a=this.populateValue(r);this.cache.put(i,a)},e.prototype.get=function(t){var r="string"!=typeof t?e.getKeyString(t):t,i=Date.now(),a=this.cache.get(r);if(a){for(var s=a.length-1;s>=0;s--){a[s].Expire _range_limit ) && _range_check){
+ $('#pr_last_report').text("Outside distance limit (500km).");
+ return;
+ }
+
+ if($("#sw_use_car_pos").hasClass('on')){
+ _recov_lat = parseFloat($('#cc_lat').text());
+ _recov_lon = parseFloat($('#cc_lon').text());
+ }
+ }
+
+ // Logic to make recovery & planned mutually exclusive is in app.js
+ _recovered = $("#sw_recovery_ok").hasClass('on');
+ _planned = $("#sw_recovery_planned").hasClass('on');
+
+
+ var _doc = {
+ "serial": _serial,
+ "lat": _recov_lat,
+ "lon": _recov_lon,
+ "alt": 0.0,
+ "recovered": _recovered,
+ "planned": _planned,
+ "recovered_by": _callsign,
+ "description": _notes
+ };
+
+
+ $('#pr_last_report').text("Submitting report...");
+
+
+ $.ajax({
+ type: "PUT",
+ url: ChaseCar.recovery_uri,
+ contentType: "application/json; charset=utf-8",
+ dataType: "json",
+ data: JSON.stringify(_doc),
+ }).done(function(data) {
+ $('#pr_last_report').text("Reported OK!");
+ })
+ .fail(function(jqXHR, textStatus, error) {
+ try {
+ _fail_resp = JSON.parse(jqXHR.responseText);
+ $('#pr_last_report').text(_fail_resp.message);
+ } catch(err) {
+ $('#pr_last_report').text("Failed to report.");
+ }
+ })
+
+}
\ No newline at end of file
diff --git a/js/colour-map.js b/js/colour-map.js
new file mode 100644
index 0000000..6aecb1c
--- /dev/null
+++ b/js/colour-map.js
@@ -0,0 +1,85 @@
+const cm_data = {"turbo": {"interpolate": true, "colors": [[0.19, 0.0718, 0.2322], [0.1948, 0.0834, 0.2615], [0.1996, 0.095, 0.2902], [0.2042, 0.1065, 0.3184], [0.2086, 0.118, 0.3461], [0.2129, 0.1295, 0.3731], [0.2171, 0.1409, 0.3996], [0.2211, 0.1522, 0.4256], [0.225, 0.1635, 0.451], [0.2288, 0.1748, 0.4758], [0.2324, 0.186, 0.5], [0.2358, 0.1972, 0.5237], [0.2392, 0.2083, 0.5469], [0.2423, 0.2194, 0.5694], [0.2454, 0.2304, 0.5914], [0.2483, 0.2414, 0.6129], [0.2511, 0.2524, 0.6337], [0.2537, 0.2633, 0.6541], [0.2562, 0.2741, 0.6738], [0.2585, 0.2849, 0.693], [0.2607, 0.2957, 0.7116], [0.2628, 0.3064, 0.7297], [0.2647, 0.3171, 0.7472], [0.2665, 0.3277, 0.7641], [0.2682, 0.3382, 0.7805], [0.2697, 0.3488, 0.7963], [0.271, 0.3593, 0.8116], [0.2723, 0.3697, 0.8262], [0.2733, 0.3801, 0.8404], [0.2743, 0.3904, 0.8539], [0.2751, 0.4007, 0.8669], [0.2758, 0.411, 0.8794], [0.2763, 0.4212, 0.8912], [0.2767, 0.4313, 0.9025], [0.2769, 0.4414, 0.9133], [0.277, 0.4515, 0.9235], [0.277, 0.4615, 0.9331], [0.2768, 0.4715, 0.9421], [0.2765, 0.4814, 0.9506], [0.276, 0.4913, 0.9586], [0.2754, 0.5012, 0.9659], [0.2747, 0.5109, 0.9728], [0.2738, 0.5207, 0.979], [0.2727, 0.5304, 0.9846], [0.2711, 0.5402, 0.9893], [0.2688, 0.55, 0.993], [0.2659, 0.5598, 0.9958], [0.2625, 0.5697, 0.9977], [0.2586, 0.5796, 0.9988], [0.2542, 0.5895, 0.999], [0.2495, 0.5994, 0.9984], [0.2443, 0.6094, 0.997], [0.2387, 0.6193, 0.9948], [0.2329, 0.6292, 0.992], [0.2268, 0.6391, 0.9885], [0.2204, 0.649, 0.9844], [0.2138, 0.6589, 0.9796], [0.2071, 0.6687, 0.9742], [0.2002, 0.6784, 0.9683], [0.1933, 0.6881, 0.9619], [0.1862, 0.6978, 0.955], [0.1792, 0.7073, 0.9476], [0.1722, 0.7168, 0.9398], [0.1653, 0.7262, 0.9316], [0.1584, 0.7355, 0.923], [0.1517, 0.7447, 0.9142], [0.1452, 0.7538, 0.905], [0.1389, 0.7628, 0.8955], [0.1328, 0.7716, 0.8858], [0.127, 0.7804, 0.8759], [0.1215, 0.789, 0.8658], [0.1164, 0.7974, 0.8556], [0.1117, 0.8057, 0.8452], [0.1074, 0.8138, 0.8348], [0.1036, 0.8218, 0.8244], [0.1003, 0.8296, 0.8139], [0.0975, 0.8371, 0.8034], [0.0953, 0.8446, 0.793], [0.0938, 0.8518, 0.7826], [0.0929, 0.8588, 0.7724], [0.0927, 0.8655, 0.7623], [0.0932, 0.8721, 0.7524], [0.0945, 0.8784, 0.7426], [0.0966, 0.8845, 0.7332], [0.0996, 0.8904, 0.7239], [0.1034, 0.896, 0.715], [0.1082, 0.9014, 0.706], [0.1137, 0.9067, 0.6965], [0.1201, 0.9119, 0.6866], [0.1273, 0.917, 0.6763], [0.1353, 0.922, 0.6656], [0.1439, 0.9268, 0.6545], [0.1532, 0.9315, 0.6431], [0.1632, 0.9361, 0.6314], [0.1738, 0.9405, 0.6194], [0.1849, 0.9448, 0.6071], [0.1966, 0.949, 0.5947], [0.2088, 0.953, 0.582], [0.2214, 0.9569, 0.5691], [0.2345, 0.9606, 0.5561], [0.248, 0.9642, 0.543], [0.2618, 0.9676, 0.5298], [0.276, 0.9709, 0.5165], [0.2904, 0.974, 0.5032], [0.3051, 0.977, 0.4899], [0.3201, 0.9797, 0.4765], [0.3352, 0.9823, 0.4632], [0.3504, 0.9848, 0.45], [0.3658, 0.987, 0.4369], [0.3813, 0.9891, 0.4239], [0.3968, 0.991, 0.411], [0.4123, 0.9927, 0.3983], [0.4278, 0.9942, 0.3858], [0.4432, 0.9955, 0.3734], [0.4585, 0.9966, 0.3614], [0.4738, 0.9976, 0.3496], [0.4888, 0.9983, 0.3382], [0.5036, 0.9988, 0.327], [0.5182, 0.9991, 0.3162], [0.5326, 0.9992, 0.3058], [0.5466, 0.9991, 0.2958], [0.5603, 0.9987, 0.2862], [0.5736, 0.9982, 0.2771], [0.5865, 0.9974, 0.2685], [0.5989, 0.9964, 0.2604], [0.6109, 0.9951, 0.2528], [0.6223, 0.9937, 0.2458], [0.6332, 0.992, 0.2394], [0.6436, 0.99, 0.2336], [0.6539, 0.9878, 0.2284], [0.6643, 0.9852, 0.2237], [0.6746, 0.9825, 0.2196], [0.6849, 0.9794, 0.216], [0.6952, 0.9761, 0.2129], [0.7055, 0.9726, 0.2103], [0.7158, 0.9688, 0.2082], [0.726, 0.9647, 0.2064], [0.7361, 0.9604, 0.205], [0.7462, 0.9559, 0.2041], [0.7562, 0.9512, 0.2034], [0.7661, 0.9463, 0.2031], [0.7759, 0.9411, 0.2031], [0.7856, 0.9358, 0.2034], [0.7952, 0.9302, 0.2039], [0.8047, 0.9245, 0.2046], [0.8141, 0.9186, 0.2055], [0.8233, 0.9125, 0.2066], [0.8324, 0.9063, 0.2079], [0.8413, 0.8999, 0.2093], [0.8501, 0.8933, 0.2107], [0.8587, 0.8866, 0.2123], [0.8671, 0.8797, 0.2139], [0.8753, 0.8727, 0.2156], [0.8833, 0.8655, 0.2172], [0.8911, 0.8583, 0.2188], [0.8987, 0.8509, 0.2204], [0.906, 0.8434, 0.2219], [0.9132, 0.8358, 0.2233], [0.92, 0.8281, 0.2246], [0.9267, 0.8202, 0.2257], [0.933, 0.8124, 0.2267], [0.9391, 0.8044, 0.2274], [0.9449, 0.7963, 0.228], [0.9504, 0.7882, 0.2283], [0.9556, 0.78, 0.2284], [0.9605, 0.7718, 0.2281], [0.9651, 0.7635, 0.2275], [0.9693, 0.7552, 0.2266], [0.9732, 0.7468, 0.2254], [0.9768, 0.7384, 0.2237], [0.98, 0.73, 0.2216], [0.9829, 0.7214, 0.2192], [0.9855, 0.7125, 0.2165], [0.9878, 0.7033, 0.2136], [0.9899, 0.6938, 0.2104], [0.9916, 0.6841, 0.2071], [0.9931, 0.6741, 0.2035], [0.9944, 0.6639, 0.1997], [0.9954, 0.6534, 0.1958], [0.9961, 0.6428, 0.1916], [0.9965, 0.6319, 0.1874], [0.9968, 0.6209, 0.183], [0.9967, 0.6098, 0.1784], [0.9964, 0.5985, 0.1738], [0.9959, 0.587, 0.169], [0.9952, 0.5755, 0.1641], [0.9942, 0.5639, 0.1592], [0.993, 0.5521, 0.1542], [0.9915, 0.5404, 0.1491], [0.9899, 0.5285, 0.144], [0.988, 0.5167, 0.1388], [0.9859, 0.5048, 0.1337], [0.9836, 0.4929, 0.1285], [0.9811, 0.481, 0.1233], [0.9784, 0.4692, 0.1182], [0.9754, 0.4574, 0.113], [0.9723, 0.4456, 0.108], [0.969, 0.434, 0.1029], [0.9656, 0.4224, 0.098], [0.9619, 0.4109, 0.0931], [0.958, 0.3996, 0.0883], [0.954, 0.3884, 0.0836], [0.9498, 0.3773, 0.079], [0.9454, 0.3664, 0.0746], [0.9408, 0.3557, 0.0703], [0.9361, 0.3451, 0.0662], [0.9312, 0.3348, 0.0622], [0.9262, 0.3247, 0.0584], [0.921, 0.3149, 0.0548], [0.9157, 0.3053, 0.0513], [0.9102, 0.296, 0.0481], [0.9046, 0.287, 0.0452], [0.8989, 0.2782, 0.0424], [0.893, 0.2698, 0.0399], [0.8869, 0.2615, 0.0375], [0.8807, 0.2533, 0.0352], [0.8742, 0.2453, 0.033], [0.8676, 0.2373, 0.0308], [0.8608, 0.2294, 0.0288], [0.8538, 0.2217, 0.0268], [0.8466, 0.2141, 0.0249], [0.8393, 0.2065, 0.023], [0.8317, 0.1991, 0.0213], [0.824, 0.1918, 0.0197], [0.8161, 0.1846, 0.0181], [0.808, 0.1775, 0.0166], [0.7997, 0.1706, 0.0152], [0.7912, 0.1637, 0.0139], [0.7826, 0.1569, 0.0126], [0.7738, 0.1503, 0.0115], [0.7648, 0.1437, 0.0104], [0.7556, 0.1373, 0.0094], [0.7462, 0.131, 0.0085], [0.7366, 0.1248, 0.0077], [0.7269, 0.1187, 0.007], [0.7169, 0.1127, 0.0063], [0.7068, 0.1068, 0.0057], [0.6965, 0.101, 0.0052], [0.686, 0.0954, 0.0048], [0.6754, 0.0898, 0.0045], [0.6645, 0.0844, 0.0042], [0.6534, 0.079, 0.0041], [0.6422, 0.0738, 0.004], [0.6308, 0.0687, 0.004], [0.6192, 0.0637, 0.0041], [0.6075, 0.0588, 0.0043], [0.5955, 0.054, 0.0045], [0.5834, 0.0493, 0.0049], [0.571, 0.0447, 0.0053], [0.5585, 0.0403, 0.0058], [0.5458, 0.0359, 0.0064], [0.533, 0.0317, 0.007], [0.5199, 0.0276, 0.0078], [0.5066, 0.0235, 0.0086], [0.4932, 0.0196, 0.0096], [0.4796, 0.0158, 0.0106]]}, "viridis": {"interpolate": true, "colors": [[0.267, 0.0049, 0.3294], [0.2685, 0.0096, 0.3354], [0.2699, 0.0146, 0.3414], [0.2713, 0.0199, 0.3473], [0.2726, 0.0256, 0.3531], [0.2738, 0.0315, 0.3589], [0.275, 0.0378, 0.3645], [0.276, 0.0442, 0.3702], [0.277, 0.0503, 0.3757], [0.2779, 0.0563, 0.3812], [0.2788, 0.0621, 0.3866], [0.2796, 0.0678, 0.3919], [0.2803, 0.0734, 0.3972], [0.2809, 0.0789, 0.4023], [0.2814, 0.0843, 0.4074], [0.2819, 0.0897, 0.4124], [0.2823, 0.095, 0.4173], [0.2827, 0.1002, 0.4222], [0.2829, 0.1054, 0.4269], [0.2831, 0.1106, 0.4316], [0.2832, 0.1157, 0.4361], [0.2832, 0.1208, 0.4406], [0.2832, 0.1258, 0.445], [0.2831, 0.1309, 0.4492], [0.2829, 0.1359, 0.4534], [0.2826, 0.1409, 0.4575], [0.2823, 0.1459, 0.4615], [0.2819, 0.1509, 0.4654], [0.2814, 0.1558, 0.4692], [0.2809, 0.1608, 0.4729], [0.2803, 0.1657, 0.4765], [0.2796, 0.1706, 0.48], [0.2788, 0.1755, 0.4834], [0.278, 0.1804, 0.4867], [0.2771, 0.1852, 0.4899], [0.2762, 0.1901, 0.493], [0.2752, 0.1949, 0.496], [0.2741, 0.1997, 0.4989], [0.273, 0.2045, 0.5017], [0.2718, 0.2093, 0.5044], [0.2706, 0.2141, 0.5071], [0.2693, 0.2188, 0.5096], [0.268, 0.2235, 0.512], [0.2666, 0.2283, 0.5143], [0.2651, 0.233, 0.5166], [0.2637, 0.2376, 0.5188], [0.2621, 0.2423, 0.5208], [0.2606, 0.2469, 0.5228], [0.259, 0.2515, 0.5247], [0.2573, 0.2561, 0.5266], [0.2556, 0.2607, 0.5283], [0.2539, 0.2653, 0.53], [0.2522, 0.2698, 0.5316], [0.2504, 0.2743, 0.5331], [0.2486, 0.2788, 0.5346], [0.2468, 0.2832, 0.5359], [0.245, 0.2877, 0.5373], [0.2431, 0.2921, 0.5385], [0.2412, 0.2965, 0.5397], [0.2393, 0.3009, 0.5408], [0.2374, 0.3052, 0.5419], [0.2355, 0.3095, 0.5429], [0.2336, 0.3138, 0.5439], [0.2317, 0.3181, 0.5448], [0.2297, 0.3224, 0.5457], [0.2278, 0.3266, 0.5465], [0.2259, 0.3308, 0.5473], [0.2239, 0.335, 0.5481], [0.222, 0.3392, 0.5488], [0.2201, 0.3433, 0.5494], [0.2181, 0.3474, 0.55], [0.2162, 0.3515, 0.5506], [0.2143, 0.3556, 0.5512], [0.2124, 0.3597, 0.5517], [0.2105, 0.3637, 0.5522], [0.2086, 0.3678, 0.5527], [0.2068, 0.3718, 0.5531], [0.2049, 0.3757, 0.5535], [0.2031, 0.3797, 0.5539], [0.2012, 0.3837, 0.5543], [0.1994, 0.3876, 0.5546], [0.1976, 0.3915, 0.555], [0.1959, 0.3954, 0.5553], [0.1941, 0.3993, 0.5556], [0.1924, 0.4032, 0.5558], [0.1906, 0.4071, 0.5561], [0.1889, 0.4109, 0.5563], [0.1872, 0.4147, 0.5565], [0.1856, 0.4186, 0.5568], [0.1839, 0.4224, 0.5569], [0.1823, 0.4262, 0.5571], [0.1806, 0.43, 0.5573], [0.179, 0.4338, 0.5574], [0.1774, 0.4375, 0.5576], [0.1758, 0.4413, 0.5577], [0.1743, 0.445, 0.5578], [0.1727, 0.4488, 0.5579], [0.1712, 0.4525, 0.558], [0.1696, 0.4563, 0.558], [0.1681, 0.46, 0.5581], [0.1666, 0.4637, 0.5581], [0.1651, 0.4674, 0.5581], [0.1636, 0.4711, 0.5581], [0.1621, 0.4748, 0.5581], [0.1607, 0.4785, 0.5581], [0.1592, 0.4822, 0.5581], [0.1577, 0.4859, 0.558], [0.1563, 0.4896, 0.5579], [0.1548, 0.4933, 0.5578], [0.1534, 0.497, 0.5577], [0.1519, 0.5007, 0.5576], [0.1505, 0.5044, 0.5574], [0.149, 0.5081, 0.5572], [0.1476, 0.5117, 0.557], [0.1462, 0.5154, 0.5568], [0.1448, 0.5191, 0.5566], [0.1433, 0.5228, 0.5563], [0.1419, 0.5265, 0.556], [0.1405, 0.5301, 0.5557], [0.1391, 0.5338, 0.5553], [0.1378, 0.5375, 0.5549], [0.1364, 0.5412, 0.5545], [0.1351, 0.5449, 0.554], [0.1337, 0.5485, 0.5535], [0.1324, 0.5522, 0.553], [0.1312, 0.5559, 0.5525], [0.1299, 0.5596, 0.5519], [0.1287, 0.5633, 0.5512], [0.1276, 0.5669, 0.5506], [0.1265, 0.5706, 0.5498], [0.1254, 0.5743, 0.5491], [0.1244, 0.578, 0.5483], [0.1235, 0.5817, 0.5474], [0.1226, 0.5854, 0.5466], [0.1218, 0.5891, 0.5456], [0.1211, 0.5927, 0.5446], [0.1206, 0.5964, 0.5436], [0.1201, 0.6001, 0.5425], [0.1197, 0.6038, 0.5414], [0.1195, 0.6075, 0.5402], [0.1194, 0.6111, 0.539], [0.1195, 0.6148, 0.5377], [0.1197, 0.6185, 0.5363], [0.1201, 0.6222, 0.5349], [0.1206, 0.6258, 0.5335], [0.1214, 0.6295, 0.532], [0.1223, 0.6332, 0.5304], [0.1234, 0.6368, 0.5288], [0.1248, 0.6405, 0.5271], [0.1263, 0.6441, 0.5253], [0.1281, 0.6477, 0.5235], [0.1301, 0.6514, 0.5216], [0.1323, 0.655, 0.5197], [0.1347, 0.6586, 0.5176], [0.1373, 0.6623, 0.5156], [0.1402, 0.6659, 0.5134], [0.1433, 0.6695, 0.5112], [0.1466, 0.673, 0.5089], [0.1501, 0.6766, 0.5066], [0.1539, 0.6802, 0.5042], [0.1579, 0.6838, 0.5017], [0.162, 0.6873, 0.4991], [0.1664, 0.6909, 0.4965], [0.1709, 0.6944, 0.4938], [0.1757, 0.6979, 0.491], [0.1807, 0.7014, 0.4882], [0.1858, 0.7049, 0.4853], [0.1911, 0.7084, 0.4823], [0.1966, 0.7118, 0.4792], [0.2022, 0.7153, 0.4761], [0.208, 0.7187, 0.4729], [0.214, 0.7221, 0.4696], [0.2201, 0.7255, 0.4662], [0.2264, 0.7289, 0.4628], [0.2328, 0.7322, 0.4593], [0.2394, 0.7356, 0.4557], [0.2461, 0.7389, 0.452], [0.2529, 0.7422, 0.4483], [0.2599, 0.7455, 0.4445], [0.2669, 0.7488, 0.4406], [0.2741, 0.752, 0.4366], [0.2815, 0.7552, 0.4326], [0.2889, 0.7584, 0.4284], [0.2965, 0.7616, 0.4242], [0.3041, 0.7647, 0.4199], [0.3119, 0.7678, 0.4156], [0.3198, 0.7709, 0.4112], [0.3278, 0.774, 0.4066], [0.3359, 0.777, 0.402], [0.3441, 0.78, 0.3974], [0.3524, 0.783, 0.3926], [0.3607, 0.786, 0.3878], [0.3692, 0.7889, 0.3829], [0.3778, 0.7918, 0.3779], [0.3864, 0.7946, 0.3729], [0.3952, 0.7975, 0.3678], [0.404, 0.8003, 0.3626], [0.4129, 0.803, 0.3573], [0.4219, 0.8058, 0.3519], [0.431, 0.8085, 0.3465], [0.4401, 0.8111, 0.341], [0.4494, 0.8138, 0.3354], [0.4587, 0.8164, 0.3297], [0.4681, 0.8189, 0.324], [0.4775, 0.8214, 0.3182], [0.487, 0.8239, 0.3123], [0.4966, 0.8264, 0.3064], [0.5063, 0.8288, 0.3004], [0.516, 0.8312, 0.2943], [0.5258, 0.8335, 0.2881], [0.5356, 0.8358, 0.2819], [0.5455, 0.838, 0.2756], [0.5555, 0.8403, 0.2693], [0.5655, 0.8424, 0.2629], [0.5756, 0.8446, 0.2564], [0.5857, 0.8467, 0.2499], [0.5958, 0.8487, 0.2433], [0.606, 0.8507, 0.2367], [0.6163, 0.8527, 0.2301], [0.6266, 0.8546, 0.2234], [0.6369, 0.8565, 0.2166], [0.6473, 0.8584, 0.2099], [0.6576, 0.8602, 0.2031], [0.6681, 0.862, 0.1963], [0.6785, 0.8637, 0.1895], [0.6889, 0.8654, 0.1827], [0.6994, 0.8671, 0.176], [0.7099, 0.8688, 0.1693], [0.7204, 0.8704, 0.1626], [0.7309, 0.8719, 0.156], [0.7414, 0.8734, 0.1496], [0.7519, 0.875, 0.1432], [0.7624, 0.8764, 0.1371], [0.7729, 0.8779, 0.1311], [0.7833, 0.8793, 0.1254], [0.7938, 0.8807, 0.12], [0.8042, 0.882, 0.115], [0.8146, 0.8834, 0.1103], [0.8249, 0.8847, 0.1062], [0.8353, 0.886, 0.1026], [0.8456, 0.8873, 0.0997], [0.8558, 0.8886, 0.0975], [0.866, 0.8899, 0.096], [0.8762, 0.8911, 0.0952], [0.8863, 0.8924, 0.0954], [0.8963, 0.8936, 0.0963], [0.9063, 0.8949, 0.0981], [0.9162, 0.8961, 0.1007], [0.9261, 0.8973, 0.1041], [0.9359, 0.8986, 0.1081], [0.9456, 0.8998, 0.1128], [0.9553, 0.9011, 0.1181], [0.9649, 0.9023, 0.1239], [0.9744, 0.9036, 0.1302], [0.9839, 0.9049, 0.1369], [0.9932, 0.9062, 0.1439]]}, "hsv": {"interpolate": true, "colors": [[1.0, 0.0, 0.0], [1.0, 0.0232, 0.0], [1.0, 0.0463, 0.0], [1.0, 0.0695, 0.0], [1.0, 0.0926, 0.0], [1.0, 0.1158, 0.0], [1.0, 0.139, 0.0], [1.0, 0.1621, 0.0], [1.0, 0.1853, 0.0], [1.0, 0.2085, 0.0], [1.0, 0.2316, 0.0], [1.0, 0.2548, 0.0], [1.0, 0.2779, 0.0], [1.0, 0.3011, 0.0], [1.0, 0.3243, 0.0], [1.0, 0.3474, 0.0], [1.0, 0.3706, 0.0], [1.0, 0.3938, 0.0], [1.0, 0.4169, 0.0], [1.0, 0.4401, 0.0], [1.0, 0.4632, 0.0], [1.0, 0.4864, 0.0], [1.0, 0.5096, 0.0], [1.0, 0.5327, 0.0], [1.0, 0.5559, 0.0], [1.0, 0.579, 0.0], [1.0, 0.6022, 0.0], [1.0, 0.6254, 0.0], [1.0, 0.6485, 0.0], [1.0, 0.6717, 0.0], [1.0, 0.6949, 0.0], [1.0, 0.718, 0.0], [1.0, 0.7412, 0.0], [1.0, 0.7643, 0.0], [1.0, 0.7875, 0.0], [1.0, 0.8107, 0.0], [1.0, 0.8338, 0.0], [1.0, 0.857, 0.0], [1.0, 0.8801, 0.0], [1.0, 0.9033, 0.0], [1.0, 0.9265, 0.0], [0.996, 0.9456, 0.0], [0.9882, 0.961, 0.0], [0.9805, 0.9765, 0.0], [0.9728, 0.9919, 0.0], [0.9577, 1.0, 0.0], [0.9346, 1.0, 0.0], [0.9114, 1.0, 0.0], [0.8882, 1.0, 0.0], [0.8651, 1.0, 0.0], [0.8419, 1.0, 0.0], [0.8187, 1.0, 0.0], [0.7956, 1.0, 0.0], [0.7724, 1.0, 0.0], [0.7493, 1.0, 0.0], [0.7261, 1.0, 0.0], [0.7029, 1.0, 0.0], [0.6798, 1.0, 0.0], [0.6566, 1.0, 0.0], [0.6335, 1.0, 0.0], [0.6103, 1.0, 0.0], [0.5871, 1.0, 0.0], [0.564, 1.0, 0.0], [0.5408, 1.0, 0.0], [0.5176, 1.0, 0.0], [0.4945, 1.0, 0.0], [0.4713, 1.0, 0.0], [0.4482, 1.0, 0.0], [0.425, 1.0, 0.0], [0.4018, 1.0, 0.0], [0.3787, 1.0, 0.0], [0.3555, 1.0, 0.0], [0.3324, 1.0, 0.0], [0.3092, 1.0, 0.0], [0.286, 1.0, 0.0], [0.2629, 1.0, 0.0], [0.2397, 1.0, 0.0], [0.2165, 1.0, 0.0], [0.1934, 1.0, 0.0], [0.1702, 1.0, 0.0], [0.1471, 1.0, 0.0], [0.1239, 1.0, 0.0], [0.1007, 1.0, 0.0], [0.0776, 1.0, 0.0], [0.0544, 1.0, 0.0], [0.0312, 1.0, 0.0], [0.0235, 1.0, 0.0154], [0.0158, 1.0, 0.0309], [0.0081, 1.0, 0.0463], [0.0004, 1.0, 0.0618], [0.0, 1.0, 0.0846], [0.0, 1.0, 0.1077], [0.0, 1.0, 0.1309], [0.0, 1.0, 0.154], [0.0, 1.0, 0.1772], [0.0, 1.0, 0.2004], [0.0, 1.0, 0.2235], [0.0, 1.0, 0.2467], [0.0, 1.0, 0.2699], [0.0, 1.0, 0.293], [0.0, 1.0, 0.3162], [0.0, 1.0, 0.3393], [0.0, 1.0, 0.3625], [0.0, 1.0, 0.3857], [0.0, 1.0, 0.4088], [0.0, 1.0, 0.432], [0.0, 1.0, 0.4551], [0.0, 1.0, 0.4783], [0.0, 1.0, 0.5015], [0.0, 1.0, 0.5246], [0.0, 1.0, 0.5478], [0.0, 1.0, 0.571], [0.0, 1.0, 0.5941], [0.0, 1.0, 0.6173], [0.0, 1.0, 0.6404], [0.0, 1.0, 0.6636], [0.0, 1.0, 0.6868], [0.0, 1.0, 0.7099], [0.0, 1.0, 0.7331], [0.0, 1.0, 0.7562], [0.0, 1.0, 0.7794], [0.0, 1.0, 0.8026], [0.0, 1.0, 0.8257], [0.0, 1.0, 0.8489], [0.0, 1.0, 0.8721], [0.0, 1.0, 0.8952], [0.0, 1.0, 0.9184], [0.0, 1.0, 0.9415], [0.0, 1.0, 0.9647], [0.0, 1.0, 0.9879], [0.0, 0.989, 1.0], [0.0, 0.9658, 1.0], [0.0, 0.9426, 1.0], [0.0, 0.9195, 1.0], [0.0, 0.8963, 1.0], [0.0, 0.8732, 1.0], [0.0, 0.85, 1.0], [0.0, 0.8268, 1.0], [0.0, 0.8037, 1.0], [0.0, 0.7805, 1.0], [0.0, 0.7574, 1.0], [0.0, 0.7342, 1.0], [0.0, 0.711, 1.0], [0.0, 0.6879, 1.0], [0.0, 0.6647, 1.0], [0.0, 0.6415, 1.0], [0.0, 0.6184, 1.0], [0.0, 0.5952, 1.0], [0.0, 0.5721, 1.0], [0.0, 0.5489, 1.0], [0.0, 0.5257, 1.0], [0.0, 0.5026, 1.0], [0.0, 0.4794, 1.0], [0.0, 0.4563, 1.0], [0.0, 0.4331, 1.0], [0.0, 0.4099, 1.0], [0.0, 0.3868, 1.0], [0.0, 0.3636, 1.0], [0.0, 0.3404, 1.0], [0.0, 0.3173, 1.0], [0.0, 0.2941, 1.0], [0.0, 0.271, 1.0], [0.0, 0.2478, 1.0], [0.0, 0.2246, 1.0], [0.0, 0.2015, 1.0], [0.0, 0.1783, 1.0], [0.0, 0.1551, 1.0], [0.0, 0.132, 1.0], [0.0, 0.1088, 1.0], [0.0, 0.0857, 1.0], [0.0, 0.0625, 1.0], [0.0077, 0.0471, 1.0], [0.0154, 0.0316, 1.0], [0.0232, 0.0162, 1.0], [0.0309, 0.0007, 1.0], [0.0533, 0.0, 1.0], [0.0765, 0.0, 1.0], [0.0996, 0.0, 1.0], [0.1228, 0.0, 1.0], [0.146, 0.0, 1.0], [0.1691, 0.0, 1.0], [0.1923, 0.0, 1.0], [0.2154, 0.0, 1.0], [0.2386, 0.0, 1.0], [0.2618, 0.0, 1.0], [0.2849, 0.0, 1.0], [0.3081, 0.0, 1.0], [0.3312, 0.0, 1.0], [0.3544, 0.0, 1.0], [0.3776, 0.0, 1.0], [0.4007, 0.0, 1.0], [0.4239, 0.0, 1.0], [0.4471, 0.0, 1.0], [0.4702, 0.0, 1.0], [0.4934, 0.0, 1.0], [0.5165, 0.0, 1.0], [0.5397, 0.0, 1.0], [0.5629, 0.0, 1.0], [0.586, 0.0, 1.0], [0.6092, 0.0, 1.0], [0.6324, 0.0, 1.0], [0.6555, 0.0, 1.0], [0.6787, 0.0, 1.0], [0.7018, 0.0, 1.0], [0.725, 0.0, 1.0], [0.7482, 0.0, 1.0], [0.7713, 0.0, 1.0], [0.7945, 0.0, 1.0], [0.8176, 0.0, 1.0], [0.8408, 0.0, 1.0], [0.864, 0.0, 1.0], [0.8871, 0.0, 1.0], [0.9103, 0.0, 1.0], [0.9335, 0.0, 1.0], [0.9566, 0.0, 1.0], [0.9724, 0.0, 0.9926], [0.9801, 0.0, 0.9772], [0.9879, 0.0, 0.9618], [0.9956, 0.0, 0.9463], [1.0, 0.0, 0.9276], [1.0, 0.0, 0.9044], [1.0, 0.0, 0.8813], [1.0, 0.0, 0.8581], [1.0, 0.0, 0.8349], [1.0, 0.0, 0.8118], [1.0, 0.0, 0.7886], [1.0, 0.0, 0.7654], [1.0, 0.0, 0.7423], [1.0, 0.0, 0.7191], [1.0, 0.0, 0.696], [1.0, 0.0, 0.6728], [1.0, 0.0, 0.6496], [1.0, 0.0, 0.6265], [1.0, 0.0, 0.6033], [1.0, 0.0, 0.5801], [1.0, 0.0, 0.557], [1.0, 0.0, 0.5338], [1.0, 0.0, 0.5107], [1.0, 0.0, 0.4875], [1.0, 0.0, 0.4643], [1.0, 0.0, 0.4412], [1.0, 0.0, 0.418], [1.0, 0.0, 0.3949], [1.0, 0.0, 0.3717], [1.0, 0.0, 0.3485], [1.0, 0.0, 0.3254], [1.0, 0.0, 0.3022], [1.0, 0.0, 0.279], [1.0, 0.0, 0.2559], [1.0, 0.0, 0.2327], [1.0, 0.0, 0.2096], [1.0, 0.0, 0.1864], [1.0, 0.0, 0.1632], [1.0, 0.0, 0.1401], [1.0, 0.0, 0.1169], [1.0, 0.0, 0.0938]]}, "jet": {"interpolate": true, "colors": [[0.0, 0.0, 0.5], [0.0, 0.0, 0.5178], [0.0, 0.0, 0.5357], [0.0, 0.0, 0.5535], [0.0, 0.0, 0.5713], [0.0, 0.0, 0.5891], [0.0, 0.0, 0.607], [0.0, 0.0, 0.6248], [0.0, 0.0, 0.6426], [0.0, 0.0, 0.6604], [0.0, 0.0, 0.6783], [0.0, 0.0, 0.6961], [0.0, 0.0, 0.7139], [0.0, 0.0, 0.7317], [0.0, 0.0, 0.7496], [0.0, 0.0, 0.7674], [0.0, 0.0, 0.7852], [0.0, 0.0, 0.803], [0.0, 0.0, 0.8209], [0.0, 0.0, 0.8387], [0.0, 0.0, 0.8565], [0.0, 0.0, 0.8743], [0.0, 0.0, 0.8922], [0.0, 0.0, 0.91], [0.0, 0.0, 0.9278], [0.0, 0.0, 0.9456], [0.0, 0.0, 0.9635], [0.0, 0.0, 0.9813], [0.0, 0.0, 0.9991], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [0.0, 0.002, 1.0], [0.0, 0.0176, 1.0], [0.0, 0.0333, 1.0], [0.0, 0.049, 1.0], [0.0, 0.0647, 1.0], [0.0, 0.0804, 1.0], [0.0, 0.0961, 1.0], [0.0, 0.1118, 1.0], [0.0, 0.1275, 1.0], [0.0, 0.1431, 1.0], [0.0, 0.1588, 1.0], [0.0, 0.1745, 1.0], [0.0, 0.1902, 1.0], [0.0, 0.2059, 1.0], [0.0, 0.2216, 1.0], [0.0, 0.2373, 1.0], [0.0, 0.2529, 1.0], [0.0, 0.2686, 1.0], [0.0, 0.2843, 1.0], [0.0, 0.3, 1.0], [0.0, 0.3157, 1.0], [0.0, 0.3314, 1.0], [0.0, 0.3471, 1.0], [0.0, 0.3627, 1.0], [0.0, 0.3784, 1.0], [0.0, 0.3941, 1.0], [0.0, 0.4098, 1.0], [0.0, 0.4255, 1.0], [0.0, 0.4412, 1.0], [0.0, 0.4569, 1.0], [0.0, 0.4725, 1.0], [0.0, 0.4882, 1.0], [0.0, 0.5039, 1.0], [0.0, 0.5196, 1.0], [0.0, 0.5353, 1.0], [0.0, 0.551, 1.0], [0.0, 0.5667, 1.0], [0.0, 0.5824, 1.0], [0.0, 0.598, 1.0], [0.0, 0.6137, 1.0], [0.0, 0.6294, 1.0], [0.0, 0.6451, 1.0], [0.0, 0.6608, 1.0], [0.0, 0.6765, 1.0], [0.0, 0.6922, 1.0], [0.0, 0.7078, 1.0], [0.0, 0.7235, 1.0], [0.0, 0.7392, 1.0], [0.0, 0.7549, 1.0], [0.0, 0.7706, 1.0], [0.0, 0.7863, 1.0], [0.0, 0.802, 1.0], [0.0, 0.8176, 1.0], [0.0, 0.8333, 1.0], [0.0, 0.849, 1.0], [0.0, 0.8647, 0.9962], [0.0, 0.8804, 0.9836], [0.0, 0.8961, 0.9709], [0.0095, 0.9118, 0.9583], [0.0221, 0.9275, 0.9456], [0.0348, 0.9431, 0.933], [0.0474, 0.9588, 0.9203], [0.0601, 0.9745, 0.9077], [0.0727, 0.9902, 0.895], [0.0854, 1.0, 0.8824], [0.098, 1.0, 0.8697], [0.1107, 1.0, 0.8571], [0.1233, 1.0, 0.8444], [0.136, 1.0, 0.8318], [0.1486, 1.0, 0.8191], [0.1613, 1.0, 0.8065], [0.1739, 1.0, 0.7938], [0.1866, 1.0, 0.7812], [0.1992, 1.0, 0.7685], [0.2119, 1.0, 0.7559], [0.2245, 1.0, 0.7432], [0.2372, 1.0, 0.7306], [0.2498, 1.0, 0.7179], [0.2625, 1.0, 0.7052], [0.2751, 1.0, 0.6926], [0.2878, 1.0, 0.6799], [0.3004, 1.0, 0.6673], [0.3131, 1.0, 0.6546], [0.3257, 1.0, 0.642], [0.3384, 1.0, 0.6293], [0.351, 1.0, 0.6167], [0.3637, 1.0, 0.604], [0.3763, 1.0, 0.5914], [0.389, 1.0, 0.5787], [0.4016, 1.0, 0.5661], [0.4143, 1.0, 0.5534], [0.4269, 1.0, 0.5408], [0.4396, 1.0, 0.5281], [0.4522, 1.0, 0.5155], [0.4649, 1.0, 0.5028], [0.4775, 1.0, 0.4902], [0.4902, 1.0, 0.4775], [0.5028, 1.0, 0.4649], [0.5155, 1.0, 0.4522], [0.5281, 1.0, 0.4396], [0.5408, 1.0, 0.4269], [0.5534, 1.0, 0.4143], [0.5661, 1.0, 0.4016], [0.5787, 1.0, 0.389], [0.5914, 1.0, 0.3763], [0.604, 1.0, 0.3637], [0.6167, 1.0, 0.351], [0.6293, 1.0, 0.3384], [0.642, 1.0, 0.3257], [0.6546, 1.0, 0.3131], [0.6673, 1.0, 0.3004], [0.6799, 1.0, 0.2878], [0.6926, 1.0, 0.2751], [0.7052, 1.0, 0.2625], [0.7179, 1.0, 0.2498], [0.7306, 1.0, 0.2372], [0.7432, 1.0, 0.2245], [0.7559, 1.0, 0.2119], [0.7685, 1.0, 0.1992], [0.7812, 1.0, 0.1866], [0.7938, 1.0, 0.1739], [0.8065, 1.0, 0.1613], [0.8191, 1.0, 0.1486], [0.8318, 1.0, 0.136], [0.8444, 1.0, 0.1233], [0.8571, 1.0, 0.1107], [0.8697, 1.0, 0.098], [0.8824, 1.0, 0.0854], [0.895, 1.0, 0.0727], [0.9077, 1.0, 0.0601], [0.9203, 1.0, 0.0474], [0.933, 1.0, 0.0348], [0.9456, 0.9884, 0.0221], [0.9583, 0.9739, 0.0095], [0.9709, 0.9593, 0.0], [0.9836, 0.9448, 0.0], [0.9962, 0.9303, 0.0], [1.0, 0.9158, 0.0], [1.0, 0.9012, 0.0], [1.0, 0.8867, 0.0], [1.0, 0.8722, 0.0], [1.0, 0.8577, 0.0], [1.0, 0.8431, 0.0], [1.0, 0.8286, 0.0], [1.0, 0.8141, 0.0], [1.0, 0.7996, 0.0], [1.0, 0.785, 0.0], [1.0, 0.7705, 0.0], [1.0, 0.756, 0.0], [1.0, 0.7415, 0.0], [1.0, 0.7269, 0.0], [1.0, 0.7124, 0.0], [1.0, 0.6979, 0.0], [1.0, 0.6834, 0.0], [1.0, 0.6688, 0.0], [1.0, 0.6543, 0.0], [1.0, 0.6398, 0.0], [1.0, 0.6253, 0.0], [1.0, 0.6107, 0.0], [1.0, 0.5962, 0.0], [1.0, 0.5817, 0.0], [1.0, 0.5672, 0.0], [1.0, 0.5527, 0.0], [1.0, 0.5381, 0.0], [1.0, 0.5236, 0.0], [1.0, 0.5091, 0.0], [1.0, 0.4946, 0.0], [1.0, 0.48, 0.0], [1.0, 0.4655, 0.0], [1.0, 0.451, 0.0], [1.0, 0.4365, 0.0], [1.0, 0.4219, 0.0], [1.0, 0.4074, 0.0], [1.0, 0.3929, 0.0], [1.0, 0.3784, 0.0], [1.0, 0.3638, 0.0], [1.0, 0.3493, 0.0], [1.0, 0.3348, 0.0], [1.0, 0.3203, 0.0], [1.0, 0.3057, 0.0], [1.0, 0.2912, 0.0], [1.0, 0.2767, 0.0], [1.0, 0.2622, 0.0], [1.0, 0.2476, 0.0], [1.0, 0.2331, 0.0], [1.0, 0.2186, 0.0], [1.0, 0.2041, 0.0], [1.0, 0.1895, 0.0], [1.0, 0.175, 0.0], [1.0, 0.1605, 0.0], [1.0, 0.146, 0.0], [1.0, 0.1314, 0.0], [1.0, 0.1169, 0.0], [1.0, 0.1024, 0.0], [1.0, 0.0879, 0.0], [0.9991, 0.0733, 0.0], [0.9813, 0.0588, 0.0], [0.9635, 0.0443, 0.0], [0.9456, 0.0298, 0.0], [0.9278, 0.0153, 0.0], [0.91, 0.0007, 0.0], [0.8922, 0.0, 0.0], [0.8743, 0.0, 0.0], [0.8565, 0.0, 0.0], [0.8387, 0.0, 0.0], [0.8209, 0.0, 0.0], [0.803, 0.0, 0.0], [0.7852, 0.0, 0.0], [0.7674, 0.0, 0.0], [0.7496, 0.0, 0.0], [0.7317, 0.0, 0.0], [0.7139, 0.0, 0.0], [0.6961, 0.0, 0.0], [0.6783, 0.0, 0.0], [0.6604, 0.0, 0.0], [0.6426, 0.0, 0.0], [0.6248, 0.0, 0.0], [0.607, 0.0, 0.0], [0.5891, 0.0, 0.0], [0.5713, 0.0, 0.0], [0.5535, 0.0, 0.0], [0.5357, 0.0, 0.0], [0.5178, 0.0, 0.0], [0.5, 0.0, 0.0]]}};
+
+const turbo = partial('turbo');
+const turbo_r = partial('turbo_r');
+const viridis = partial('viridis');
+const viridis_r = partial('viridis_r');
+const hsv = partial('hsv');
+const hsv_r = partial('hsv_r');
+const jet = partial('jet');
+const jet_r = partial('jet_r');
+
+
+/*
+Define auxiliary functions for evaluating colormaps
+ */
+
+function ColorToHex(color) {
+ var hexadecimal = color.toString(16);
+ return hexadecimal.length == 1 ? "0" + hexadecimal : hexadecimal;
+}
+
+function ConvertRGBtoHex(color_arr) {
+ return "#" + ColorToHex(color_arr[0]) + ColorToHex(color_arr[1]) + ColorToHex(color_arr[2]);
+}
+
+function evaluate_cmap(x, name, reverse) {
+ /**
+ * Evaluate colormap `name` at some value `x`.
+ * @param {number} x - The value (between 0 and 1) at which to evaluate the colormap.
+ * @param {string} name - The name of the colormap (see matplotlib documentation).
+ * @reverse {boolean} reverse - Whether or not to reverse the colormap.
+ * @return {list} - A 3-tuple (R, G, B) containing the color assigned to `x`.
+ */
+
+ // Ensure that the value of `x` is valid (i.e., 0 <= x <= 1)
+ if (!(0 <= x <= 1)) {
+ alert('Illegal value for x! Must be in [0, 1].')
+ }
+
+ // Ensure that `name` is a valid colormap
+ if (!(name in cm_data)) {
+ alert('Colormap ' + name + 'does not exist!');
+ }
+
+ // We can get the reverse colormap by evaluating colormap(1-x)
+ if (reverse === true) {
+ x = 1 - x;
+ }
+
+ // Get the colors and whether or not we need to interpolate
+ let colors = cm_data[name]['colors'];
+ let interpolate = cm_data[name]['interpolate'];
+
+ if (interpolate === true) {
+ return interpolated(x, colors);
+ } else {
+ return qualitative(x, colors);
+ }
+}
+
+function interpolated(x, colors) {
+ let lo = Math.floor(x * (colors.length - 1));
+ let hi = Math.ceil(x * (colors.length - 1));
+ let r = Math.round((colors[lo][0] + colors[hi][0]) / 2 * 255);
+ let g = Math.round((colors[lo][1] + colors[hi][1]) / 2 * 255);
+ let b = Math.round((colors[lo][2] + colors[hi][2]) / 2 * 255);
+ return [r, g, b];
+}
+
+function qualitative(x, colors) {
+ let idx = 0;
+ while (x > (idx + 1) / (colors.length - 0) ) { idx++; }
+ let r = Math.round(colors[idx][0] * 255);
+ let g = Math.round(colors[idx][1] * 255);
+ let b = Math.round(colors[idx][2] * 255);
+ return [r, g, b];
+}
+
+function partial(name) {
+ if (name.endsWith('_r')) {
+ return function(x) { return evaluate_cmap(x, name.substring(0, name.length - 2), true) };
+ } else {
+ return function(x) { return evaluate_cmap(x, name, false) };
+ }
+}
\ No newline at end of file
diff --git a/js/format.js b/js/format.js
new file mode 100644
index 0000000..9552181
--- /dev/null
+++ b/js/format.js
@@ -0,0 +1,398 @@
+/* SondeHub Tracker Format Incoming Data
+ *
+ * Author: Luke Prior
+ */
+
+function formatData(data, live) {
+ var response = {};
+ response.positions = {};
+ var dataTemp = [];
+ if (live) { // Websockets
+ if (!data.length) { // handle single sonde
+ data = {"entry": data};
+ }
+ for (let entry in data) {
+ var dataTempEntry = {};
+ var station = data[entry].uploader_callsign;
+ dataTempEntry.callsign = {};
+ //check if other stations also received this packet
+ if (vehicles.hasOwnProperty(data[entry].serial)) {
+ if (data[entry].datetime == vehicles[data[entry].serial].curr_position.gps_time) {
+ for (let key in vehicles[data[entry].serial].curr_position.callsign) {
+ if (vehicles[data[entry].serial].curr_position.callsign.hasOwnProperty(key)) {
+ if (key != station) {
+ dataTempEntry.callsign[key] = {};
+ if (vehicles[data[entry].serial].curr_position.callsign[key].hasOwnProperty("snr")) {
+ dataTempEntry.callsign[key].snr = vehicles[data[entry].serial].curr_position.callsign[key].snr;
+ }
+ if (vehicles[data[entry].serial].curr_position.callsign[key].hasOwnProperty("rssi")) {
+ dataTempEntry.callsign[key].rssi = vehicles[data[entry].serial].curr_position.callsign[key].rssi;
+ }
+ if (vehicles[data[entry].serial].curr_position.callsign[key].hasOwnProperty("frequency")) {
+ dataTempEntry.callsign[key].frequency = vehicles[data[entry].serial].curr_position.callsign[key].frequency;
+ }
+ }
+ }
+ }
+ }
+ }
+ dataTempEntry.callsign[station] = {};
+ if (data[entry].snr) {
+ dataTempEntry.callsign[station].snr = data[entry].snr;
+ }
+ if (data[entry].rssi) {
+ dataTempEntry.callsign[station].rssi = data[entry].rssi;
+ }
+ if (data[entry].frequency) {
+ dataTempEntry.callsign[station].frequency = data[entry].frequency;
+ }
+ dataTempEntry.gps_alt = data[entry].alt;
+ dataTempEntry.gps_lat = data[entry].lat;
+ dataTempEntry.gps_lon = data[entry].lon;
+
+ // Discard positions with null values.
+ if (dataTempEntry.gps_lat == 0 && dataTempEntry.gps_lon == 0) {
+ continue;
+ }
+
+ if (data[entry].heading) {
+ dataTempEntry.gps_heading = data[entry].heading;
+ }
+ dataTempEntry.gps_time = data[entry].datetime;
+ dataTempEntry.server_time = data[entry].datetime;
+ dataTempEntry.vehicle = data[entry].serial;
+ dataTempEntry.position_id = data[entry].serial + "-" + data[entry].datetime;
+ dataTempEntry.data = {};
+ if (data[entry].batt) {
+ dataTempEntry.data.batt = data[entry].batt;
+ }
+ if (data[entry].burst_timer) {
+ dataTempEntry.data.burst_timer = data[entry].burst_timer;
+ }
+ if (data[entry].frequency) {
+ dataTempEntry.data.frequency = data[entry].frequency;
+ }
+ if (data[entry].tx_frequency) {
+ dataTempEntry.data.frequency_tx = data[entry].tx_frequency;
+ }
+ if (data[entry].hasOwnProperty("humidity")) {
+ dataTempEntry.data.humidity = data[entry].humidity;
+ }
+ if (data[entry].hasOwnProperty("pressure")) {
+ dataTempEntry.data.pressure = data[entry].pressure;
+ }
+ if (data[entry].sats) {
+ dataTempEntry.data.sats = data[entry].sats;
+
+ // Drop frames where sats = 0! We do not want to be handling invalid positions.
+ if (dataTempEntry.data.sats == 0){
+ continue;
+ }
+ }
+ if (data[entry].hasOwnProperty("temp")) {
+ dataTempEntry.data.temperature_external = data[entry].temp;
+ }
+ // RS41 specific stuff
+ if (data[entry].hasOwnProperty("rs41_mainboard")) {
+ dataTempEntry.data.rs41_mainboard = data[entry].rs41_mainboard;
+ }
+ // Removed showing mainboard firmware, not really valuable
+
+ if (data[entry].type) {
+ dataTempEntry.data.type = data[entry].type;
+ dataTempEntry.type = data[entry].type;
+ }
+ if (data[entry].subtype) {
+ dataTempEntry.data.type = data[entry].subtype;
+ dataTempEntry.type = data[entry].subtype;
+ }
+
+ if (data[entry].manufacturer) {
+ // Instead of adding a separate manufacturer field, prefix the type with it.
+ if (dataTempEntry.data.type) {
+ dataTempEntry.data.type = data[entry].manufacturer + " " + dataTempEntry.data.type;
+ }
+ }
+
+ if (data[entry].xdata) {
+ dataTempEntry.data.xdata = data[entry].xdata;
+
+ if (data[entry].hasOwnProperty("pressure")) {
+ xdata_pressure = data[entry].pressure;
+ } else {
+ xdata_pressure = 1100.0;
+ }
+
+ var tempXDATA = parseXDATA(data[entry].xdata, xdata_pressure);
+ for (let field in tempXDATA) {
+ if (tempXDATA.hasOwnProperty(field)) {
+ if (field == "xdata_instrument") {
+ dataTempEntry.data.xdata_instrument = tempXDATA.xdata_instrument.join(', ');
+ } else {
+ dataTempEntry.data[field] = tempXDATA[field];
+ }
+ }
+ }
+ }
+ if (data[entry].serial.toLowerCase() != "xxxxxxxx") {
+ dataTemp.push(dataTempEntry);
+ }
+ }
+ } else if (data.length == null) { // Elasticsearch
+ for (let key in data) {
+ if (data.hasOwnProperty(key)) {
+ if (typeof data[key] === 'object') {
+ for (let i in data[key]) {
+ var dataTempEntry = {};
+ var station = data[key][i].uploader_callsign;
+ dataTempEntry.callsign = {};
+ dataTempEntry.callsign[station] = {};
+ if (data[key][i].snr) {
+ dataTempEntry.callsign[station].snr = data[key][i].snr;
+ }
+ if (data[key][i].rssi) {
+ dataTempEntry.callsign[station].rssi = data[key][i].rssi;
+ }
+ if (data[key][i].frequency) {
+ dataTempEntry.callsign[station].frequency = data[key][i].frequency;
+ }
+ dataTempEntry.gps_alt = data[key][i].alt;
+ dataTempEntry.gps_lat = data[key][i].lat;
+ dataTempEntry.gps_lon = data[key][i].lon;
+
+ // Discard positions with null values.
+ if (dataTempEntry.gps_lat == 0 && dataTempEntry.gps_lon == 0) {
+ continue;
+ }
+
+ if (data[key][i].heading) {
+ dataTempEntry.gps_heading = data[key][i].heading;
+ }
+ dataTempEntry.gps_time = data[key][i].datetime;
+ dataTempEntry.server_time = data[key][i].datetime;
+ dataTempEntry.vehicle = data[key][i].serial;
+ dataTempEntry.position_id = data[key][i].serial + "-" + data[key][i].datetime;
+ dataTempEntry.data = {};
+ if (data[key][i].batt) {
+ dataTempEntry.data.batt = data[key][i].batt;
+ }
+ if (data[key][i].burst_timer) {
+ dataTempEntry.data.burst_timer = data[key][i].burst_timer;
+ }
+ if (data[key][i].frequency) {
+ dataTempEntry.data.frequency = data[key][i].frequency;
+ }
+ if (data[key][i].tx_frequency) {
+ dataTempEntry.data.frequency_tx = data[key][i].tx_frequency;
+ }
+ if (data[key][i].hasOwnProperty("humidity")) {
+ dataTempEntry.data.humidity = data[key][i].humidity;
+ }
+
+ if (data[key][i].hasOwnProperty("pressure")) {
+ dataTempEntry.data.pressure = data[key][i].pressure;
+ }
+ if (data[key][i].sats) {
+ dataTempEntry.data.sats = data[key][i].sats;
+
+ // Drop frames where sats = 0! We do not want to be handling invalid positions.
+ if (dataTempEntry.data.sats == 0){
+ continue;
+ }
+ }
+ if (data[key][i].hasOwnProperty("temp")) {
+ dataTempEntry.data.temperature_external = data[key][i].temp;
+ }
+ if (data[key][i].type) {
+ dataTempEntry.data.type = data[key][i].type;
+ dataTempEntry.type = data[key][i].type;
+ }
+ if (data[key][i].subtype) {
+ dataTempEntry.data.type = data[key][i].subtype;
+ dataTempEntry.type = data[key][i].subtype;
+ }
+
+ if (data[key][i].manufacturer) {
+ // Instead of adding a separate manufacturer field, prefix the type with it.
+ if (dataTempEntry.data.type) {
+ dataTempEntry.data.type = data[key][i].manufacturer + " " + dataTempEntry.data.type;
+ }
+ }
+
+ // RS41 specific stuff
+ if (data[key][i].hasOwnProperty("rs41_mainboard")) {
+ dataTempEntry.data.rs41_mainboard = data[key][i].rs41_mainboard;
+ }
+ // Removed showing mainboard firmware, not really valuable
+
+ // XDATA Handling
+ if (data[key][i].xdata) {
+ dataTempEntry.data.xdata = data[key][i].xdata;
+ if (data[key][i].hasOwnProperty("pressure")) {
+ xdata_pressure = data[key][i].pressure;
+ } else {
+ xdata_pressure = 1100.0;
+ }
+ var tempXDATA = parseXDATA(data[key][i].xdata, xdata_pressure);
+ for (let field in tempXDATA) {
+ if (tempXDATA.hasOwnProperty(field)) {
+ if (field == "xdata_instrument") {
+ dataTempEntry.data.xdata_instrument = tempXDATA.xdata_instrument.join(', ');
+ } else {
+ dataTempEntry.data[field] = tempXDATA[field];
+ }
+ }
+ }
+ }
+ if (data[key][i].serial.toLowerCase() != "xxxxxxxx") {
+ dataTemp.push(dataTempEntry);
+ }
+ }
+ }
+ }
+ }
+ } else { // AWS
+ for (var i = data.length - 1; i >= 0; i--) {
+ if (data[i].hasOwnProperty('subtype') && data[i].subtype == "SondehubV1") { // SondeHub V1
+ var dataTempEntry = {};
+ var station = data[i].uploader_callsign;
+ dataTempEntry.callsign = {};
+ dataTempEntry.callsign[station] = {};
+ dataTempEntry.gps_alt = parseFloat(data[i].alt);
+ dataTempEntry.gps_lat = parseFloat(data[i].lat);
+ dataTempEntry.gps_lon = parseFloat(data[i].lon);
+ dataTempEntry.gps_time = data[i].time_received;
+ dataTempEntry.server_time = data[i].time_received;
+ dataTempEntry.vehicle = data[i].serial;
+ dataTempEntry.position_id = data[i].serial + "-" + data[i].time_received;
+ dataTempEntry.data = {};
+ if (data[i].humidity) {
+ dataTempEntry.data.humidity = parseFloat(data[i].humidity);
+ }
+ if (data[i].temp) {
+ dataTempEntry.data.temperature_external = parseFloat(data[i].temp);
+ }
+ dataTemp.push(dataTempEntry);
+ } else { // SondeHub V2
+ var dataTempEntry = {};
+ var station = data[i].uploader_callsign;
+ dataTempEntry.callsign = {};
+ dataTempEntry.callsign[station] = {};
+ if (data[i].snr) {
+ dataTempEntry.callsign[station].snr = data[i].snr;
+ }
+ if (data[i].rssi) {
+ dataTempEntry.callsign[station].rssi = data[i].rssi;
+ }
+ if (data[i].frequency) {
+ dataTempEntry.callsign[station].frequency = data[i].frequency;
+ }
+ dataTempEntry.gps_alt = data[i].alt;
+ dataTempEntry.gps_lat = data[i].lat;
+ dataTempEntry.gps_lon = data[i].lon;
+
+ // Discard positions with null values.
+ if (dataTempEntry.gps_lat == 0 && dataTempEntry.gps_lon == 0) {
+ continue;
+ }
+
+ if (data[i].heading) {
+ dataTempEntry.gps_heading = data[i].heading;
+ }
+ dataTempEntry.gps_time = data[i].datetime;
+ dataTempEntry.server_time = data[i].datetime;
+ dataTempEntry.vehicle = data[i].serial;
+ dataTempEntry.position_id = data[i].serial + "-" + data[i].datetime;
+ dataTempEntry.data = {};
+ if (data[i].batt) {
+ dataTempEntry.data.batt = data[i].batt;
+ }
+ if (data[i].burst_timer) {
+ dataTempEntry.data.burst_timer = data[i].burst_timer;
+ }
+ if (data[i].frequency) {
+ dataTempEntry.data.frequency = data[i].frequency;
+ }
+ if (data[i].tx_frequency) {
+ dataTempEntry.data.frequency_tx = data[i].tx_frequency;
+ }
+ if (data[i].hasOwnProperty("humidity")) {
+ dataTempEntry.data.humidity = data[i].humidity;
+ }
+ if (data[i].manufacturer) {
+ dataTempEntry.data.manufacturer = data[i].manufacturer;
+ }
+ if (data[i].hasOwnProperty("pressure")) {
+ dataTempEntry.data.pressure = data[i].pressure;
+ }
+ if (data[i].sats) {
+ dataTempEntry.data.sats = data[i].sats;
+
+ // Drop frames where sats = 0! We do not want to be handling invalid positions.
+ if (dataTempEntry.data.sats == 0){
+ continue;
+ }
+ }
+ if (data[i].hasOwnProperty("temp")) {
+ dataTempEntry.data.temperature_external = data[i].temp;
+ }
+ if (data[i].type && data[i].type == "payload_telemetry") { // SondeHub V1.5 data?
+ var comment = data[i].comment.split(" ");
+ if (v1types.hasOwnProperty(comment[0])) {
+ dataTempEntry.data.type = v1types[comment[0]];
+ dataTempEntry.type = v1types[comment[0]];
+ if (v1manufacturers.hasOwnProperty(dataTempEntry.type)) {
+ // dataTempEntry.data.manufacturer = v1manufacturers[dataTempEntry.type];
+ dataTempEntry.data.type = v1manufacturers[dataTempEntry.type] + " " + dataTempEntry.data.type;
+ }
+ }
+ dataTempEntry.data.frequency = comment[2];
+ } else if (data[i].type) {
+ dataTempEntry.data.type = data[i].type;
+ dataTempEntry.type = data[i].type;
+ }
+ if (data[i].subtype) {
+ dataTempEntry.data.type = data[i].subtype;
+ dataTempEntry.type = data[i].subtype;
+ }
+
+ if (data[i].manufacturer) {
+ // Instead of adding a separate manufacturer field, prefix the type with it.
+ if (dataTempEntry.data.type) {
+ dataTempEntry.data.type = data[i].manufacturer + " " + dataTempEntry.data.type;
+ }
+ }
+
+ // RS41 specific stuff
+ if (data[i].hasOwnProperty("rs41_mainboard")) {
+ dataTempEntry.data.rs41_mainboard = data[i].rs41_mainboard;
+ }
+ // Removed showing mainboard firmware, not really valuable
+
+ // XDATA Handling
+ if (data[i].xdata) {
+ dataTempEntry.data.xdata = data[i].xdata;
+ if (data[i].hasOwnProperty("pressure")) {
+ xdata_pressure = data[i].pressure;
+ } else {
+ xdata_pressure = 1100.0;
+ }
+ var tempXDATA = parseXDATA(data[i].xdata, xdata_pressure);
+ for (let field in tempXDATA) {
+ if (tempXDATA.hasOwnProperty(field)) {
+ if (field == "xdata_instrument") {
+ dataTempEntry.data.xdata_instrument = tempXDATA.xdata_instrument.join(', ');
+ } else {
+ dataTempEntry.data[field] = tempXDATA[field];
+ }
+ }
+ }
+ }
+ dataTemp.push(dataTempEntry);
+ }
+ }
+ }
+ response.positions.position = dataTemp;
+ response.fetch_timestamp = Date.now();
+ return response;
+}
\ No newline at end of file
diff --git a/js/gmaps_extentions.js b/js/gmaps_extentions.js
deleted file mode 100644
index fdc73e6..0000000
--- a/js/gmaps_extentions.js
+++ /dev/null
@@ -1,220 +0,0 @@
-
-// custom label function
-
-google.maps.Label = function(opt_options) {
- // init default values
- this.set('visible', true);
- this.set('opacity', 1);
- this.set('clickable', false);
- this.set('strokeColor', "#00F");
- this.set('text', "");
- this.set('textOnly', false); // true only text, false text within a box
-
- this.setValues(opt_options);
-
- var span = this.span_ = document.createElement('span');
- span.style.cssText = 'position: relative; left: -50%;' +
- 'white-space: nowrap; color: #000;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-khtml-user-select:none;';
-
- span.style.cssText += !this.get('textOnly') ?
- 'border: 1px solid '+this.get('strokeColor')+'; border-radius: 5px; ' +
- 'top:-12px;font-size:9px;padding: 2px; background-color: white'
- :
- 'top:-8px;font-size:12px;font-weight: bold; text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1px 1px #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;'
- ;
-
- var div = this.div_ = document.createElement('div');
- div.appendChild(span);
- div.style.cssText = 'position: absolute; display: none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-khtml-user-select:none;';
-};
-
-google.maps.Label.prototype = new google.maps.OverlayView();
-
-
-// Implement onAdd
-google.maps.Label.prototype.onAdd = function() {
- var pane = this.getPanes().overlayImage;
- pane.appendChild(this.div_);
-
- // redraw if any option is changed
- var ctx = this;
- var callback = function() { ctx.draw(); };
- this.listeners_ = [
- google.maps.event.addListener(this, 'opacity_changed', callback),
- google.maps.event.addListener(this, 'position_changed', callback),
- google.maps.event.addListener(this, 'visible_changed', callback),
- google.maps.event.addListener(this, 'clickable_changed', callback),
- google.maps.event.addListener(this, 'text_changed', callback),
- google.maps.event.addListener(this, 'zindex_changed', callback),
- google.maps.event.addDomListener(this.div_, 'click', function() {
- if (ctx.get('clickable')) {
- google.maps.event.trigger(ctx, 'click');
- }
- })
- ];
-};
-
-
-// Implement onRemove
-google.maps.Label.prototype.onRemove = function() {
- this.div_.parentNode.removeChild(this.div_);
-
- // remove all listeners
- for (var i = 0, j = this.listeners_.length; i < j; i++) {
- google.maps.event.removeListener(this.listeners_[i]);
- }
-};
-
-
-// Implement draw
-google.maps.Label.prototype.draw = function() {
- var projection = this.getProjection();
- var position = projection.fromLatLngToDivPixel(this.get('position'));
-
- var div = this.div_;
- if(position !== null) {
- div.style.left = position.x + 'px';
- div.style.top = position.y + 'px';
- }
-
- div.style.display = this.get('visible') && this.get('opacity') >= 0.6 ? 'block' : 'none';
- this.span_.style.cursor = this.get('clickable') ? 'pointer' : '';
- div.style.zIndex = this.get('zIndex');
- this.span_.innerHTML = this.get('text').toString();
-};
-
-
-// custom dropdown menu control
-
-google.maps.DropDownControl = function(options) {
- var ctx = this;
- this.options = options;
-
- // generate the controls
- this.div_ = document.createElement('div');
- this.div_.className = "gmnoprint";
- this.div_.draggable = false;
- this.div_.style.cssText = "margin: 10px; margin-top: 0;z-index: 0; position: absolute; cursor: pointer; text-align: left; width: 85px; right: 0px; top: 0px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-khtml-user-select:none";
-
- this.div_head = document.createElement('div');
- this.div_head.style.cssText = "direction: ltr; overflow: hidden; text-align: left; position: relative; color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 8px; border-radius: 2px; -webkit-background-clip: padding-box; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; font-weight: 500; background-color: rgb(255, 255, 255); background-clip: padding-box;";
- this.div_head.title = options.title;
-
- google.maps.event.addDomListener(this.div_head, 'mouseover', function(){
- ctx.div_head.style.backgroundColor = "rgb(235,235,235)";
- });
- google.maps.event.addDomListener(this.div_head, 'mouseout', function(){
- ctx.div_head.style.backgroundColor = "rgb(255,255,255)";
- });
-
- this.header = document.createElement('span');
- this.header.innerHTML = (options.headerPrefix || "") + options.list[options.listDefault || 0];
- var arrow = document.createElement('img');
- arrow.src = "//maps.gstatic.com/mapfiles/arrow-down.png";
- arrow.style.cssText = "-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-khtml-user-select: none; border: 0px none; padding: 0px; margin: -2px 0px 0px; position: absolute; right: 6px; top: 50%; width: 7px; height: 4px;";
-
- this.div_head.appendChild(this.header);
- this.div_head.appendChild(arrow);
- this.div_.appendChild(this.div_head);
-
- // generate list of dropdown entries
- this.div_list = document.createElement('div');
- this.div_list.style.cssText = "z-index: -1; padding: 2px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; position: absolute; top: 100%; left: 0px; right: 0px; text-align: left; display: none; background-color: white;";
-
- var div_list = this.div_list;
-
- options.list.forEach(function(name) {
- var row = document.createElement('div');
- row.style.cssText = "color: rgb(86, 86, 86); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 6px; background-color: rgb(255, 255, 255);";
- row.innerHTML = name;
-
- google.maps.event.addDomListener(row, 'click', function(){
- if(ctx.options.callback(row.innerHTML)) {
- ctx.header.innerHTML = (ctx.options.headerPrefix || "") + row.innerHTML;
- row.style.fontWeight = "800";
- row.style.color = "rgb(0,0,0)";
- }
- });
- google.maps.event.addDomListener(row, 'mouseover', function(){
- if(ctx.header.innerHTML == (ctx.options.headerPrefix || "") + row.innerHTML) {
- row.style.fontWeight = "800";
- row.style.color = "rgb(0,0,0)";
- }
- row.style.backgroundColor = "rgb(235,235,235)";
- });
- google.maps.event.addDomListener(row, 'mouseout', function(){
- row.style.fontWeight = "500";
- row.style.color = "rgb(86,86,86)";
- row.style.backgroundColor = "rgb(255,255,255)";
- });
-
- div_list.appendChild(row);
- });
-
- this.div_.appendChild(this.div_list);
-
- // add control
- options.map.controls[options.position].push(this.div_);
-
- // event for expanding
-
- google.maps.event.addDomListener(this.div_head, 'click', function(){
- clearTimeout(ctx.hideTimeout);
- div_list.style.display = (div_list.style.display != 'none') ? 'none' : 'block';
- });
- google.maps.event.addDomListener(this.div_, 'mouseout', function(){
- ctx.hideTimeout = setTimeout(function() { div_list.style.display = 'none'; }, 1000);
- });
- google.maps.event.addDomListener(this.div_, 'mouseover', function(){
- clearTimeout(ctx.hideTimeout);
- });
-};
-
-google.maps.DropDownControl.prototype.setVisible = function(isVisible) {
- isVisible = !!isVisible;
- this.div_.style.display = (isVisible) ? 'block' : 'none';
-};
-
-google.maps.DropDownControl.prototype.select = function(text) {
- this.header.innerHTML = (this.options.headerPrefix || "") + text;
-};
-
-// simple status control
-
-google.maps.StatusTextControl = function(options) {
- this.options = options || {
- text: "",
- map: null,
- position: 0,
- fontSize: "10px",
- };
-
- this.div_ = document.createElement('div');
- this.div_.style.cssText = "display: none";
- this.div_.innerHTML = "";
-
- var div = document.createElement('div');
- div.style.cssText = 'position: relative; padding-right: 6px; padding-left: 6px;' +
- ' font-family: Roboto, Arial, sans-serif; color: rgb(68, 68, 68);' +
- ' white-space: nowrap; direction: ltr; text-align: right;' +
- ' font-size: ' + this.options.fontSize;
-
- this.span_ = document.createElement('span');
- div.appendChild(this.span_);
- this.div_.appendChild(div);
-
- // update text
- this.setText(this.options.text);
-
- // add control
- if(this.options.map)
- this.options.map.controls[options.position].push(this.div_);
-};
-
-google.maps.StatusTextControl.prototype.setText = function(text) {
- this.options.text = text;
- this.span_.innerHTML = text;
- this.div_.style.display = (text === "") ? "none" : "block";
-};
diff --git a/js/iscroll.js b/js/iscroll.js
index bebac01..37d5c7c 100644
--- a/js/iscroll.js
+++ b/js/iscroll.js
@@ -821,7 +821,13 @@ IScroll.prototype = {
},
scrollToElement: function (el, time, offsetX, offsetY, easing) {
- el = el.nodeType ? el : this.scroller.querySelector(el);
+ el = el.nodeType ? el : document.querySelectorAll(el);
+ //figure out which el to use (oreintation)
+ if (el[0].offsetHeight) {
+ el = el[0];
+ } else {
+ el = el[1];
+ }
if ( !el ) {
return;
diff --git a/js/leaflet.js b/js/leaflet.js
new file mode 100644
index 0000000..21f499c
--- /dev/null
+++ b/js/leaflet.js
@@ -0,0 +1,6 @@
+/* @preserve
+ * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com
+ * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade
+ */
+!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function h(t){for(var i,e,n=1,o=arguments.length;n=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function kt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt={ie:tt,ielt9:it,edge:et,webkit:nt,android:ot,android23:st,androidStock:at,opera:ht,chrome:ut,gecko:lt,safari:ct,phantom:_t,opera12:dt,win:pt,ie3d:mt,webkit3d:ft,gecko3d:gt,any3d:vt,mobile:yt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Pt,pointer:Lt,touch:bt,mobileOpera:Tt,mobileGecko:Mt,retina:zt,passiveEvents:Ct,canvas:St,svg:Zt,vml:Et},At=Pt?"MSPointerDown":"pointerdown",It=Pt?"MSPointerMove":"pointermove",Ot=Pt?"MSPointerUp":"pointerup",Rt=Pt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,i,e,n){function o(t){Ut(t,r)}var s,r,a,h,u,l,c,_;function d(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,h)}return"touchstart"===i?(u=t,l=e,c=n,_=p(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ri(t),Ut(t,l)}),u["_leaflet_touchstart"+c]=_,u.addEventListener(At,_,!1),Dt||(document.addEventListener(At,Wt,!0),document.addEventListener(It,Ht,!0),document.addEventListener(Ot,Ft,!0),document.addEventListener(Rt,Ft,!0),Dt=!0)):"touchmove"===i?(h=e,(a=t)["_leaflet_touchmove"+n]=d,a.addEventListener(It,d,!1)):"touchend"===i&&(r=e,(s=t)["_leaflet_touchend"+n]=o,s.addEventListener(Ot,o,!1),s.addEventListener(Rt,o,!1)),this}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Ft(t){delete Nt[t.pointerId]}function Ut(t,i){for(var e in t.touches=[],Nt)t.touches.push(Nt[e]);t.changedTouches=[t],i(t)}var Vt=Pt?"MSPointerDown":Lt?"pointerdown":"touchstart",qt=Pt?"MSPointerUp":Lt?"pointerup":"touchend",Gt="_leaflet_";var Kt,Yt,Xt,Jt,$t,Qt,ti=fi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ii=fi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei="webkitTransition"===ii||"OTransition"===ii?ii+"End":"transitionend";function ni(t){return"string"==typeof t?document.getElementById(t):t}function oi(t,i){var e,n=t.style[i]||t.currentStyle&&t.currentStyle[i];return n&&"auto"!==n||!document.defaultView||(n=(e=document.defaultView.getComputedStyle(t,null))?e[i]:null),"auto"===n?null:n}function si(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ri(t){var i=t.parentNode;i&&i.removeChild(t)}function ai(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function hi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function ui(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function li(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=pi(t);return 0this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,N(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e,n,o=A((i=i||{}).paddingTopLeft||i.padding||[0,0]),s=A(i.paddingBottomRight||i.padding||[0,0]),r=this.getCenter(),a=this.project(r),h=this.project(t),u=this.getPixelBounds(),l=u.getSize().divideBy(2),c=O([u.min.add(o),u.max.subtract(s)]);return c.contains(h)||(this._enforcingBounds=!0,e=a.subtract(h),n=A(h.x+e.x,h.y+e.y),(h.xc.max.x)&&(n.x=a.x-e.x,0c.max.y)&&(n.y=a.y-e.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[m(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Vi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Vi(s,t)||(n=[this]),n},_handleDOMEvent:function(t){var i;this._loaded&&!Ui(t)&&("mousedown"!==(i=t.type)&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||Pi(t.target||t.srcElement),this._fireDOMEvent(t,i))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){var n;if("click"===t.type&&((n=h({},t)).type="preclick",this._fireDOMEvent(n,n.type,e)),!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&Ri(t);var s,r={originalEvent:t};"keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(s=o.getLatLng&&(!o._radius||o._radius<=10),r.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=s?o.getLatLng():this.layerPointToLatLng(r.layerPoint));for(var a=0;athis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,ci(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_i(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function Yi(t){return new Xi(t)}var Xi=S.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return ci(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ri(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+m(this),n),this._layerControlInputs.push(i),i.layerId=m(t.layer),zi(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;si.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),$i=Xi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=si("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=si("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Oi(s),zi(s,"click",Ni),zi(s,"click",o,this),zi(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";_i(this._zoomInButton,i),_i(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||ci(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||ci(this._zoomInButton,i)}});Ki.mergeOptions({zoomControl:!0}),Ki.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $i,this.addControl(this.zoomControl))});var Qi=Xi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=si("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=si("div",i,e)),t.imperial&&(this._iScale=si("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280Leaflet