text: Joshfire.define([], function(){
    function h(a){throw a;}var j=void 0,k=!0,o=null,p=!1;function q(a){return function(){return this[a]}}function aa(a){return function(){return a}}var s,u=this;function ba(){}
  function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
  else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function v(a){return a!==j}function w(a){return a===o}function x(a){return a!=o}function da(a){return"array"==ca(a)}function y(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function z(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){a=ca(a);return"object"==a||"array"==a||"function"==a}function A(a){return a[ia]||(a[ia]=++ja)}
  var ia="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),ja=0;function ka(a,b,c){return a.call.apply(a.bind,arguments)}function la(a,b,c){a||h(Error());if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
  function B(a,b,c){B=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ka:la;return B.apply(o,arguments)}var C=Date.now||function(){return+new Date};function D(a,b){var c=a.split("."),d=u;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&v(b)?d[e]=b:d=d[e]?d[e]:d[e]={}}function E(a,b){function c(){}c.prototype=b.prototype;a.ta=b.prototype;a.prototype=new c};function ma(a){if(!na.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(oa,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(pa,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(qa,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(ra,"&quot;"));return a}var oa=/&/g,pa=/</g,qa=/>/g,ra=/\"/g,na=/[&<>\"]/;function sa(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^C()).toString(36)};var F=Array.prototype,ta=F.indexOf?function(a,b,c){return F.indexOf.call(a,b,c)}:function(a,b,c){c=c==o?0:0>c?Math.max(0,a.length+c):c;if(z(a))return!z(b)||1!=b.length?-1:a.indexOf(b,c);for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},G=F.forEach?function(a,b,c){F.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=z(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},ua=F.filter?function(a,b,c){return F.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=z(a)?a.split(""):
  a,i=0;i<d;i++)if(i in g){var l=g[i];b.call(c,l,i,a)&&(e[f++]=l)}return e},va=F.every?function(a,b,c){return F.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=z(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return p;return k};function wa(a,b){var c=ta(a,b),d;(d=0<=c)&&F.splice.call(a,c,1);return d}function xa(a){return F.concat.apply(F,arguments)}function ya(a){if(da(a))return xa(a);for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}
  function za(a,b,c){return 2>=arguments.length?F.slice.call(a,b):F.slice.call(a,b,c)}function Aa(a,b){F.sort.call(a,b||Ba)}function Ba(a,b){return a>b?1:a<b?-1:0}function Ca(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];da(d)?b.push.apply(b,Ca.apply(o,d)):b.push(d)}return b};function H(a,b,c){return Math.min(Math.max(a,b),c)}function I(a,b){var c=a%b;return 0>c*b?c+b:c}function J(a){return a*Math.PI/180}function K(a){return 180*a/Math.PI};function Da(a){var b=v(j),c=new XMLHttpRequest;if(b)c.onreadystatechange=function(){4==c.readyState&&j(c.responseText)};c.open("GET",a,b);c.send(o);return b?"":c.responseText}function Ea(a){a=I(a,2*Math.PI);return a>Math.PI?a-2*Math.PI:a}function Fa(a){var b=document.createElement("style");b.type="text/css";b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a));Ga()[0].appendChild(b)};function Ha(a,b){var c;c=(c=a.className)&&"function"==typeof c.split?c.split(/\s+/):[];var d=za(arguments,1),e;e=c;for(var f=0,g=0;g<d.length;g++)0<=ta(e,d[g])||(e.push(d[g]),f++);e=f==d.length;a.className=c.join(" ");return e};function Ia(a,b){for(var c in a)b.call(j,a[c],c,a)}function Ja(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ka(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function La(){var a=Ma,b;for(b in a)return p;return k}var Na="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
  function Oa(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Na.length;f++)c=Na[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var Pa,Qa,Ra,Sa,Ta;function Ua(){return u.navigator?u.navigator.userAgent:o}Sa=Ra=Qa=Pa=p;var Wa;if(Wa=Ua()){var Xa=u.navigator;Pa=0==Wa.indexOf("Opera");Qa=!Pa&&-1!=Wa.indexOf("MSIE");Ra=!Pa&&-1!=Wa.indexOf("WebKit");Sa=!Pa&&!Ra&&"Gecko"==Xa.product}var Ya=Pa,L=Qa,Za=Sa,M=Ra,$a,ab=u.navigator;$a=ab&&ab.platform||"";Ta=-1!=$a.indexOf("Mac");var bb=-1!=$a.indexOf("Win"),cb;
  a:{var db="",eb;if(Ya&&u.opera)var fb=u.opera.version,db="function"==typeof fb?fb():fb;else if(Za?eb=/rv\:([^\);]+)(\)|;)/:L?eb=/MSIE\s+([^\);]+)(\)|;)/:M&&(eb=/WebKit\/(\S+)/),eb)var gb=eb.exec(Ua()),db=gb?gb[1]:"";if(L){var hb,ib=u.document;hb=ib?ib.documentMode:j;if(hb>parseFloat(db)){cb=""+hb;break a}}cb=db}var jb={};
  function N(a){var b;if(!(b=jb[a])){b=0;for(var c=(""+cb).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=(""+a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",i=d[f]||"",l=RegExp("(\\d*)(\\D*)","g"),m=RegExp("(\\d*)(\\D*)","g");do{var r=l.exec(g)||["","",""],n=m.exec(i)||["","",""];if(0==r[0].length&&0==n[0].length)break;b=((0==r[1].length?0:parseInt(r[1],10))<(0==n[1].length?0:parseInt(n[1],10))?-1:(0==r[1].length?0:parseInt(r[1],
  10))>(0==n[1].length?0:parseInt(n[1],10))?1:0)||((0==r[2].length)<(0==n[2].length)?-1:(0==r[2].length)>(0==n[2].length)?1:0)||(r[2]<n[2]?-1:r[2]>n[2]?1:0)}while(0==b)}b=jb[a]=0<=b}return b}var kb={};function lb(){return kb[9]||(kb[9]=L&&document.documentMode&&9<=document.documentMode)};function mb(a,b){this.width=a;this.height=b}function nb(a,b){return a==b?k:!a||!b?p:a.width==b.width&&a.height==b.height}s=mb.prototype;s.Ma=function(){return new mb(this.width,this.height)};s.Ua=function(){return this.width/this.height};s.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};s.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
  s.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};s.scale=function(a){this.width*=a;this.height*=a;return this};var ob=!L||lb();!Za&&!L||L&&lb()||Za&&N("1.9.1");L&&N("9");function Ga(){var a=document;return a.querySelectorAll&&a.querySelector&&(!M||"CSS1Compat"==document.compatMode||N("528"))?a.querySelectorAll("HEAD"):a.getElementsByTagName("HEAD")}function pb(a,b){Ia(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in qb?a.setAttribute(qb[d],b):0==d.lastIndexOf("aria-",0)?a.setAttribute(d,b):a[d]=b})}
  var qb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",maxlength:"maxLength",type:"type"};
  function O(a,b,c){var d=arguments,e=document,f=d[0],g=d[1];if(!ob&&g&&(g.name||g.type)){f=["<",f];g.name&&f.push(' name="',ma(g.name),'"');if(g.type){f.push(' type="',ma(g.type),'"');var i={};Oa(i,g);g=i;delete g.type}f.push(">");f=f.join("")}f=e.createElement(f);if(g)z(g)?f.className=g:da(g)?Ha.apply(o,[f].concat(g)):pb(f,g);2<d.length&&rb(e,f,d,2);return f}
  function rb(a,b,c,d){function e(c){c&&b.appendChild(z(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var f=c[d];y(f)&&!(ga(f)&&0<f.nodeType)?G(sb(f)?ya(f):f,e):e(f)}}function P(a,b){rb(tb(a),a,arguments,1)}function tb(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function sb(a){if(a&&"number"==typeof a.length){if(ga(a))return"function"==typeof a.item||"string"==typeof a.item;if(fa(a))return"function"==typeof a.item}return p};function ub(a,b,c){var d=O("div",{"class":"we-pp-content"});d.innerHTML=a;a=O("div",{"class":"we-pp-wrapper"},d);d=O("div",{"class":"we-pp-tip-cont"},O("div",{"class":"we-pp-tip"}));this.u=O("div",{"class":"we-pp"});if(c!==p)c=O("a",{"class":"we-pp-close",href:"#"}),c.onclick=B(this.show,this,p),this.u.appendChild(c);this.u.appendChild(a);this.u.appendChild(d);b=b||300;this.u.style.width=b.toFixed(0)+"px";this.u.style.left=(-b/2).toFixed(0)+"px";this.show(p)}
  ub.prototype.show=function(a){a?(this.u.style.opacity=1,this.u.style.visibility="visible"):(this.u.style.opacity=0,this.u.style.visibility="hidden")};Fa('.we-pp-content p{margin:18px 0;text-align:justify;}.we-pp-wrapper{padding:1px;text-align:left;border-radius:20px;}.we-pp{z-index:100;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;-o-transition:opacity 0.2s linear;transition:opacity 0.2s linear;position:absolute;}.we-pp-wrapper,.we-pp-tip{background:white;box-shadow:0 1px 10px #888;-moz-box-shadow:0 1px 10px #888;-webkit-box-shadow:0 1px 14px #999;}.we-pp-close{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1BMVEX////Ny8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8vNy8sw0horAAAAMHRSTlMA/bGBFK1LgjellwUx2+VZo73SE6z5fQYOtzLRpxI22CC4g6ieV+yAEc8/ZocEHTzU+GNbAAAAV0lEQVQI1wXBBQKDMADAwLRl7szdgCks/3/d7hh0ehl0W21IwZgNR44nTNVZribmC1WXqzVstmpIALu9Gg5HOJ1VNV64arjd1YKy8sEz+nrD51tD0//xB/w6CnrIHetcAAAAAElFTkSuQmCC);position:absolute;top:9px;right:9px;width:10px;height:10px;overflow:hidden;}.we-pp-content{display:inline-block;margin:19px;font:12px/1.4 "Helvetica Neue",Arial,Helvetica,sans-serif;}.we-pp-tip-cont{margin:0 auto;width:40px;height:16px;position:relative;overflow:hidden;}.we-pp-tip{width:15px;height:15px;padding:1px;margin:-8px auto 0;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);}');function vb(a){return function(){return a}}var wb=vb(k),xb=vb(o);function yb(a){var b=arguments,c=b.length;return function(){for(var a,e=0;e<c;e++)a=b[e].apply(this,arguments);return a}};function zb(){}zb.prototype.wc=p;zb.prototype.z=function(){if(!this.wc)this.wc=k,this.A()};zb.prototype.A=function(){this.pd&&Ab.apply(o,this.pd)};function Ab(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];y(d)?Ab.apply(o,d):d&&"function"==typeof d.z&&d.z()}};function Bb(a,b,c,d){this.zoom=a||0;this.x=b||0;this.y=c||0;this.Ob=0;this.sa=d||0;this.Oa=this.Ba=o;this.state=Cb}E(Bb,zb);s=Bb.prototype;s.getKey=function(){return this.zoom+"_"+this.x+"_"+this.y};s.setData=function(a){this.Oa=a};s.uc=xb;function Db(a){return a.Oa?a.uc(a.Oa):a.Ba}s.sc=ba;s.A=function(){this.Ba=o;if(this.Oa)this.sc(this.Oa),this.Oa=o};var Cb=0;function Eb(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Eb.prototype.Ma=function(){return new Eb(this.top,this.right,this.bottom,this.left)};Eb.prototype.contains=function(a){return!this||!a?p:a instanceof Eb?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};function Fb(a){if("function"==typeof a.fa)a=a.fa();else if(y(a)||z(a))a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a}function Gb(a){if("function"==typeof a.ra)return a.ra();if(z(a))return a.split("");if(y(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Ja(a)}function Hb(a){if("function"==typeof a.ob)return a.ob();if("function"!=typeof a.ra){if(y(a)||z(a)){for(var b=[],a=a.length,c=0;c<a;c++)b.push(c);return b}return Ka(a)}}
  function Ib(a,b){if("function"==typeof a.forEach)a.forEach(b,j);else if(y(a)||z(a))G(a,b,j);else for(var c=Hb(a),d=Gb(a),e=d.length,f=0;f<e;f++)b.call(j,d[f],c&&c[f],a)}function Jb(a,b){if("function"==typeof a.every)return a.every(b,j);if(y(a)||z(a))return va(a,b,j);for(var c=Hb(a),d=Gb(a),e=d.length,f=0;f<e;f++)if(!b.call(j,d[f],c&&c[f],a))return p;return k};function Kb(a,b){this.t={};this.s=[];var c=arguments.length;if(1<c){c%2&&h(Error("Uneven number of arguments"));for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Hb(a)}s=Kb.prototype;s.n=0;s.mc=0;s.fa=q("n");s.ra=function(){Lb(this);for(var a=[],b=0;b<this.s.length;b++)a.push(this.t[this.s[b]]);return a};s.ob=function(){Lb(this);return this.s.concat()};s.rc=function(a){for(var b=0;b<this.s.length;b++){var c=this.s[b];if(Mb(this.t,c)&&this.t[c]==a)return k}return p};
  s.equals=function(a,b){if(this===a)return k;if(this.n!=a.fa())return p;var c=b||Nb;Lb(this);for(var d,e=0;d=this.s[e];e++)if(!c(this.get(d),a.get(d)))return p;return k};function Nb(a,b){return a===b}s.clear=function(){this.t={};this.mc=this.n=this.s.length=0};s.remove=function(a){return Mb(this.t,a)?(delete this.t[a],this.n--,this.mc++,this.s.length>2*this.n&&Lb(this),k):p};
  function Lb(a){if(a.n!=a.s.length){for(var b=0,c=0;b<a.s.length;){var d=a.s[b];Mb(a.t,d)&&(a.s[c++]=d);b++}a.s.length=c}if(a.n!=a.s.length){for(var e={},c=b=0;b<a.s.length;)d=a.s[b],Mb(e,d)||(a.s[c++]=d,e[d]=1),b++;a.s.length=c}}s.get=function(a,b){return Mb(this.t,a)?this.t[a]:b};s.set=function(a,b){Mb(this.t,a)||(this.n++,this.s.push(a),this.mc++);this.t[a]=b};s.Hb=function(a){var b;a instanceof Kb?(b=a.ob(),a=a.ra()):(b=Ka(a),a=Ja(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};s.Ma=function(){return new Kb(this)};
  function Mb(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Ob(a){this.t=new Kb;a&&this.Hb(a)}function Pb(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+A(a):b.substr(0,1)+a}s=Ob.prototype;s.fa=function(){return this.t.fa()};s.add=function(a){this.t.set(Pb(a),a)};s.Hb=function(a){for(var a=Gb(a),b=a.length,c=0;c<b;c++)this.add(a[c])};s.remove=function(a){return this.t.remove(Pb(a))};s.clear=function(){this.t.clear()};s.contains=function(a){a=Pb(a);return Mb(this.t.t,a)};s.ra=function(){return this.t.ra()};s.Ma=function(){return new Ob(this)};
  s.equals=function(a){return this.fa()==Fb(a)&&Qb(this,a)};function Qb(a,b){var c=Fb(b);if(a.fa()>c)return p;!(b instanceof Ob)&&5<c&&(b=new Ob(b));return Jb(a,function(a){if("function"==typeof b.contains)a=b.contains(a);else if("function"==typeof b.rc)a=b.rc(a);else if(y(b)||z(b))a=0<=ta(b,a);else a:{for(var c in b)if(b[c]==a){a=k;break a}a=p}return a})};function Rb(a){this.name=a;this.W=0;this.Lb=[];this.Jc=-1.4844222297453324;this.Hc=1.4844222297453324;this.Kc=-Math.PI;this.Ic=Math.PI;this.lb=[];this.opacity=1}s=Rb.prototype;s.gc=function(a,b,c,d){this.Jc=J(a);this.Hc=J(b);this.Kc=J(c);this.Ic=J(d);this.lb=[]};
  function Sb(a,b){if(!x(a.lb[b])){var c=1<<b,d=Math.floor((a.Kc/(2*Math.PI)+0.5)*c),e=Math.floor((a.Ic/(2*Math.PI)+0.5)*c),f=Math.floor((0.5-Tb(a.Hc)/(2*Math.PI))*c),c=Math.floor((0.5-Tb(a.Jc)/(2*Math.PI))*c);a.lb[b]=new Eb(f,e,c,d)}return a.lb[b]}s.ya=aa(0);s.Jb=aa(p);s.hc=aa(p);s.Sb=aa(k);function Ub(a){G(a.Lb,function(a){this.W--;this.Za(a.je,a.onload,a.Yd)},a);a.Lb=[]}function Vb(a,b,c,d){a.Sb()?a.Za(b,c,d):(a.Lb.push(new Wb(b,c,d)),a.W++)}s.va=function(){};s.pb=aa(o);s.Rc=ba;s.Kb=ba;
  function Xb(a,b,c,d,e){this.kd=a;this.ld=b;this.fe=c;this.ge=d;this.qe=e}function Wb(a,b,c){this.je=a;this.onload=b;this.Yd=c};function Q(a){Rb.call(this,a);this.fc=""}E(Q,Rb);Q.prototype.Jb=aa(k);Q.prototype.hc=function(a){var b=this.fc!=a;this.fc=a;return b};Q.prototype.Za=function(a,b,c){var d=new Image;d.onload=B(function(){a.state=20;this.W--;b(a)},this);d.onerror=B(function(){a.Ob++;a.state=-10;this.W--;c&&c(a)},this);a.state=10;a.Ba=d;d.crossOrigin="";var e=this.Qb(a.zoom,a.x,a.y);d.src=this.fc+e;this.W++};function Yb(a,b,c,d,e,f,g,i){Q.call(this,a);this.url=b;this.minZoom=c;this.maxZoom=d;this.tileSize=e;this.td=f===k;this.ic=g||[];this.copyright=i||""}E(Yb,Q);s=Yb.prototype;s.ya=q("minZoom");s.pa=q("maxZoom");s.qa=q("tileSize");s.Qb=function(a,b,c){var d=this.url.replace("{z}",a.toFixed(0)),d=d.replace("{x}",b.toFixed(0)),d=d.replace("{y}",(this.td?(1<<a)-c-1:c).toFixed(0));0<this.ic.length&&(d=d.replace("{sub}",this.ic[I(b+c+a,this.ic.length)]));return d};
  s.va=function(a){0<this.copyright.length&&P(a,this.copyright)};function Zb(a,b,c,d,e,f,g,i,l,m){Q.call(this,a);"?"!=b.charAt(b.length-1)&&(b+="?");this.Gb=0;if(0<b.length)this.url=b,this.Gb=1;this.version=c;this.zd=d;this.format=f;this.minZoom=l;this.maxZoom=m;this.tileSize=256;"EPSG:900913"==e||"EPSG:3857"==e?this.Vc=e:(this.Gb=0,h(Error(e+" is an unsupported CRS, please use either EPSG:900913 or EPSG:3857.  WMS Server must support one of these.")));this.styles=g;0<i.length&&"&"!=i.charAt(0)&&(i="&"+i);this.sd=i}E(Zb,Q);Zb.prototype.ya=q("minZoom");
  Zb.prototype.pa=q("maxZoom");Zb.prototype.qa=aa(256);
  Zb.prototype.Qb=function(a,b,c){function d(a,b){var c=Math.PI-2*Math.PI*a/Math.pow(2,b);return 180/Math.PI*Math.atan(0.5*(Math.exp(c)-Math.exp(-c)))}function e(a){89.5<a&&(a=89.5);-89.5>a&&(a=-89.5);return 0-6378137*Math.log(Math.tan(0.5*(0.5*Math.PI-a*(Math.PI/180))))}var f="";if(1==this.Gb){var f=e(d(c,a)),g=e(d(c+1,a)),c=6378137*(360*(b/Math.pow(2,a))-180)*(Math.PI/180),i=6378137*(360*((b+1)/Math.pow(2,a))-180)*(Math.PI/180),a=Math.max(f,g),b=Math.max(c,i),g=Math.min(f,g),c=Math.min(c,i),f=this.url+
  "service=WMS&request=GetMap&version="+this.version,f=f+"&Width="+this.tileSize+"&Height="+this.tileSize,f=f+"&Layers="+this.zd+"&Format="+this.format;"1.0"==this.version.substr(0,3)||"1.1"==this.version.substr(0,3)?f=f+"&SRS="+this.Vc:"1.3"==this.version.substr(0,3)&&(f=f+"&CRS="+this.Vc);f=f+"&STYLES="+this.styles;f=f+"&BBOX="+c+","+g+","+b+","+a+this.sd}return f};function $b(a){this.La=a}$b.prototype.gc=function(a,b,c,d){this.La.gc(a,b,c,d)};$b.prototype.de=function(a){this.La.opacity=a};$b.prototype.ud=function(){return this.La.opacity};function ac(a){Yb.call(this,a||"MapQuest OSM","http://otile{sub}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png",0,18,256,p,["1","2","3","4"])}E(ac,Yb);ac.prototype.va=function(a){P(a,"Map data \u00a9 ",O("a",{href:"http://www.openstreetmap.org/"},"OpenStreetMap")," contributors, CC-BY-SA",O("br"));P(a,"Tiles Courtesy of ",O("a",{href:"http://open.mapquest.co.uk/"},"MapQuest")," ",O("img",{src:"http://developer.mapquest.com/content/osm/mq_logo.png",border:0}))};function bc(a){Yb.call(this,a||"OpenStreetMaps","http://{sub}.tile.openstreetmap.org/{z}/{x}/{y}.png",0,18,256,p,["a","b","c"])}E(bc,Yb);bc.prototype.va=function(a){P(a,"\u00a9 ",O("a",{href:"http://www.openstreetmap.org/"},"OpenStreetMap")," contributors, CC-BY-SA")};function cc(a,b,c){function d(){w(dc)&&(dc=new google.maps.Map(document.createElement("div")));ec?e():google.maps.event.addListenerOnce(dc,"idle",function(){ec=k;e()})}Rb.call(this,"Google Maps - "+a);this.ca=o;this.Fd=a;this.yd=b||0;this.Xd=c||ba;this.mb=new Ob;this.Wb=0;this.Xb=[];var e=B(function(){this.ca=dc.mapTypes[fc(a)];Ub(this);this.Xd()},this);x(u.google)&&google.maps&&google.maps.Map?d():w(gc)?(gc="googleMapsCallback"+sa(),u[gc]=B(d,this),b=document.createElement("script"),Ga()[0].appendChild(b),
  b.type="text/javascript",b.src="http://maps.google.com/maps/api/js?v=3.5&sensor=false&callback="+gc):u[gc]=yb(u[gc],B(d,this))}E(cc,Rb);cc.prototype.Sb=function(){return!w(this.ca)};var gc=o,dc=o,ec=p;s=cc.prototype;s.ya=function(){return w(this.ca)?0:this.ca.minZoom||0};s.pa=function(){return w(this.ca)?18:this.ca.maxZoom};s.qa=function(){return w(this.ca)?256:this.ca.tileSize.width};
  s.Za=function(a,b,c){var d=B(function(a){a=a.getElementsByTagName("img");return a[this.yd]||a[0]},this);a.uc=d;a.sc=B(function(a){this.ca.releaseTile(a)},this);var e=this.ca.getTile(new google.maps.Point(a.x,a.y),a.zoom,document),d=d(e);d.onload=B(function(){if(Db(a).src==Db(a).__src__)a.state=20,this.W--,b(a)},this);d.onerror=B(function(){a.Ob++;a.state=-10;this.W--;c&&c(a)},this);a.setData(e);a.state=10;this.W++};
  s.va=function(a){0<this.mb.fa()&&P(a,"Map Data \u00a9 "+(new Date).getFullYear()+" "+this.mb.ra().join(", ")+" \u2013 ");P(a,O("a",{href:"http://www.google.com/intl/en-US_US/help/terms_maps.html",target:"_blank"},"Terms of Use"))};s.pb=aa("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAYCAMAAACV6r5dAAABI1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxcXEAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQkLCwsRERESEhIZGRkjIyMsLCw6OjpNTU1WVlZhYWFvb28AAABycnJ5eXl8fHzc3NyFhYWGhoaHiIeLi4uSkpKWlpaYmJiampqenp6mpqahoaGlpaWhoaGpqampqamrq6uqqqqur66vr6+usK6ysrK4uLi9vb3CwsLExMTJycnNzc3Q0NDT09PU1NTV1dXX19fZ2dmDg4Pg4ODi4uLj4+Pj4+Pl5eXk5OTl5eXk5OTl5eXk5OTo6Ojq6urv7+/x8fH5+fn9/f3////54OudAAAAYHRSTlNgXlpSTUY/Pjs5NTMwLSsoJiQiIB4cGhcUEgoBAAYXJy43QElWWV1SFRwQQp2LiaQyqYmwRIi1hwi5hyiEWrxsfwW/xMTJycW3qA2ajweNi4+YAdios7vFy5/g6vD2/P7aB358AAADLElEQVR4XpWUe3OiSBTFOxpMfDsqKt2dZGeiBBlx8zABx3EiZBJk8phsMyb4wvv9P8VexCpnq7aym/PX6Uv/qpt7uBDOuRB8IzRva2AYxinbbkNcrKvTqdGrMvtt2hoG4Es63+JIa9PAM03PX81GNf1NXPAR3O5av+GCn858kvlQLe+bcJfRORORYuB3G/sHuJXsbZ1wZbYgaU23bPrxcqd4wGMygsQ/bKynCN/WCTegsxtfWa8dHVhxe3oNigTaZ+OzorPIDofD62EtOv0H14a4RUGKKLOwWUAIxWxLcPr8apo+jDOHXJlGduXldT6YeuNwdWeWI5wNgnusf61YnJyu5uSQb4THTBckV8m44GaVl3kiV0n54JTkmZvKmeCT6PTUYPFtv7q3AFURZAgLUuds0xw+hG+7skVPQlCv4UzSbNqFkDxAK23lfThb49MVyQ8e/JtWXZDeKmy1t0n8BRd7GH47gL4LHQyCF2fwJ9q8YPfQLyGenC3V+8moKRUOOTlewFX+ERP9YaA+T8DZwxX7BTe3cJG1GVde4MqBm/QjN0CN8J0ZdLrpUlU/YJxQD+Y7mhDYZRNv7MFd0sJMnuHiNo6Y/oJOawnn5ePASTSe8HkAV/uyrq+DYydL+J7BmChNz8NPXVg265jZBMg5duUI669LkjlxfXfhJGSOuPSAe5Q4eSKULytw/6C4qmAz02NwU4z3wn4i/QLfs4wPw7NdrZ5NzKGTstafTdqHebfUGAyYIPyx3fVhOXm6vr5f+M1q1gn9kRH0E8d0zw1dtJdJ2eY058KyW8M3mTvNlg8wCzyZIs7tuqQ6ruuNTJVkNL3YMs2vrYxMLZpXTfNLMyMzakw8x4fVebmnqt3jekq96v+U2jpfz7teK2SzxUq7qumM2Uq7UqtpDOt2o12N7OHr/GczlezDItmoVeqKjkC+dKQzxONxsi1LtzaTiH7juLB0EcWgSkeaVRiDWheWiAE7nrj/EuP0BdRcNKGjJanheqP/iUdD7n/EpOSgL2mcvwtHRbdevk5x/qRP7P24oAX1YuxctnIy5e/HMZrGh0Kx3MY43o1vo/mX3/jfzoX94Q7k9zgAAAAASUVORK5CYII=");
  s.Rc=function(a){this.mb=new Ob;var b=u.GAddCopyright,c=u.GVerify,d=u.GAppFeatures;u.GAddCopyright=B(function(){7<arguments.length&&0<arguments[7].length&&this.mb.add(arguments[7])},this);u.GVerify=wb;u.GAppFeatures=B(function(){this.Wb--;if(0>=this.Wb)u.GAddCopyright=b,u.GVerify=c,u.GAppFeatures=d,G(this.Xb,function(a){a.parentNode.removeChild(a)}),this.Xb=[],this.Kb()},this);G(a,function(a){var b=document.createElement("script");Ga()[0].appendChild(b);b.type="text/javascript";this.Xb.push(b);b.src=
  "http://maps.google.com/maps?vp="+(K(a.kd)+","+K(a.ld))+"&z="+a.qe+"&spn="+(K(a.fe)+","+K(a.ge))+"&t="+hc(this.Fd);this.Wb++},this)};function fc(a){switch(a){case "Terrain":return google.maps.MapTypeId.TERRAIN;case "Hybrid":return google.maps.MapTypeId.HYBRID;case "Roadmap":return google.maps.MapTypeId.ROADMAP;default:case "Satellite":return google.maps.MapTypeId.SATELLITE}}
  function hc(a){switch(a){case "Terrain":return"p";case "Hybrid":return"h";case "Roadmap":return"m";default:case "Satellite":return"k"}}var ic=B(document.createElement,document);document.createElement=function(a){var b=ic(a);if("img"==a)b.crossOrigin="";return b};function jc(a,b){Q.call(this,"Bing Maps - "+a);var c="bingsCallback_"+a,d="http://dev.virtualearth.net/REST/V1/Imagery/Metadata/"+a+"?key="+b+"&jsonp="+c;u[c]=v(u[c])?yb(B(this.Uc,this),u[c]):B(this.Uc,this);c=document.createElement("script");c.src=d;c.type="text/javascript";Ga()[0].appendChild(c)}E(jc,Q);s=jc.prototype;s.Sb=function(){return!w(this.X)};s.Uc=function(a){this.$a=a;if(0<a.resourceSets.length)this.X=a.resourceSets[0].resources[0],Ub(this);this.Kb()};
  s.ya=function(){return w(this.X)?0:this.X.zoomMin};s.pa=function(){return w(this.X)?18:this.X.zoomMax};s.qa=aa(256);function kc(a,b,c){for(var d="",e=1;e<=a;e++)d+=(c>>a-e&1)<<1|b>>a-e&1;return d}s.Qb=function(a,b,c){return w(this.X)?"":this.X.imageUrl.replace("{subdomain}",this.X.imageUrlSubdomains[Math.floor(Math.random()*this.X.imageUrlSubdomains.length)]).replace("{quadkey}",kc(a,b,c))};s.Za=function(a,b,c){return w(this.X)?p:jc.ta.Za.call(this,a,b,c)};s.va=function(a){w(this.$a)||P(a,this.$a.copyright)};
  s.pb=function(){return!w(this.$a)?this.$a.brandLogoUri:o};s.$a=o;s.X=o;var lc=new Kb;function mc(a,b){var c=a;x(b)&&0<b.length&&(c+=b[0]);var d;switch(a){case "mapquest":d=ac;break;case "osm":d=bc;break;case "bing":d=jc;break;case "wms":d=Zb;break;case "gooogle":d=cc;break;case "custom":d=Yb;break;default:return alert("Unknown MapType '"+a+"' !"),o}d=function(a,b){function c(b){a.apply(this,b)}c.prototype=a.prototype;return new c(b)}(d,b);d=new $b(d);lc.set(c,d);return d}function nc(a,b){var c=a;x(b)&&(c+=b);return lc.get(c)};function oc(){}var pc=0;s=oc.prototype;s.key=0;s.Sa=p;s.pc=p;s.Wa=function(a,b,c,d,e,f){fa(a)?this.Cc=k:a&&a.handleEvent&&fa(a.handleEvent)?this.Cc=p:h(Error("Invalid listener argument"));this.Ya=a;this.Qc=b;this.src=c;this.type=d;this.capture=!!e;this.Rb=f;this.pc=p;this.key=++pc;this.Sa=p};s.handleEvent=function(a){return this.Cc?this.Ya.call(this.Rb||this.src,a):this.Ya.handleEvent.call(this.Ya,a)};var qc=!L||lb(),rc=!L||lb(),sc=L&&!N("8");!M||N("528");Za&&N("1.9b")||L&&N("8")||Ya&&N("9.5")||M&&N("528");!Za||N("8");function S(a,b){this.type=a;this.currentTarget=this.target=b}E(S,zb);S.prototype.A=function(){delete this.type;delete this.target;delete this.currentTarget};S.prototype.Ra=p;S.prototype.cb=k;S.prototype.preventDefault=function(){this.cb=p};function tc(a){tc[" "](a);return a}tc[" "]=ba;function uc(a,b){a&&this.Wa(a,b)}E(uc,S);var vc=[1,4,2];s=uc.prototype;s.target=o;s.relatedTarget=o;s.offsetX=0;s.offsetY=0;s.clientX=0;s.clientY=0;s.screenX=0;s.screenY=0;s.button=0;s.keyCode=0;s.charCode=0;s.ctrlKey=p;s.altKey=p;s.shiftKey=p;s.metaKey=p;s.ae=p;s.Qa=o;
  s.Wa=function(a,b){var c=this.type=a.type;S.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(Za){var e;a:{try{tc(d.nodeName);e=k;break a}catch(f){}e=p}e||(d=o)}}else if("mouseover"==c)d=a.fromElement;else if("mouseout"==c)d=a.toElement;this.relatedTarget=d;this.offsetX=M||a.offsetX!==j?a.offsetX:a.layerX;this.offsetY=M||a.offsetY!==j?a.offsetY:a.layerY;this.clientX=a.clientX!==j?a.clientX:a.pageX;this.clientY=a.clientY!==j?a.clientY:a.pageY;this.screenX=
  a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.ae=Ta?a.metaKey:a.ctrlKey;this.state=a.state;this.Qa=a;delete this.cb;delete this.Ra};function wc(a,b){return qc?a.Qa.button==b:"click"==a.type?0==b:!!(a.Qa.button&vc[b])}
  s.preventDefault=function(){uc.ta.preventDefault.call(this);var a=this.Qa;if(a.preventDefault)a.preventDefault();else if(a.returnValue=p,sc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};s.A=function(){uc.ta.A.call(this);this.relatedTarget=this.currentTarget=this.target=this.Qa=o};var xc={},T={},yc={},zc={};
  function U(a,b,c,d,e){if(b){if(da(b)){for(var f=0;f<b.length;f++)U(a,b[f],c,d,e);return o}var d=!!d,g=T;b in g||(g[b]={n:0,R:0});g=g[b];d in g||(g[d]={n:0,R:0},g.n++);var g=g[d],i=A(a),l;g.R++;if(g[i]){l=g[i];for(f=0;f<l.length;f++)if(g=l[f],g.Ya==c&&g.Rb==e){if(g.Sa)break;return l[f].key}}else l=g[i]=[],g.n++;f=Ac();f.src=a;g=new oc;g.Wa(c,f,a,b,d,e);c=g.key;f.key=c;l.push(g);xc[c]=g;yc[i]||(yc[i]=[]);yc[i].push(g);a.addEventListener?(a==u||!a.tc)&&a.addEventListener(b,f,d):a.attachEvent(b in zc?
  zc[b]:zc[b]="on"+b,f);return c}h(Error("Invalid event type"))}function Ac(){var a=Bc,b=rc?function(c){return a.call(b.src,b.key,c)}:function(c){c=a.call(b.src,b.key,c);if(!c)return c};return b}function Cc(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)Cc(a,b[f],c,d,e);else{d=!!d;a:{f=T;if(b in f&&(f=f[b],d in f&&(f=f[d],a=A(a),f[a]))){a=f[a];break a}a=o}if(a)for(f=0;f<a.length;f++)if(a[f].Ya==c&&a[f].capture==d&&a[f].Rb==e){V(a[f].key);break}}}
  function V(a){if(xc[a]){var b=xc[a];if(!b.Sa){var c=b.src,d=b.type,e=b.Qc,f=b.capture;c.removeEventListener?(c==u||!c.tc)&&c.removeEventListener(d,e,f):c.detachEvent&&c.detachEvent(d in zc?zc[d]:zc[d]="on"+d,e);c=A(c);e=T[d][f][c];if(yc[c]){var g=yc[c];wa(g,b);0==g.length&&delete yc[c]}b.Sa=k;e.Mc=k;Dc(d,f,c,e);delete xc[a]}}}
  function Dc(a,b,c,d){if(!d.rb&&d.Mc){for(var e=0,f=0;e<d.length;e++)d[e].Sa?d[e].Qc.src=o:(e!=f&&(d[f]=d[e]),f++);d.length=f;d.Mc=p;0==f&&(delete T[a][b][c],T[a][b].n--,0==T[a][b].n&&(delete T[a][b],T[a].n--),0==T[a].n&&delete T[a])}}
  function Ec(a,b){var c,d=0,e=b==o,f=c==o;c=!!c;if(a==o)Ia(yc,function(a){for(var g=a.length-1;0<=g;g--){var i=a[g];if((e||b==i.type)&&(f||c==i.capture))V(i.key),d++}});else{var g=A(a);if(yc[g])for(var g=yc[g],i=g.length-1;0<=i;i--){var l=g[i];if((e||b==l.type)&&(f||c==l.capture))V(l.key),d++}}}function Fc(a,b,c,d,e){var f=1,b=A(b);if(a[b]){a.R--;a=a[b];a.rb?a.rb++:a.rb=1;try{for(var g=a.length,i=0;i<g;i++){var l=a[i];l&&!l.Sa&&(f&=Gc(l,e)!==p)}}finally{a.rb--,Dc(c,d,b,a)}}return Boolean(f)}
  function Gc(a,b){var c=a.handleEvent(b);a.pc&&V(a.key);return c}
  function Bc(a,b){if(!xc[a])return k;var c=xc[a],d=c.type,e=T;if(!(d in e))return k;var e=e[d],f,g;if(!rc){var i;if(!(i=b))a:{i="window.event".split(".");for(var l=u;f=i.shift();)if(x(l[f]))l=l[f];else{i=o;break a}i=l}f=i;i=k in e;l=p in e;if(i){if(0>f.keyCode||f.returnValue!=j)return k;a:{var m=p;if(0==f.keyCode)try{f.keyCode=-1;break a}catch(r){m=k}if(m||f.returnValue==j)f.returnValue=k}}m=new uc;m.Wa(f,this);f=k;try{if(i){for(var n=[],R=m.currentTarget;R;R=R.parentNode)n.push(R);g=e[k];g.R=g.n;
  for(var t=n.length-1;!m.Ra&&0<=t&&g.R;t--)m.currentTarget=n[t],f&=Fc(g,n[t],d,k,m);if(l){g=e[p];g.R=g.n;for(t=0;!m.Ra&&t<n.length&&g.R;t++)m.currentTarget=n[t],f&=Fc(g,n[t],d,p,m)}}else f=Gc(c,m)}finally{if(n)n.length=0;m.z()}return f}d=new uc(b,this);try{f=Gc(c,d)}finally{d.z()}return f};function W(a,b){if(a instanceof W)this.i=a.gb();else{var c;if(c=y(a))a:{for(var d=c=0;d<a.length;d++){if(!y(a[d])||0<c&&a[d].length!=c){c=p;break a}for(var e=0;e<a[d].length;e++)if(!ea(a[d][e])){c=p;break a}if(0==c)c=a[d].length}c=0!=c}c?this.i=ya(a):a instanceof mb?this.i=Hc(a.height,a.width):ea(a)&&ea(b)&&0<a&&0<b?this.i=Hc(a,b):h(Error("Invalid argument(s) for Matrix contructor"))}this.e=new mb(this.i[0].length,this.i.length)}
  function Ic(a){for(var b=[],c=0;c<a;c++){b[c]=[];for(var d=0;d<a;d++)b[c][d]=c==d?1:0}return new W(b)}function Jc(a,b,c){for(var d=0;d<a.e.height;d++)for(var e=0;e<a.e.width;e++)b.call(c,a.i[d][e],d,e,a)}function Kc(a,b){var c=new W(a.e);Jc(a,function(d,e,f){c.i[e][f]=b.call(j,d,e,f,a)});return c}function Hc(a,b){for(var c=[],d=0;d<a;d++){c[d]=[];for(var e=0;e<b;e++)c[d][e]=0}return c}s=W.prototype;
  s.add=function(a){nb(this.e,a.e)||h(Error("Matrix summation is only supported on arrays of equal size"));return Kc(this,function(b,c,d){return b+a.i[c][d]})};function Lc(a,b){a.e.height!=b.e.height&&h(Error("The given matrix has height "+b.e.height+", but  needs to have height "+a.e.height+"."));var c=new W(a.e.height,a.e.width+b.e.width);Jc(a,function(a,b,f){c.i[b][f]=a});Jc(b,function(a,b,f){c.i[b][this.e.width+f]=a},a);return c}
  s.equals=function(a,b){if(this.e.width!=a.e.width||this.e.height!=a.e.height)return p;for(var c=b||0,d=0;d<this.e.height;d++)for(var e=0;e<this.e.width;e++)if(!(Math.abs(this.i[d][e]-a.i[d][e])<=(c||1.0E-6)))return p;return k};function Mc(a){var b=new W(a.e.width,a.e.height);Jc(a,function(a,d,e){b.i[e][d]=a});return b}function X(a,b,c){return!(0<=b&&b<a.e.height&&0<=c&&c<a.e.width)?o:a.i[b][c]}
  function Nc(a,b,c,d){0<=b&&b<a.e.height&&0<=c&&c<a.e.width||h(Error("Index out of bounds when setting matrix value, ("+b+","+c+") in size ("+a.e.height+","+a.e.width+")"));a.i[b][c]=d}s.multiply=function(a){if(a instanceof W)return this.e.width!=a.e.height&&h(Error("Invalid matrices for multiplication. Second matrix should have the same number of rows as the first has columns.")),Oc(this,a);if(ea(a))return Pc(this,a);h(Error("A matrix can only be multiplied by a number or another matrix."))};
  s.jc=function(a){nb(this.e,a.e)||h(Error("Matrix subtraction is only supported on arrays of equal size."));return Kc(this,function(b,c,d){return b-a.i[c][d]})};s.gb=q("i");function Qc(a,b,c,d){var e=new W((c?c:a.e.height-1)-0+1,(d?d:a.e.width-1)-b+1);Jc(e,function(a,c,d){e.i[c][d]=this.i[0+c][b+d]},a);return e}function Oc(a,b){var c=new W(a.e.height,b.e.width);Jc(c,function(a,e,f){for(var g=a=0;g<this.e.width;g++)a+=X(this,e,g)*X(b,g,f);Nc(c,e,f,a)},a);return c}
  function Pc(a,b){return Kc(a,function(a){return a*b})};function Rc(){this.F=Ic(4)}Rc.prototype.translate=function(a,b,c){this.F=this.F.multiply(new W([[1,0,0,a],[0,1,0,b],[0,0,1,c],[0,0,0,1]]))};Rc.prototype.scale=function(a,b,c){this.F=this.F.multiply(new W([[a,0,0,0],[0,b,0,0],[0,0,c,0],[0,0,0,1]]))};function Sc(a,b){var c=Math.cos(b),d=Math.sin(b);a.F=a.F.multiply(new W([[1,0,0,0],[0,c,-d,0],[0,d,c,0],[0,0,0,1]]))}function Tc(a,b){var c=Math.cos(b),d=Math.sin(b);a.F=a.F.multiply(new W([[c,-d,0,0],[d,c,0,0],[0,0,1,0],[0,0,0,1]]))};function Uc(a,b,c){for(var d=o,e=["webgl","experimental-webgl"],f=0;w(d)&&f<e.length;++f)if(!d)a:{try{var g=a.getContext(e[f]);if(x(g)){d=g;break a}}catch(i){}d=o}w(d)&&(v(c)?c():h(Error("unable to get a valid WebGL context")));d.enable(d.CULL_FACE);d.cullFace(d.BACK);d.clearColor(0,0,0,0);d.clearDepth(1);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);this.canvas=a;this.ve=b||o;this.c=d;this.$=a.width;this.Z=a.height;d.viewport(0,0,this.$,this.Z);this.kb=
  this.xa=0;this.jb=1;this.Ua=this.$/this.Z;this.Fa=Ic(4);this.I=new Rc;this.vb=this.ub=this.Fa;U(u,"resize",this.bb,p,this)}function Vc(a){a.xa=J(50);a.kb=1.0E-6;a.jb=5;a.Ua=a.$/a.Z;Wc(a)}function Wc(a){var b=1/Math.tan(a.xa/2);a.Fa=new W([[b/a.Ua,0,0,0],[0,b,0,0],[0,0,0,0],[0,0,-1,0]]);Xc(a)}function Xc(a){var b=a.kb-a.jb;Nc(a.Fa,2,2,(a.jb+a.kb)/b);Nc(a.Fa,2,3,2*a.jb*a.kb/b)}
  Uc.prototype.bb=function(){this.$=this.canvas.width=this.canvas.clientWidth;this.Z=this.canvas.height=this.canvas.clientHeight;this.c.viewport(0,0,this.$,this.Z);this.Ua=this.$/this.Z;Wc(this);Yc(this.d)};Uc.prototype.d=o;
  function Zc(a){a.ub=a.Fa.multiply(a.I.F);var b,c=a.ub;c.e.width!=c.e.height&&h(Error("An inverse can only be taken on a square matrix."));b=Ic(c.e.height);a:{for(var c=Lc(c,b),d=new W(c),e=0,f=0;f<d.e.height&&!(e>=d.e.width);f++){for(var g=f;0==d.i[g][e];)if(g++,g==d.e.height&&(g=f,e++,e==d.e.width)){c=d;break a}var i=c,l=f,m=i.i[g];i.i[g]=i.i[l];i.i[l]=m;g=d.i[f][e];for(i=e;i<d.e.width;i++)d.i[f][i]/=g;for(g=0;g<d.e.height;g++)if(g!=f){l=d.i[g][e];for(i=e;i<d.e.width;i++)d.i[g][i]-=l*d.i[f][i]}e++}c=
  d}b=!Qc(c,0,b.e.width-1,b.e.height-1).equals(b)?o:Qc(c,b.e.width);a.vb=b;return a.ub}Uc.prototype.Pc=ba;Uc.prototype.ab="";function $c(a,b,c){c=a.c.createShader(c);a.c.shaderSource(c,b);a.c.compileShader(c);a.c.getShaderParameter(c,a.c.COMPILE_STATUS)?w(c)&&h(Error("Unknown")):h(Error("Shader err: "+a.c.getShaderInfoLog(c)));return c};var ad={"earth-vs-overlay.glsl":"#define BUFF_SIDE 4.0\n#define BUFF_SIZE 16\n#define TERRAIN %TERRAIN_BOOL%\n#define BUFF_SIDE_T %BUFFER_SIDE_T_FLOAT%\n#define BUFF_SIZE_T int(BUFF_SIDE_T*BUFF_SIDE_T)\nprecision highp float;const float PI=3.1415927;const float PI2=6.2831855;const float EARTH_RADIUS=6378137.0;const float TERRAIN_MIN=-10000.0;const float TERRAIN_MAX=12000.0;attribute vec2 aVertexPosition;attribute vec2 aTextureCoord;uniform mat4 uMVPMatrix;uniform float uTileCount;uniform vec2 uOffset;uniform float uMetaL0A[BUFF_SIZE];uniform float uMetaL1A[BUFF_SIZE];uniform float uMetaL2A[BUFF_SIZE];uniform vec2 uOffLA[3];varying float vFallbackA;varying vec2 vTCA;uniform float uMetaL0B[BUFF_SIZE];uniform float uMetaL1B[BUFF_SIZE];uniform float uMetaL2B[BUFF_SIZE];uniform vec2 uOffLB[3];varying float vFallbackB;varying vec2 vTCB;\n#if TERRAIN\nuniform float uMetaL0T[BUFF_SIZE_T];uniform float uMetaL1T[BUFF_SIZE_T];uniform vec2 uOffLT[2];uniform sampler2D uBufferL0T;uniform sampler2D uBufferL1T;uniform sampler2D uBufferLnT;uniform float uDegradationT;bool validateOffsetT(vec2 off){return off.x>=0.0&&off.y>=0.0&&off.x<BUFF_SIDE_T&&off.y<BUFF_SIDE_T;}\n#endif\nbool validateOffset(vec2 off){return off.x>=0.0&&off.y>=0.0&&off.x<BUFF_SIDE&&off.y<BUFF_SIDE;}vec2 modFirst(vec2 x,float y){return vec2(x.x-y*floor(x.x/y),x.y);}void main(){vec2 phi=PI2*(aVertexPosition+uOffset)/uTileCount;vec2 tileCoords=vec2(mod(aVertexPosition.x-aTextureCoord.x+uOffset.x+uTileCount*0.5,uTileCount),-aTextureCoord.y-aVertexPosition.y-uOffset.y+uTileCount*0.5);float elev=0.0;\n#if TERRAIN\nvec2 TCT;float fallbackT=-1.0;float degradationModifier=exp2(uDegradationT);vec2 offT=modFirst(tileCoords/degradationModifier-uOffLT[0],uTileCount/degradationModifier);vec2 rawElev;if(validateOffsetT(offT)&&uMetaL0T[int(floor(offT.y)*BUFF_SIDE_T+offT.x)]==1.0){fallbackT=0.0;}else{offT=modFirst((tileCoords/(2.0*degradationModifier))-uOffLT[1],uTileCount/(2.0*degradationModifier));if(validateOffsetT(offT)&&uMetaL1T[int(floor(offT.y)*BUFF_SIDE_T+offT.x)]==1.0){fallbackT=1.0;}else{TCT=(tileCoords+aTextureCoord)/uTileCount;}}if(fallbackT>=0.0){TCT=(offT+aTextureCoord/(exp2(fallbackT)*degradationModifier)+mod(uOffLT[int(fallbackT)],BUFF_SIDE_T))/BUFF_SIDE_T;}TCT.y=1.0-TCT.y;if(fallbackT==0.0){rawElev=texture2D(uBufferL0T,TCT).rg;}else if(fallbackT==1.0){rawElev=texture2D(uBufferL1T,TCT).rg;}else{rawElev=texture2D(uBufferLnT,TCT).rg;}elev=((TERRAIN_MAX-TERRAIN_MIN)*(rawElev.r+rawElev.g/256.0)-TERRAIN_MAX)/EARTH_RADIUS;\n#endif\nfloat exp_2y=exp(2.0*phi.y);float tanh=((exp_2y-1.0)/(exp_2y+1.0));float cosy=sqrt(1.0-tanh*tanh);vec3 pos=vec3(sin(phi.x)*cosy,tanh,cos(phi.x)*cosy);gl_Position=uMVPMatrix*vec4(pos*(1.0+elev),1.0);if(abs(phi.y)>PI){vFallbackA=-1.0e3;return;}vFallbackA=-1.0;vec2 off=modFirst(tileCoords-uOffLA[0],uTileCount);if(validateOffset(off)&&uMetaL0A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=0.0;}else{off=modFirst((tileCoords/2.0)-uOffLA[1],uTileCount/2.0);if(validateOffset(off)&&uMetaL1A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=1.0;}else{off=modFirst((tileCoords/4.0)-uOffLA[2],uTileCount/4.0);if(validateOffset(off)&&uMetaL2A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=2.0;}}}if(vFallbackA>=0.0){vTCA=(off+aTextureCoord/exp2(vFallbackA)+mod(uOffLA[int(vFallbackA)],BUFF_SIDE))/BUFF_SIDE;}else{vTCA=(tileCoords+aTextureCoord)/uTileCount;}vTCA.y=1.0-vTCA.y;vFallbackB=-1.0;off=modFirst(tileCoords-uOffLB[0],uTileCount);if(validateOffset(off)&&uMetaL0B[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackB=0.0;}else{off=modFirst((tileCoords/2.0)-uOffLB[1],uTileCount/2.0);if(validateOffset(off)&&uMetaL1B[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackB=1.0;}else{off=modFirst((tileCoords/4.0)-uOffLB[2],uTileCount/4.0);if(validateOffset(off)&&uMetaL2B[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackB=2.0;}}}if(vFallbackB>=0.0){vTCB=(off+aTextureCoord/exp2(vFallbackB)+mod(uOffLB[int(vFallbackB)],BUFF_SIDE))/BUFF_SIDE;}else{vTCB=(tileCoords+aTextureCoord)/uTileCount;}vTCB.y=1.0-vTCB.y;}",
  "halo-vs.glsl":"precision lowp float;attribute vec2 aVertexPosition;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;varying vec2 vCoords;void main(){gl_Position=uPMatrix*(uMVMatrix[3]+uMVMatrix[0]*aVertexPosition.x+uMVMatrix[1]*aVertexPosition.y);gl_Position.z=0.0;vCoords=aVertexPosition;}","earth-vs.glsl":"#define BUFF_SIDE 8.0\n#define BUFF_SIZE 64\n#define TERRAIN %TERRAIN_BOOL%\n#define BUFF_SIDE_T %BUFFER_SIDE_T_FLOAT%\n#define BUFF_SIZE_T int(BUFF_SIDE_T*BUFF_SIDE_T)\nprecision highp float;const float PI=3.1415927;const float PI2=6.2831855;const float EARTH_RADIUS=6378137.0;const float TERRAIN_MIN=-10000.0;const float TERRAIN_MAX=12000.0;attribute vec2 aVertexPosition;attribute vec2 aTextureCoord;uniform mat4 uMVPMatrix;uniform float uTileCount;uniform vec2 uOffset;uniform float uMetaL0A[BUFF_SIZE];uniform float uMetaL1A[BUFF_SIZE];uniform float uMetaL2A[BUFF_SIZE];uniform vec2 uOffLA[3];varying float vFallbackA;varying vec2 vTCA;\n#if TERRAIN\nuniform float uMetaL0T[BUFF_SIZE_T];uniform float uMetaL1T[BUFF_SIZE_T];uniform vec2 uOffLT[2];uniform sampler2D uBufferL0T;uniform sampler2D uBufferL1T;uniform sampler2D uBufferLnT;uniform float uDegradationT;bool validateOffsetT(vec2 off){return off.x>=0.0&&off.y>=0.0&&off.x<BUFF_SIDE_T&&off.y<BUFF_SIDE_T;}\n#endif\nbool validateOffset(vec2 off){return off.x>=0.0&&off.y>=0.0&&off.x<BUFF_SIDE&&off.y<BUFF_SIDE;}vec2 modFirst(vec2 x,float y){return vec2(x.x-y*floor(x.x/y),x.y);}void main(){vec2 phi=PI2*(aVertexPosition+uOffset)/uTileCount;vec2 tileCoords=vec2(mod(aVertexPosition.x-aTextureCoord.x+uOffset.x+uTileCount*0.5,uTileCount),-aTextureCoord.y-aVertexPosition.y-uOffset.y+uTileCount*0.5);float elev=0.0;\n#if TERRAIN\nvec2 TCT;float fallbackT=-1.0;float degradationModifier=exp2(uDegradationT);vec2 offT=modFirst(tileCoords/degradationModifier-uOffLT[0],uTileCount/degradationModifier);vec2 rawElev;if(validateOffsetT(offT)&&uMetaL0T[int(floor(offT.y)*BUFF_SIDE_T+offT.x)]==1.0){fallbackT=0.0;}else{offT=modFirst((tileCoords/(2.0*degradationModifier))-uOffLT[1],uTileCount/(2.0*degradationModifier));if(validateOffsetT(offT)&&uMetaL1T[int(floor(offT.y)*BUFF_SIDE_T+offT.x)]==1.0){fallbackT=1.0;}else{TCT=(tileCoords+aTextureCoord)/uTileCount;}}if(fallbackT>=0.0){TCT=(offT+aTextureCoord/(exp2(fallbackT)*degradationModifier)+mod(uOffLT[int(fallbackT)],BUFF_SIDE_T))/BUFF_SIDE_T;}TCT.y=1.0-TCT.y;if(fallbackT==0.0){rawElev=texture2D(uBufferL0T,TCT).rg;}else if(fallbackT==1.0){rawElev=texture2D(uBufferL1T,TCT).rg;}else{rawElev=texture2D(uBufferLnT,TCT).rg;}elev=((TERRAIN_MAX-TERRAIN_MIN)*(rawElev.r+rawElev.g/256.0)-TERRAIN_MAX)/EARTH_RADIUS;\n#endif\nfloat exp_2y=exp(2.0*phi.y);float tanh=((exp_2y-1.0)/(exp_2y+1.0));float cosy=sqrt(1.0-tanh*tanh);vec3 pos=vec3(sin(phi.x)*cosy,tanh,cos(phi.x)*cosy);gl_Position=uMVPMatrix*vec4(pos*(1.0+elev),1.0);if(abs(phi.y)>PI){vFallbackA=-1.0e3;return;}vFallbackA=-1.0;vec2 off=modFirst(tileCoords-uOffLA[0],uTileCount);if(validateOffset(off)&&uMetaL0A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=0.0;}else{off=modFirst((tileCoords/2.0)-uOffLA[1],uTileCount/2.0);if(validateOffset(off)&&uMetaL1A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=1.0;}else{off=modFirst((tileCoords/4.0)-uOffLA[2],uTileCount/4.0);if(validateOffset(off)&&uMetaL2A[int(floor(off.y)*BUFF_SIDE+off.x)]==1.0){vFallbackA=2.0;}}}if(vFallbackA>=0.0){vTCA=(off+aTextureCoord/exp2(vFallbackA)+mod(uOffLA[int(vFallbackA)],BUFF_SIDE))/BUFF_SIDE;}else{vTCA=(tileCoords+aTextureCoord)/uTileCount;}vTCA.y=1.0-vTCA.y;}",
  "earth-fs.glsl":"precision mediump float;uniform sampler2D uBufferL0A;uniform sampler2D uBufferL1A;uniform sampler2D uBufferL2A;uniform sampler2D uBufferLnA;varying float vFallbackA;varying vec2 vTCA;void main(){float fallback=floor(vFallbackA+0.5);if(fallback==0.0){gl_FragColor=texture2D(uBufferL0A,vTCA);}else if(fallback==1.0){gl_FragColor=texture2D(uBufferL1A,vTCA);}else if(fallback==2.0){gl_FragColor=texture2D(uBufferL2A,vTCA);}else if(fallback==-1.0){gl_FragColor=texture2D(uBufferLnA,vTCA);}else{discard;}}",
  "halo-fs.glsl":"precision lowp float;uniform sampler2D uGradient;varying vec2 vCoords;void main(){float distance=vCoords.x*vCoords.x+vCoords.y*vCoords.y;if(distance<0.98){discard;}else{gl_FragColor=texture2D(uGradient,vec2((sqrt(distance)-1.0)/0.1,0.5));}}","earth-fs-overlay.glsl":"precision mediump float;uniform sampler2D uBufferL0A;uniform sampler2D uBufferL1A;uniform sampler2D uBufferL2A;uniform sampler2D uBufferLnA;varying float vFallbackA;varying vec2 vTCA;uniform sampler2D uBufferL0B;uniform sampler2D uBufferL1B;uniform sampler2D uBufferL2B;varying float vFallbackB;varying vec2 vTCB;uniform float uMixFactor;void main(){float fallbackA=floor(vFallbackA+0.5);vec4 colorA;if(fallbackA==0.0){colorA=texture2D(uBufferL0A,vTCA);}else if(fallbackA==1.0){colorA=texture2D(uBufferL1A,vTCA);}else if(fallbackA==2.0){colorA=texture2D(uBufferL2A,vTCA);}else if(fallbackA==-1.0){colorA=texture2D(uBufferLnA,vTCA);}else{discard;}float fallbackB=floor(vFallbackB+0.5);vec4 colorB=vec4(0.0);if(fallbackB==0.0){colorB=texture2D(uBufferL0B,vTCB);}else if(fallbackB==1.0){colorB=texture2D(uBufferL1B,vTCB);}else if(fallbackB==2.0){colorB=texture2D(uBufferL2B,vTCB);}gl_FragColor=mix(colorA,colorB,uMixFactor*colorB.a);}"};function bd(a){return a in ad?ad[a]:Da("../we/shaders/"+a)};function cd(a){var c;this.a=a.a;c=this.c=a.a.c,a=c;this.Yc=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this.Yc);a.bufferData(a.ARRAY_BUFFER,new Float32Array([1.1,1.1,-1.1,1.1,1.1,-1.1,-1.1,-1.1]),a.STATIC_DRAW);this.yc=a.createTexture();var b=new Uint8Array([224,224,255,255,207,218,250,220,179,194,245,180,137,166,237,145,84,123,221,110,51,94,198,75,25,67,178,30,13,53,161,0]);a.bindTexture(a.TEXTURE_2D,this.yc);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,8,1,0,a.RGBA,a.UNSIGNED_BYTE,b);a.texParameteri(a.TEXTURE_2D,
  a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);b=bd("halo-fs.glsl");a=bd("halo-vs.glsl");b=$c(this.a,b,this.c.FRAGMENT_SHADER);a=$c(this.a,a,this.c.VERTEX_SHADER);this.P=this.c.createProgram();w(this.P)&&h(Error("Unknown"));this.c.attachShader(this.P,a);this.c.attachShader(this.P,b);this.c.bindAttribLocation(this.P,0,"aVertexPosition");
  this.c.linkProgram(this.P);this.c.getProgramParameter(this.P,this.c.LINK_STATUS)||h(Error("Shader program err: "+this.c.getProgramInfoLog(this.P)));this.ib=this.c.getAttribLocation(this.P,"aVertexPosition");this.c.enableVertexAttribArray(this.ib);this.Pd=this.c.getUniformLocation(this.P,"uMVMatrix");this.Zd=this.c.getUniformLocation(this.P,"uPMatrix");this.vd=this.c.getUniformLocation(this.P,"uGradient")}
  cd.prototype.draw=function(){this.c.useProgram(this.P);this.c.bindBuffer(this.c.ARRAY_BUFFER,this.Yc);this.c.vertexAttribPointer(this.ib,2,this.c.FLOAT,p,0,0);this.c.activeTexture(this.c.TEXTURE0);this.c.bindTexture(this.c.TEXTURE_2D,this.yc);this.c.uniform1i(this.vd,0);var a=new Float32Array(Ca(Mc(this.a.I.F).gb())),b=new Float32Array(Ca(Mc(this.a.Fa).gb()));this.c.uniformMatrix4fv(this.Pd,p,a);this.c.uniformMatrix4fv(this.Zd,p,b);this.c.drawArrays(this.c.TRIANGLE_STRIP,0,4)};function dd(){}E(dd,zb);s=dd.prototype;s.tc=k;s.ec=o;s.addEventListener=function(a,b,c,d){U(this,a,b,c,d)};s.removeEventListener=function(a,b,c,d){Cc(this,a,b,c,d)};
  s.dispatchEvent=function(a){var b=a.type||a,c=T;if(b in c){if(z(a))a=new S(a,this);else if(a instanceof S)a.target=a.target||this;else{var d=a,a=new S(b,this);Oa(a,d)}var d=1,e,c=c[b],b=k in c,f;if(b){e=[];for(f=this;f;f=f.ec)e.push(f);f=c[k];f.R=f.n;for(var g=e.length-1;!a.Ra&&0<=g&&f.R;g--)a.currentTarget=e[g],d&=Fc(f,e[g],a.type,k,a)&&a.cb!=p}if(p in c)if(f=c[p],f.R=f.n,b)for(g=0;!a.Ra&&g<e.length&&f.R;g++)a.currentTarget=e[g],d&=Fc(f,e[g],a.type,p,a)&&a.cb!=p;else for(e=this;!a.Ra&&e&&f.R;e=e.ec)a.currentTarget=
  e,d&=Fc(f,e,a.type,p,a)&&a.cb!=p;a=Boolean(d)}else a=k;return a};s.A=function(){dd.ta.A.call(this);Ec(this);this.ec=o};function ed(a){this.f=a;this.ba=this.V=0;this.B=1E7;this.yb=this.ka=this.za=0}E(ed,dd);s=ed.prototype;s.setPosition=function(a,b){this.V=H(a,-1.57,1.57);this.ba=Ea(b);this.dispatchEvent(new fd(gd))};function hd(a,b,c){function d(a){var d=c;c=d*Math.cos(a)-2*b*Math.sin(a);b=d*Math.sin(a)/2+b*Math.cos(a)}d(a.yb);b/=Math.max(Math.abs(Math.cos(a.ka)),0.1);d(a.za);a.setPosition(a.V+b,a.ba+c)}s.getPosition=function(){return[this.V,this.ba]};
  function id(a,b){a.B=H(b,250,1E7);a.dispatchEvent(new fd(jd))}function kd(a){return ld(a.f,a.f.a.$/2,a.f.a.Z/2,k)}s.setHeading=function(a){this.za=a};s.setTilt=function(a){this.ka=a};s.getHeading=q("za");s.getTilt=q("ka");var gd="poschanged",jd="altchanged";function fd(a){S.call(this,a)}E(fd,S);function md(a,b,c,d,e){function f(a,b,c,d){a?a=b:(a=b/Math.max(1,Math.sqrt(c*c+d*d)),a=Math.max(1,Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))));return a}a=a.c;this.Y=[];this.Na=[];this.h=[];for(var g=-b/2;g<b/2;++g)for(var i=-c/2;i<c/2;++i){var l=f(e,d,g,i),m=[i+1<c/2&&f(e,d,g,i+1)>l,g+1<b/2&&f(e,d,g+1,i)>l,i-1>-c/2&&f(e,d,g,i-1)>l,g-1>-b/2&&f(e,d,g-1,i)>l];nd(this,g,i,l,m)}this.Fb=a.createBuffer();this.Db=a.createBuffer();this.Ac=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this.Fb);a.bufferData(a.ARRAY_BUFFER,
  new Float32Array(this.Y),a.STATIC_DRAW);this.Fb.Tb=2;a.bindBuffer(a.ARRAY_BUFFER,this.Db);a.bufferData(a.ARRAY_BUFFER,new Float32Array(this.Na),a.STATIC_DRAW);this.Db.Tb=2;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.Ac);a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.h),a.STATIC_DRAW);this.Sd=this.h.length}
  function nd(a,b,c,d,e){for(var f=a.Y.length/2,g=0;g<=d;++g)for(var i=0;i<=d;++i)a.Y.push(b+i/d,c+g/d),a.Na.push(i/d,1-g/d);var l=[0,0,0,0];if(e[0]){l[0]=a.Y.length/2;for(i=0;i<d;++i)a.Y.push(b+(i+0.5)/d,c+1),a.Na.push((i+0.5)/d,0)}if(e[1]){l[1]=a.Y.length/2;for(g=0;g<d;++g)a.Y.push(b+1,c+(g+0.5)/d),a.Na.push(1,1-(g+0.5)/d)}if(e[2]){l[2]=a.Y.length/2;for(i=0;i<d;++i)a.Y.push(b+(i+0.5)/d,c),a.Na.push((i+0.5)/d,1)}if(e[3]){l[3]=a.Y.length/2;for(g=0;g<d;++g)a.Y.push(b,c+(g+0.5)/d),a.Na.push(0,1-(g+0.5)/
  d)}b=B(function(){},a);c=d+1;for(g=0;g<d;++g)for(i=0;i<d;++i){var m=f+g*c+i;a.h.push(m);var r=0==g&&e[2],n=0==i&&e[3];r&&!n?(a.h.push(l[2]+i),a.h.push(m+c),b(),a.h.push(l[2]+i)):n&&!r?(a.h.push(m+1),a.h.push(l[3]+g),b(),a.h.push(l[3]+g)):n&&r&&(a.h.push(l[2]+i),a.h.push(l[3]+g),b(),a.h.push(l[3]+g),a.h.push(l[2]+i),a.h.push(m+c),b(),a.h.push(l[2]+i));a.h.push(m+1);a.h.push(m+c);b();a.h.push(m+c+1);r=g==d-1&&e[0];n=i==d-1&&e[1];r&&!n?(a.h.push(l[0]+i),a.h.push(m+1),b(),a.h.push(l[0]+i)):n&&!r?(a.h.push(m+
  c),a.h.push(l[1]+g),b(),a.h.push(l[1]+g)):r&&n&&(a.h.push(l[0]+i),a.h.push(l[1]+g),b(),a.h.push(l[1]+g),a.h.push(l[0]+i),a.h.push(m+1),b(),a.h.push(l[0]+i));a.h.push(m+c);a.h.push(m+1);b()}};function od(a,b,c,d){b=b.c;this.k=a;this.ib=b.getAttribLocation(this.k,"aVertexPosition");b.enableVertexAttribArray(this.ib);this.Wc=b.getAttribLocation(this.k,"aTextureCoord");b.enableVertexAttribArray(this.Wc);this.Qd=Y(b,this.k,"uMVPMatrix");this.Gd=Y(b,this.k,"uMetaL0A");this.Jd=Y(b,this.k,"uMetaL1A");this.Md=Y(b,this.k,"uMetaL2A");this.Ad=Y(b,this.k,"uOffLA");this.$c=Y(b,this.k,"uBufferL0A");this.cd=Y(b,this.k,"uBufferL1A");this.fd=Y(b,this.k,"uBufferL2A");this.hd=Y(b,this.k,"uBufferLnA");if(c)this.Hd=
  Y(b,this.k,"uMetaL0B"),this.Kd=Y(b,this.k,"uMetaL1B"),this.Nd=Y(b,this.k,"uMetaL2B"),this.Bd=Y(b,this.k,"uOffLB"),this.ad=Y(b,this.k,"uBufferL0B"),this.dd=Y(b,this.k,"uBufferL1B"),this.gd=Y(b,this.k,"uBufferL2B"),this.Od=Y(b,this.k,"uMixFactor");if(d)this.od=Y(b,this.k,"uDegradationT"),this.Id=Y(b,this.k,"uMetaL0T"),this.Ld=Y(b,this.k,"uMetaL1T"),this.Cd=Y(b,this.k,"uOffLT"),this.bd=Y(b,this.k,"uBufferL0T"),this.ed=Y(b,this.k,"uBufferL1T"),this.jd=Y(b,this.k,"uBufferLnT");this.le=Y(b,this.k,"uTileCount");
  this.Ud=Y(b,this.k,"uOffset")}function Y(a,b,c){a=a.getUniformLocation(b,c);w(a)&&h(Error("Invalid name "+c));return a};function pd(a,b){this.qb=a||1;this.fb=b||qd;this.Ib=B(this.ie,this);this.Vb=C()}E(pd,dd);pd.prototype.enabled=p;var qd=u.window;s=pd.prototype;s.Ka=o;s.ie=function(){if(this.enabled){var a=C()-this.Vb;if(0<a&&a<0.8*this.qb)this.Ka=this.fb.setTimeout(this.Ib,this.qb-a);else if(this.dispatchEvent(rd),this.enabled)this.Ka=this.fb.setTimeout(this.Ib,this.qb),this.Vb=C()}};s.start=function(){this.enabled=k;if(!this.Ka)this.Ka=this.fb.setTimeout(this.Ib,this.qb),this.Vb=C()};
  s.stop=function(){this.enabled=p;if(this.Ka)this.fb.clearTimeout(this.Ka),this.Ka=o};s.A=function(){pd.ta.A.call(this);this.stop();delete this.fb};var rd="tick";function sd(a){fa(a)||(a&&"function"==typeof a.handleEvent?a=B(a.handleEvent,a):h(Error("Invalid listener argument")));return qd.setTimeout(a,20)};function td(a){this.ja=new Kb;this.Da=[];this.he=512;this.qc=new pd(2E4);U(this.qc,rd,this.md,p,this);this.qc.start();ud(this,a)}function ud(a,b){a.Xc=C();a.N=b;Ib(a.ja,function(a){a.z()});a.ja.clear();a.Da=[]}s=td.prototype;s.N=o;s.Xc=0;s.ke=ba;s.md=function(){var a=ua(this.ja.ra(),function(a){return 20==a.state||a.state==Cb||-10==a.state});for(Aa(a,function(a,b){return a.sa-b.sa});this.ja.fa()>this.he&&0<a.length;){var b=a.shift();b.state==Cb&&wa(this.Da,b);this.ja.remove(b.getKey());b.z()}};
  s.me=function(a){a.sa<this.Xc?(a.state=-10,this.ja.remove(a.getKey()),a.z()):this.ke(a)};function vd(a){Aa(a.Da,function(a,b){return a.sa-b.sa});for(var b=Math.min(a.Da.length,5-a.N.W),c=0;c<b;c++)Vb(a.N,a.Da.pop(),B(a.me,a))};function wd(a,b,c,d){this.aa=b;this.la=[];this.g=c;this.N=a;this.kc=new td(a);this.H=d;this.M=1<<this.H;this.Pa=this.g>=this.M;this.ha=this.Ea=0;this.buffer=o;this.G=[];xd(this)}function xd(a){a.G=[];for(var b=0;b<a.g;++b)a.G.push(Array(a.g));a.buffer&&a.buffer.clear()}wd.prototype.disable=function(){this.la=[];xd(this);this.buffer=o};wd.prototype.ea=function(a){this.N=a;ud(this.kc,a);this.la=[];xd(this)};
  function yd(a){a.la=[];for(var b=B(function(a,b){var c=(this.Pa?this.M:this.g)/2,a=a+c,b=b+c;1!==this.G[b][a]&&zd(this,this.Ea+a,this.ha+b,d)},a),c=B(function(a,c){for(var d=-c;d<c;++d)b(d,-c),b(d,c-1);for(d=-c;d<c;++d)b(-c,d),b(c-1,d)},a),d=C(),a=Math.min(a.g,a.M)/2;0<a;--a)c(d+a,a)}
  function zd(a,b,c,d){var b=I(b,a.M),c=I(c,a.M),e;a:{e=a.kc;var f=a.H,g=b,i=c,c=f+"_"+g+"_"+i,b=e.ja.get(c);if(x(b))-10==b.state?7E3<d-b.sa&&(b.z(),b=new Bb(f,g,i,d),e.ja.set(c,b),e.Da.push(b)):b.sa=d;else{d=b=new Bb(f,g,i,d);f=Sb(e.N,d.zoom);if(!(d.x>=f.left&&d.x<=f.right&&d.y>=f.top&&d.y<=f.bottom)){e=o;break a}e.ja.set(c,b);e.Da.push(b)}e=b}!w(e)&&20==e.state&&a.la.push(e)};function Ad(a,b,c){var d;d=this.ga=a.c,a=d;this.Ta=b;this.Aa=c;this.S=a.createTexture();Bd(this)}Ad.prototype.bb=function(a,b){if(!(this.Ta==a&&this.Aa==b))this.Ta=a,this.Aa=b,this.ga.deleteTexture(this.S),this.S=this.ga.createTexture(),Bd(this)};
  function Bd(a){var b=a.ga;b.bindTexture(b.TEXTURE_2D,a.S);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,1);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,a.Ta,a.Aa,0,b.RGBA,b.UNSIGNED_BYTE,o);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR_MIPMAP_LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR_MIPMAP_LINEAR)}Ad.prototype.clear=function(){this.ga.deleteTexture(this.S);this.S=this.ga.createTexture();Bd(this)};function Cd(a,b,c){function d(b){f.isTexture(g)&&(3<=b.Ob||Vb(a,b,e,d))}function e(c){if(f.isTexture(g)){f.bindTexture(f.TEXTURE_2D,g);try{f.texSubImage2D(f.TEXTURE_2D,0,c.x*l,(i-c.y-1)*l,f.RGBA,f.UNSIGNED_BYTE,Db(c))}catch(m){a.Jb()&&(a.hc(b.ab)||!(c.Ba&&0==c.Ba.src.lastIndexOf(b.ab,0)))?Vb(a,c,e,d):b.Pc()}}}var f=this.ga=b.c,g=f.createTexture();this.S=g;var i=1<<c,l=a.qa();f.bindTexture(f.TEXTURE_2D,g);f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,1);f.texImage2D(f.TEXTURE_2D,0,f.RGBA,l*i,l*i,0,f.RGBA,f.UNSIGNED_BYTE,
  o);f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR);f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR);for(var m=0;m<i;++m)for(var r=0;r<i;++r)Vb(a,new Bb(c,m,r),e,d)}E(Cd,zb);Cd.prototype.A=function(){this.ga.deleteTexture(this.S)};function Dd(a,b,c,d,e,f,g){this.aa=b;this.g=c;this.O=e;this.tb=f;this.N=a;var i=a.qa();this.da=[];for(var l=0;l<d;++l)this.da.push(new Ad(b,this.g*i,this.g*i));for(this.v=[];e<=f;++e)this.v.push(new wd(a,b,c,e));for(l=0;l<d;++l)this.v[l].buffer=this.da[l];this.T=0;this.Xa=g?o:new Cd(a,b,2)}Dd.prototype.ea=function(a){if(!w(this.Xa))this.Xa.z(),this.Xa=new Cd(a,this.aa,2);this.N=a;var b=this.g*a.qa();G(this.da,function(a){a.bb(b,b)});G(this.v,function(b){b.ea(a)});Ed(this)};
  function Fd(a,b,c,d,e,f){for(var f=H(f,a.O,a.tb),g=f-(a.O+a.T+a.da.length-1);0<g;){var i=a.v[a.T].buffer;a.v[a.T].disable();a.v[++a.T+a.da.length-1].buffer=i;g--}for(;0>g&&0<a.T;)i=a.v[a.T+a.da.length-1].buffer,a.v[a.T+a.da.length-1].disable(),a.v[--a.T].buffer=i,g++;for(var g=1<<f,l=p,c=(c/(2*Math.PI)+0.5)*g,b=(0.5-Tb(b)/(2*Math.PI))*g,e=(e/(2*Math.PI)+0.5)*g,i=(0.5-Tb(d)/(2*Math.PI))*g,d=f-a.O;d>=a.T;d--){var m=H(c-a.g/2,e-a.g,e),r=H(b-a.g/2,i-a.g,i),n=Sb(a.N,a.O+d),m=H(m,n.left,n.right+1-a.g),
  r=H(r,n.top,n.bottom+1-a.g),m=I(Math.round(m),g),r=Math.round(r),n=a.v[d],R=r,r=p;if(!n.Pa){var t=m-n.Ea,ha=R-n.ha;Math.abs(t)>n.M/2&&(t=(t-(0==t?0:0>t?-1:1)*n.M)%n.M);n.Ea=m;n.ha=R;if(Math.abs(t)>=n.g||Math.abs(ha)>=n.g)xd(n),r=k;else{r=0!=t||0!=ha;if(0<t)for(m=0;m<n.g;++m)n.G[m].splice(0,t),n.G[m].push.apply(n.G[m],Array(t));if(0>t)for(m=0;m<n.g;++m)n.G[m].splice(n.g+t,-t),n.G[m].unshift.apply(n.G[m],Array(-t));if(0<ha)for(m=0;m<ha;++m)n.G.shift(),n.G.push(Array(n.g));if(0>ha)for(m=0;m<-ha;++m)n.G.pop(),
  n.G.unshift(Array(n.g))}}yd(n);l|=r;c/=2;b/=2;e/=2;i/=2}l&&Ed(a);e=1;for(d=a.T;0<e&&d<=f-a.O;d++){g=e;c=a.v[d];b=0;if(0<c.la.length){e=Math.min(c.la.length,0<=e?1:0);for(i=0;i<e;i++){m=c;l=c.la.pop();if(!w(m.buffer)&&l.zoom==m.H&&(n=l.x-m.Ea,r=l.y-m.ha,t=1<<m.H,n=I(n,t),r=I(r,t),!(0>n||n>=m.g||0>r||r>=m.g))){t=m.aa.c;R=m.N.qa();t.bindTexture(t.TEXTURE_2D,m.buffer.S);ha=I(n+m.Ea,m.g)*R;R*=m.g-I(r+m.ha,m.g)-1;try{t.texSubImage2D(t.TEXTURE_2D,0,ha,R,t.RGBA,t.UNSIGNED_BYTE,Db(l)),m.G[r][n]=1}catch(se){m.N.Jb()&&
  (m.N.hc(m.aa.ab)||!(l.Ba&&0==l.Ba.src.lastIndexOf(m.aa.ab,0)))?zd(m,l.x,l.y,l.sa):m.aa.Pc()}}b++}}vd(c.kc);0<b&&(c.aa.c.bindTexture(c.aa.c.TEXTURE_2D,c.buffer.S),c.aa.c.generateMipmap(c.aa.c.TEXTURE_2D));e=g-b}}function Gd(a,b,c){return b>a.tb||b-c<a.O?Array(a.g*a.g):Ca(a.v[b-a.O-c].G)}function Hd(a,b,c){return b>a.tb||b-c<a.O?o:a.v[b-a.O-c].buffer.S}
  function Id(a,b,c){if(b>a.tb)return Array(2*c);for(var d=[],e=b-a.O;e>b-a.O-c;--e)d.push(Math.round(a.v[Math.max(0,e)].Ea),Math.round(a.v[Math.max(0,e)].ha));return d}function Ed(a){for(var b=Array(a.da.length),c=0;c<a.da.length;c++){var d=a.v[a.T+c],e=Jd(2*(0.5-d.ha/d.M)*Math.PI),f=Jd(2*(0.5-(d.ha+d.g)/d.M)*Math.PI);b[c]=new Xb(d.Pa?0:Jd(2*(0.5-(d.ha+d.g/2)/d.M)*Math.PI),d.Pa?0:2*((d.Ea+d.g/2)/d.M-0.5)*Math.PI,d.Pa?Math.PI/2:Math.abs(e-f),d.Pa?Math.PI:2*(d.g/d.M)*Math.PI,d.H)}a.N.Rc(b)};function Kd(a,b){this.a=a.a;this.d=a;this.D=b||new ac;this.J=new Dd(this.D,this.a,8,3,1,19);this.C=this.wa=o;if(this.Ia=p)this.Cb=new Yb("Terrain","http://srtm.webglearth.com/srtm/{z}/{x}/{y}.png",0,10,256),this.na=new Dd(this.Cb,this.a,2,3,this.Cb.ya(),this.Cb.pa());this.ea(this.D,k);this.Ja=1;this.Zb=[0,0];this.Tc=[new md(this.a,1,1,1),new md(this.a,4,4,16,k),new md(this.a,6,6,8,k),new md(this.a,8,8,8,k),new md(this.a,10,10,8),new md(this.a,64,64,this.Ia?8:4)];this.Dd=Ld(this,p);this.Ed=Ld(this,
  k);this.H=o;U(this.d.b,jd,this.pe,p,this)}s=Kd.prototype;s.ea=function(a,b,c){if(a)a.Kb=B(this.d.lc,this.d);if(c)if(this.wa=a)x(this.C)?this.C.ea(a):(this.J=new Dd(this.D,this.a,4,3,1,19),this.C=new Dd(this.wa,this.a,4,3,0,15));else{if(x(this.C))this.J=new Dd(this.D,this.a,8,3,1,19),this.C=o}else{if(!a)return;this.J.ea(a);this.D=a}b!==k&&(Yc(this.d),this.d.lc(),this.setZoom(this.getZoom()))};
  s.draw=function(){var a=this.a.c;this.Ja=1<<this.getZoom();var b=this.d.b.getPosition(),c=kd(this.d.b)||b;this.Zb[0]=Math.floor(b[1]/(2*Math.PI)*this.Ja);this.Zb[1]=H(Math.floor(Tb(b[0])/(2*Math.PI)*this.Ja),-this.Ja/2,this.Ja/2);Fd(this.J,c[0],c[1],b[0],b[1],Math.floor(this.getZoom()));this.C&&Fd(this.C,c[0],c[1],b[0],b[1],Math.floor(this.getZoom()));this.Ia&&Fd(this.na,c[0],c[1],b[0],b[1],Math.floor(this.getZoom())-5);c=Math.floor(this.getZoom());this.Ja=1<<c;b=this.C?this.Ed:this.Dd;a.useProgram(b.k);
  a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,Hd(this.J,c,0));a.uniform1i(b.$c,0);a.activeTexture(a.TEXTURE1);a.bindTexture(a.TEXTURE_2D,Hd(this.J,c,1));a.uniform1i(b.cd,1);a.activeTexture(a.TEXTURE2);a.bindTexture(a.TEXTURE_2D,Hd(this.J,c,2));a.uniform1i(b.fd,2);a.activeTexture(a.TEXTURE3);a.bindTexture(a.TEXTURE_2D,this.J.Xa.S);a.uniform1i(b.hd,3);a.uniform1fv(b.Gd,new Float32Array(Gd(this.J,c,0)));a.uniform1fv(b.Jd,new Float32Array(Gd(this.J,c,1)));a.uniform1fv(b.Md,new Float32Array(Gd(this.J,
  c,2)));a.uniform2fv(b.Ad,new Float32Array(Id(this.J,c,3)));this.C&&(a.activeTexture(a.TEXTURE4),a.bindTexture(a.TEXTURE_2D,Hd(this.C,c,0)),a.uniform1i(b.ad,4),a.activeTexture(a.TEXTURE5),a.bindTexture(a.TEXTURE_2D,Hd(this.C,c,1)),a.uniform1i(b.dd,5),a.activeTexture(a.TEXTURE6),a.bindTexture(a.TEXTURE_2D,Hd(this.C,c,2)),a.uniform1i(b.gd,6),a.uniform1fv(b.Hd,new Float32Array(Gd(this.C,c,0))),a.uniform1fv(b.Kd,new Float32Array(Gd(this.C,c,1))),a.uniform1fv(b.Nd,new Float32Array(Gd(this.C,c,2))),a.uniform2fv(b.Bd,
  new Float32Array(Id(this.C,c,3))),a.uniform1f(b.Od,this.wa.opacity));if(this.Ia){var d=H(c-5,2,this.Cb.pa());a.uniform1f(b.od,c-d);a.activeTexture(a.TEXTURE7);a.bindTexture(a.TEXTURE_2D,Hd(this.na,d,0));a.uniform1i(b.bd,7);a.activeTexture(a.TEXTURE8);a.bindTexture(a.TEXTURE_2D,Hd(this.na,d,1));a.uniform1i(b.ed,8);a.activeTexture(a.TEXTURE9);a.bindTexture(a.TEXTURE_2D,this.na.Xa.S);a.uniform1i(b.jd,9);a.uniform1fv(b.Id,new Float32Array(Gd(this.na,d,0)));a.uniform1fv(b.Ld,new Float32Array(Gd(this.na,
  d,1)));a.uniform2fv(b.Cd,new Float32Array(Id(this.na,d,2)))}d=new Float32Array(Ca(Mc(Zc(this.a)).gb()));c=this.Tc[Math.min(c,this.Tc.length-1)];a.bindBuffer(a.ARRAY_BUFFER,c.Fb);a.vertexAttribPointer(b.ib,c.Fb.Tb,a.FLOAT,p,0,0);a.bindBuffer(a.ARRAY_BUFFER,c.Db);a.vertexAttribPointer(b.Wc,c.Db.Tb,a.FLOAT,p,0,0);a.uniformMatrix4fv(b.Qd,p,d);a.uniform1f(b.le,this.Ja);a.uniform2fv(b.Ud,new Float32Array(this.Zb));a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c.Ac);a.drawElements(a.TRIANGLES,c.Sd,a.UNSIGNED_SHORT,
  0)};
  function Ld(a,b){var c=a.a.c,d=bd("earth-fs"+(b?"-overlay":"")+".glsl"),e=bd("earth-vs"+(b?"-overlay":"")+".glsl"),e=e.replace("%TERRAIN_BOOL%",a.Ia?"1":"0");a.Ia&&(e=e.replace("%BUFFER_SIDE_T_FLOAT%",a.na.g.toFixed(1)));var d=$c(a.a,d,c.FRAGMENT_SHADER),e=$c(a.a,e,c.VERTEX_SHADER),f=c.createProgram();w(f)&&h(Error("Unknown"));c.attachShader(f,e);c.attachShader(f,d);c.bindAttribLocation(f,0,"aVertexPosition");c.linkProgram(f);c.getProgramParameter(f,c.LINK_STATUS)||h(Error("Shader program err: "+c.getProgramInfoLog(f)));
  return new od(f,a.a,b,a.Ia)}s.setZoom=function(a){this.H=H(a,this.D.ya(),this.D.pa());id(this.d.b,Md(this,this.H,this.d.b.V))};s.pe=function(){this.H=o};s.getZoom=function(){w(this.H)&&Nd(this);return this.H};function Nd(a,b){var c=a.d.b,c=Math.log(2*Math.cos(Math.abs(c.V))*Math.PI/(2*(c.B/6378137)*Math.tan(a.a.xa/2)/a.d.Eb))/Math.LN2;if(b)return c;a.H=H(c,a.D.ya(),a.D.pa());return a.H}
  function Md(a,b,c){return 6378137*1/Math.tan(a.a.xa/2)*(2*Math.cos(Math.abs(c))*Math.PI/Math.pow(2,b)*a.d.Eb/2)}function Od(a,b,c,d){var e=Math.sin((c-a)/2),b=Math.sin((d-b)/2);return 6378137*2*Math.asin(Math.sqrt(e*e+Math.cos(a)*Math.cos(c)*b*b))};function Pd(a,b,c){this.x=v(a)?a:0;this.y=v(b)?b:0;this.j=v(c)?c:0}Pd.prototype.Ma=function(){return new Pd(this.x,this.y,this.j)};Pd.prototype.gb=function(){return[this.x,this.y,this.j]};function Qd(a,b,c){this.x=a;this.y=b;this.j=c}E(Qd,Pd);s=Qd.prototype;s.Ma=function(){return new Qd(this.x,this.y,this.j)};s.scale=function(a){this.x*=a;this.y*=a;this.j*=a;return this};s.normalize=function(){return this.scale(1/Math.sqrt(this.x*this.x+this.y*this.y+this.j*this.j))};s.add=function(a){this.x+=a.x;this.y+=a.y;this.j+=a.j;return this};s.jc=function(a){this.x-=a.x;this.y-=a.y;this.j-=a.j;return this};s.equals=function(a){return this==a||!!a&&this.x==a.x&&this.y==a.y&&this.j==a.j};function Rd(a,b,c,d,e,f){if(w(d))return o;a=d.multiply(new W([[2*(a/e)-1],[1-2*b/f],[2*c-1],[1]]));if(0==X(a,3,0))return o;a=a.multiply(1/X(a,3,0));return new Qd(X(a,0,0),X(a,1,0),X(a,2,0))};function Sd(a,b,c,d,e,f,g){this.a=a;this.Bc=b||o;this.ua=c||document.createElement("div");if(!v(c))a=this.a.canvas,a.parentNode&&a.parentNode.insertBefore(this.ua,a.nextSibling);this.hb=d||document.createElement("img");if(!v(d))d=this.ua,d.parentNode&&d.parentNode.insertBefore(this.hb,d.nextSibling);this.Zc=f||o;this.b=new ed(this);this.r=new Kd(this,e);this.zc=g===k?o:new cd(this);this.Eb=0;Yc(this);this.lc()}
  Sd.prototype.lc=function(){if(!w(this.ua)){for(var a=this.ua,b;b=a.firstChild;)a.removeChild(b);P(this.ua,this.Zc);this.r.D.va(this.ua);this.r.wa&&(P(this.ua,O("br"),O("strong",{},"Overlay data:"),O("br")),this.r.wa.va(this.ua))}if(!w(this.hb))w(this.r.D.pb())?this.hb.style.visibility="hidden":(this.hb.src=this.r.D.pb(),this.hb.style.visibility="visible")};function Yc(a){a.Eb=0.7*a.a.canvas.height/a.r.D.qa()}
  Sd.prototype.draw=function(){var a=this.a.c;if(!w(this.Bc)){for(var b=this.Bc,c=K(this.b.V).toFixed(4)+"; "+K(this.b.ba).toFixed(4)+" @ "+this.b.B.toFixed(0)+"m -> z="+this.r.getZoom().toFixed(3)+"; ",d=this.r,e=d.J,f="",g=0;g<e.v.length;++g)f+=g+e.O+":"+e.v[g].la.length+" ";e="BufferQueue size: "+f+"; Loading tiles: "+d.D.W;d.wa&&(e+=" + "+d.wa.W);b.innerHTML=c+e}b=this.b.B/6378137;c=this.a;c.kb=0.25*b;c.jb=1+b;Xc(c);if(this.zc)a.enable(a.BLEND),a.disable(a.DEPTH_TEST),b=Math.sin((Math.PI-this.a.xa)/
  2),c=Math.sin(this.a.xa/2),this.a.I.F=Ic(4),Sc(this.a.I,-this.b.getTilt()),this.a.I.translate(0,0,c-1-this.b.B/6378137),this.a.I.scale(b,b,b),this.zc.draw(),a.disable(a.BLEND),a.enable(a.DEPTH_TEST);this.a.I.F=Ic(4);Tc(this.a.I,-this.b.yb);Sc(this.a.I,-this.b.getTilt());Tc(this.a.I,-this.b.getHeading());this.a.I.translate(0,0,-1-this.b.B/6378137);Sc(this.a.I,this.b.V);a=this.a.I;c=-this.b.ba;b=Math.cos(c);c=Math.sin(c);a.F=a.F.multiply(new W([[b,0,c,0],[0,1,0,0],[-c,0,b,0],[0,0,0,1]]));this.r.draw()};
  function Td(a,b){var c=a.Ma();c.x=-c.x;c.y=-c.y;c.j=-c.j;var d=b.x*c.x+b.y*c.y+b.j*c.j,e=d*d-(c.x*c.x+c.y*c.y+c.j*c.j)+1;if(0>e)return o;c=Math.min(d+Math.sqrt(e),d-Math.sqrt(e));d=Math.max(d+Math.sqrt(e),d-Math.sqrt(e));return[c,d]}
  function ld(a,b,c,d){var e=Rd(b,c,0,a.a.vb,a.a.$,a.a.Z),a=Rd(b,c,1,a.a.vb,a.a.$,a.a.Z);if(w(e)||w(a))return o;a.jc(e);a.normalize();b=Td(e,a);if(w(b))return o;a=a.scale(b[0]);e=new Qd(e.x+a.x,e.y+a.y,e.j+a.j);a=Math.asin(e.x/Math.sqrt(1-e.y*e.y));0>e.j&&(a=Math.PI-a);return d==k?[Math.asin(e.y),Ea(a)]:[K(Math.asin(e.y)),K(Ea(a))]}function Tb(a){return Math.log(Math.tan(a/2+Math.PI/4))}function Jd(a){return 2*Math.atan(Math.exp(a))-Math.PI/2};function Ud(a,b,c){this.lat=a;this.sb=b;this.element=c;this.parentElement=o;this.enabled=k;this.visible=p}Ud.prototype.detach=function(){if(this.parentElement){var a=this.element;a&&a.parentNode&&a.parentNode.removeChild(a);this.parentElement=o}};Ud.prototype.enable=function(a){(this.enabled=a||p)||this.show(p)};Ud.prototype.isEnabled=q("enabled");Ud.prototype.show=function(a){this.visible=a==k;this.element.style.display=this.visible?"block":"none"};function Vd(a,b,c,d,e){var f=O("div",{"class":"we-pm-icon"});if(z(c))f.style.backgroundImage="url("+c+")";this.Ta=d||25;this.Aa=e||41;f.style.width=this.Ta.toFixed(0)+"px";f.style.height=this.Aa.toFixed(0)+"px";f.style.marginLeft=(-this.Ta/2).toFixed(0)+"px";f.style.marginTop=(-this.Aa).toFixed(0)+"px";c=O("div",{style:"position:absolute;"},f);Ud.call(this,a,b,c);this.u=o;this.show(p);this.Ab(p);f.onclick=B(this.Ab,this,k)}E(Vd,Ud);Vd.prototype.Ab=function(a){this.u&&this.u.show(a)};Fa(".we-pm-icon{position:absolute;z-index:64;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFtklEQVR42p3Wa0xTZxgH8CYkS5aQLGFxcXNZNNu4FIFCK9eCWOQm3lDizLYP+zTnxLk5wQpICxRaLuWi3FpQFMU55xDkjiBTFMeA9Zy2JzMxWUZisoS4TyRuQvG/pydQKb3Q2uSXw3nf93n+5z2nLRVIiga88RERL/MlAgDrosJ+d/zISTJMEFt2B9LyEV5kySBo7G+iI9vdhyj7nfEhcjKfUvcAma0z+Pwa5+BwuxG7myaRUH4XtHaAhLgI6VvLjwwn14zj0CUWn13lkHXZhPQWBml6e3svGq3zvIyGX0F1z0mWQ4hY0buaH3mcUvsAn17hcKDNhFQdsy4K5Nfv108jsXIM1OOoqxAfMppMAYepIF3PIrmZ8cqhy2ZkXjBYQyxE9iqksGeFXKa9h0PtHF0di6Qmxhk+fKeLOcLX72r8DdRvjvjxIRGFt638yPz+Vha7W0zY0cDYydAbkXWJ4+1rYWx/H2gzO6wl/JysehzUUw0+5Oxtq+zEyns42MYhsZ6xQ2N0C0yQae9DouhFZt1dOvYgnt5RGU3T/Dw1tqtJ1xn5Gur7D/ERRBR0W43vapzhd5FwnrHZ02Kmt+jvkBTeRsOdPzD/7wJWXkPGp0hSD2BnzUMcuMjZ1RF+LFY1BOotFYQXdPkSy/5WDvF1DKSr8GOau7g1/RecvWafzSOuuBf79CYkNxodandox0G9VYLw/FvCSGUf9rZQci1js6PeiPRGAw7WjTgNePnyJa9mgJ5h1QPsWVOf0kTBdZOg/p0CUV6nNKp4ALv1HKJrGJu0Znqo1RNQds64DLBYLBjjniK6ZMihXtZgRPK5KVD/UYHozM+R1p1k6DhEaRmblAYK0U4g/8aUy4DFxUUMMLOIUQ071CfVm5BUOwnq30shNzeJC7qwq5nDtirGJq6GRWoDixR1HxYsS3YhS0tLWFhY4OVdf4TEqgmkNprt6ukiafwhqL9OECb/yYfMpzaaEKllIa5kbNKa6D6XjqK632i3C9oBH3DPPIttyn5+XUy1Y22cegzUO18QdvqGVWdC5SNK5xBezqyg3dB9pW1Hl4wgu20cM3/O4b+FRTx++gwNgywkeTfhrE5cwfBj4oJuUG+hIDT3RyuZpLAXO+s5hGkYOzHVRn5cWv4Q4rM91iJE5HchpnQMsjrWWY1tPfUd5j/xoTnXV0zEV05Cds6MUDVjR6RhkXSecxBTbXJYG0ZojnbRA+opXQ75YUWmpLCfro7D1lLmdfH1Us0EqN+o7Vs45NS1FT7kSXzVDGK1ZghVzGtJpJAI2gX1Sn4V8n3HakcliiEk1HIILGG8FldtRqxmEtRn2u6f1taTHau9SebitCzCNUb4FzNekdZwCC/oA/XIsg/57upaKrFiBHFaDh8rGY9FVZgRrZ4C1T8mPnYhwd9eWWsDeR5TaUKwyogPFYxHYqo4iPL7QbVf8M3tQ9qd0UUoxhBdyWFLIbOucLUJkeoZUN0secMx5MRlZwKIhW4BXSWLzWcZt6IqrLsYBNWccPq7S/jNJVe6wxX3sU1jxgf5BpeExUZIygyg9XPE13nI8TZXtm89dRNiCnk/z+AKPx+aNwhaX+jyZ2pQ9kV3JkTKRxCVmrDpjMGBv4JFRBkLWjdP3nITcsGdT4JzuiAqM+NduWEtfjzkzBBoXQXf0GXIsVZ3fMiTsKIpBBYZsfG0wWZzAQuRygSaf0E2ug0J/LplPdnBOT0IVZnxTq5hBX8eLB8Gzev4Zu5D9OvxJXMhRQZsoavfkEPPQ84gpMQEGreQLeuGBBzVe0IVlDuA4GIz3j5l4I9B8hHQeIfbAFvIVzpPbCQvhEoT3pOzEBaZEZh9BTQW4mFIs6d0gbl3EKSkAPkY6LyXCDwLOdLsKWHAsXYEKswIOH4NdC4lnoX4H2nyRnfA6THQ8Zflcw9Dvmz0xnb/7A7QMW353OMQb7USgTch/wNGSWfRl/HE1wAAAABJRU5ErkJggg==);}");function Wd(a,b){this.f=a;this.Nb=b;this.Yb=new Kb}
  Wd.prototype.oe=function(a){a=this.Yb.get(a);if(a.isEnabled()){var b;a:{var c=this.f;b=a.lat;var d=a.sb;b=J(b);var d=J(d),e=Math.cos(b),e=new Qd(Math.sin(d)*e,Math.sin(b),Math.cos(d)*e),d=c.a.ub.multiply(new W([[e.x],[e.y],[e.j],[1]]));if(0==X(d,3,0))b=o;else{d=d.multiply(1/X(d,3,0));b=(X(d,0,0)+1)/2*c.a.$;var d=(X(d,1,0)-1)/-2*c.a.Z,f=1;if(0>b||b>c.a.$||0>d||d>c.a.Z)f=0;else{c=Rd(0.5,0.5,0,c.a.vb,1,1);if(w(c)){b=o;break a}var f=e.x-c.x,g=e.y-c.y,i=e.j-c.j,f=Math.sqrt(f*f+g*g+i*i),e=e.jc(c).normalize(),
  e=Td(c,e),f=w(e)?0:Math.abs(f-e[0])<Math.abs(f-e[1])?1:0}b=[b,d,f]}}x(b)?(d=b[1],a.element.style.left=b[0].toFixed()+"px",a.element.style.top=d.toFixed()+"px",a.enabled&&a.show(k),a.show(0<b[2])):a.show(p)}};var Ma={},Xd=o;function Yd(a){a=A(a);delete Ma[a];La()&&Xd&&(qd.clearTimeout(Xd),Xd=o)}function Zd(){Xd||(Xd=sd(function(){Xd=o;$d()}))}function $d(){var a=C();Ia(Ma,function(b){ae(b,a)});La()||Zd()};function be(){this.l=Z;this.oa=this.startTime=o}E(be,dd);var Z=0;function ce(a){a.q("end")}be.prototype.q=function(a){this.dispatchEvent(a)};function de(a,b,c,d){be.call(this);(!da(a)||!da(b))&&h(Error("Start and end parameters must be arrays"));a.length!=b.length&&h(Error("Start and end points must be the same length"));this.eb=a;this.qd=b;this.duration=c;this.oc=d;this.coords=[]}E(de,be);s=de.prototype;s.xc=0;s.Q=0;s.Ub=o;
  s.play=function(a){if(a||this.l==Z)this.Q=0,this.coords=this.eb;else if(1==this.l)return p;Yd(this);this.startTime=a=C();-1==this.l&&(this.startTime-=this.duration*this.Q);this.oa=this.startTime+this.duration;this.Ub=this.startTime;this.Q||this.q("begin");this.q("play");-1==this.l&&this.q("resume");this.l=1;var b=A(this);b in Ma||(Ma[b]=this);Zd();ae(this,a);return k};s.stop=function(a){Yd(this);this.l=Z;if(a)this.Q=1;ee(this,this.Q);this.q("stop");ce(this)};
  s.A=function(){this.l==Z||this.stop(p);this.q("destroy");de.ta.A.call(this)};function ae(a,b){a.Q=(b-a.startTime)/(a.oa-a.startTime);if(1<=a.Q)a.Q=1;a.xc=1E3/(b-a.Ub);a.Ub=b;ee(a,a.Q);1==a.Q?(a.l=Z,Yd(a),a.q("finish"),ce(a)):1==a.l&&a.q("animate")}function ee(a,b){fa(a.oc)&&(b=a.oc(b));a.coords=Array(a.eb.length);for(var c=0;c<a.eb.length;c++)a.coords[c]=(a.qd[c]-a.eb[c])*b+a.eb[c]}s.q=function(a){this.dispatchEvent(new fe(a,this))};
  function fe(a,b){S.call(this,a);this.coords=b.coords;this.x=b.coords[0];this.y=b.coords[1];this.j=b.coords[2];this.duration=b.duration;this.Q=b.Q;this.ue=b.xc;this.state=b.l;this.se=b}E(fe,S);function ge(a){this.Nb=a;this.o=U(this.Nb,Za?"DOMMouseScroll":"mousewheel",this)}E(ge,dd);
  ge.prototype.handleEvent=function(a){var b=0,c=0,d=0,a=a.Qa;if("mousewheel"==a.type){c=1;if(L||M&&(bb||N("532.0")))c=40;d=M&&Ta&&0!=-a.wheelDelta%c?-a.wheelDelta:-a.wheelDelta/c;v(a.wheelDeltaX)?(b=M&&Ta&&0!=-a.wheelDeltaX%c?-a.wheelDeltaX:-a.wheelDeltaX/c,c=M&&Ta&&0!=-a.wheelDeltaY%c?-a.wheelDeltaY:-a.wheelDeltaY/c):c=d}else d=a.detail,100<d?d=3:-100>d&&(d=-3),v(a.axis)&&a.axis===a.HORIZONTAL_AXIS?b=d:c=d;ea(this.Fc)&&(b=H(b,-this.Fc,this.Fc));ea(this.Gc)&&(c=H(c,-this.Gc,this.Gc));b=new he(d,a,
  b,c);try{this.dispatchEvent(b)}finally{b.z()}};ge.prototype.A=function(){ge.ta.A.call(this);V(this.o);delete this.o};function he(a,b,c,d){b&&this.Wa(b,j);this.type="mousewheel";this.detail=a;this.te=c;this.vc=d}E(he,uc);function ie(a){this.f=a;this.Lc=new ge(a.a.canvas);this.o=U(this.Lc,"mousewheel",function(a){this.H(-(0==a.vc?0:0>a.vc?-1:1));a.preventDefault()},p,this);this.nd=U(a.a.canvas,"dblclick",B(function(a){id(this.b,this.b.B/2);var c=ld(this,a.offsetX,a.offsetY,k)||kd(this.b);if(c){var d=(this.b.ba+c[1])/2;Math.abs(this.b.ba-c[1])>Math.PI&&(d+=Math.PI);this.b.setPosition((this.b.V+c[0])/2,d)}a.preventDefault()},a));this.be=U(a.a.canvas,"mouseup",B(function(a){if(wc(a,2)){id(this.b,2*this.b.B);var c=ld(this,
  a.offsetX,a.offsetY,k)||kd(this.b);c&&this.b.setPosition(2*this.b.V-c[0],2*this.b.ba-c[1]);a.preventDefault()}},a));this.Rd=U(a.a.canvas,"contextmenu",function(a){a.preventDefault()});this.m=o;this.Ha=this.Ga=0}E(ie,zb);
  ie.prototype.H=function(a){var b=120,a=-1*a;if(this.m){if(this.Ha>this.Ga==0<a)return;this.m.z();this.m=o;b*=(this.f.b.B-this.Ga)/(this.Ha-this.Ga);a=this.Ha;this.Ha=this.Ga;this.Ga=a}else this.Ga=this.f.b.B,this.Ha=H(this.Ga*Math.pow(2,a),250,1E7);if(!(isNaN(b)||0>=b)){var a=this.f.b.getPosition(),c=kd(this.f.b)||a,d=this.Ha/this.f.b.B;a.push(this.f.b.B);this.m=new de(a,[c[0]+d*(a[0]-c[0]),c[1]+d*(a[1]-c[1]),this.Ha],b);U(this.m,["animate","finish"],function(a){this.f.b.setPosition(a.x,a.y);id(this.f.b,
  a.j)},p,this);U(this.m,["finish"],this.rd,p,this);this.m.play(p)}};ie.prototype.rd=function(){if(this.m)this.m.z(),this.m=o};ie.prototype.A=function(){V(this.o);V(this.nd);V(this.be);V(this.Rd);this.Lc.z();this.m.z()};function je(){be.call(this);this.p=[]}E(je,be);je.prototype.add=function(a){0<=ta(this.p,a)||(this.p.push(a),U(a,"finish",this.$b,p,this))};je.prototype.remove=function(a){wa(this.p,a)&&Cc(a,"finish",this.$b,p,this)};je.prototype.A=function(){G(this.p,function(a){a.z()});this.p.length=0;je.ta.A.call(this)};function ke(){je.call(this);this.Pb=0}E(ke,je);
  ke.prototype.play=function(a){if(0==this.p.length)return p;if(a||this.l==Z)this.Pb=0,this.q("begin");else if(1==this.l)return p;this.q("play");-1==this.l&&this.q("resume");var b=-1==this.l&&!a;this.startTime=C();this.oa=o;this.l=1;G(this.p,function(c){(!b||-1==c.l)&&c.play(a)});return k};ke.prototype.stop=function(a){G(this.p,function(b){b.l==Z||b.stop(a)});this.l=Z;this.oa=C();this.q("stop");ce(this)};
  ke.prototype.$b=function(){this.Pb++;if(this.Pb==this.p.length)this.oa=C(),this.l=Z,this.q("finish"),ce(this)};function le(){je.call(this);this.U=0}E(le,je);le.prototype.play=function(a){if(0==this.p.length)return p;if(a||this.l==Z)this.U<this.p.length&&this.p[this.U].l!=Z&&this.p[this.U].stop(p),this.U=0,this.q("begin");else if(1==this.l)return p;this.q("play");-1==this.l&&this.q("resume");this.startTime=C();this.oa=o;this.l=1;this.p[this.U].play(a);return k};
  le.prototype.stop=function(a){this.l=Z;this.oa=C();if(a)for(a=this.U;a<this.p.length;++a){var b=this.p[a];b.l==Z&&b.play();b.l==Z||b.stop(k)}else this.U<this.p.length&&this.p[this.U].stop(p);this.q("stop");ce(this)};le.prototype.$b=function(){if(1==this.l)this.U++,this.U<this.p.length?this.p[this.U].play():(this.oa=C(),this.l=Z,this.q("finish"),ce(this))};function me(a){this.ma=a;this.m=o;this.Bb=[];this.nb=[]}
  function ne(a,b,c,d,e,f){function g(a){var b=a*a,a=a*a*a;return 6*a*b+-15*b*b+10*a}x(a.m)&&a.ac();a.m=new ke;var i=a.ma.getPosition();a.Bb=[0,0,a.ma.getHeading(),a.ma.getTilt()];a.nb=[0,0,0,0];oe(a,i[0],i[1],b,c);var l=["begin","animate","end"],m=new de(a.Bb,a.nb,e,g);U(m,l,a.Wd,p,a);a.m.add(m);if(f)c=Od(i[0],i[1],b,c),b=a.ma.B,c=Math.min(b,f)+c*d,c=Math.max(Math.max(b,f),c),d=new de([b],[c],e/2,g),e=new de([c],[f],e/2,g),U(d,l,a.Oc,p,a),U(e,l,a.Oc,p,a),l=new le,l.add(d),l.add(e),a.m.add(l);U(a.m,
  "end",a.ac,p,a);a.m.play()}function oe(a,b,c,d,e){var c=I(c,2*Math.PI),e=I(e,2*Math.PI),f=c-e;f<-Math.PI?c+=2*Math.PI:f>Math.PI&&(e+=2*Math.PI);a.Bb[0]=b;a.Bb[1]=c;a.nb[0]=d;a.nb[1]=e}me.prototype.Wd=function(a){this.ma.setPosition(a.coords[0],a.coords[1]);this.ma.setHeading(a.coords[2]);this.ma.setTilt(a.coords[3])};me.prototype.Oc=function(a){id(this.ma,a.coords[0])};me.prototype.ac=function(){if(x(this.m))this.m.z(),this.m=o};me.prototype.cancel=function(){this.ac()};function pe(a,b){this.f=a;this.ia=j;this.L=this.K=this.Sc=0;this.o=o;U(this.f.a.canvas,"mousedown",B(this.bc,this));U(tb(this.f.a.canvas),"mouseup",B(this.dc,this));this.w=b||o}
  pe.prototype.bc=function(a){if(!wc(a,2)&&!a.ctrlKey&&!a.altKey){x(this.w)&&this.w.cancel();this.K=a.screenX;this.L=a.screenY;if(wc(a,1)||wc(a,0)&&a.shiftKey)if(this.ia=kd(this.f.b),x(this.ia)){if(window.Va)window.Va.lat=K(this.ia[0]),window.Va.sb=K(this.ia[1]),window.Va.enable(k);this.Sc=0==this.f.b.getTilt()?this.f.b.B:6378137*(Math.sin(Math.PI-this.f.b.getTilt()-(Math.PI-Math.asin((1+this.f.b.B/6378137)*Math.sin(this.f.b.getTilt()))))/Math.sin(this.f.b.getTilt()))}if(!w(this.o))V(this.o),this.o=
  o;this.o=U(tb(this.f.a.canvas),"mousemove",B(this.cc,this));a.preventDefault()}};pe.prototype.dc=function(a){a.preventDefault();this.ia=j;window.Va&&window.Va.enable(p);if(!w(this.o))V(this.o),this.o=o};
  pe.prototype.zb=function(a,b){if(v(this.ia)){var c=-2*a/this.f.a.canvas.width*Math.PI,d=b/this.f.a.canvas.height*Math.PI/2;if(w(this.ia))this.f.b.setHeading(this.f.b.getHeading()+c),this.f.b.setTilt(this.f.b.getTilt()+d);else{var e=this.f.b,f=this.ia[0],g=this.ia[1],i=this.Sc;e.za+=c;c=Math.asin(6378137/Math.sqrt(i*i+40680631590769));e.ka=H(e.ka+d,-c,c);d=Math.asin(i/6378137*Math.sin(e.ka));1.0E-4>Math.abs(e.ka)?id(e,i):id(e,6378137*(Math.sin(Math.PI-e.ka-d)/Math.sin(e.ka)-1));f-=Math.cos(e.za)*d;
  e.setPosition(f,g+Math.sin(e.za)*d/Math.cos(f))}}};pe.prototype.cc=function(a){this.zb(a.screenX-this.K,a.screenY-this.L);this.K=a.screenX;this.L=a.screenY;a.preventDefault()};function qe(a){return 1-Math.pow(1-a,3)};function re(a,b){this.f=a;this.Mb=p;this.xb=this.wb=this.L=this.K=0;this.Ca=this.o=o;U(this.f.a.canvas,"mousedown",B(this.bc,this));U(tb(this.f.a.canvas),"mouseup",B(this.dc,this));this.w=b||o}s=re.prototype;s.bc=function(a){if(wc(a,0)&&!a.ctrlKey&&!a.altKey){x(this.w)&&this.w.cancel();if(this.Ca)this.Ca.stop(p),this.Ca.z(),this.Ca=o;this.Mb=k;this.wb=this.K=a.screenX;this.xb=this.L=a.screenY;if(!w(this.o))V(this.o),this.o=o;this.o=U(tb(this.f.a.canvas),"mousemove",B(this.cc,this));a.preventDefault()}};
  s.dc=function(a){if(this.Mb){a.preventDefault();this.Mb=p;if(!w(this.o))V(this.o),this.o=o;if(wc(a,0)){var b=a.screenX-this.wb,c=a.screenY-this.xb,a=Math.sqrt(Math.pow(b,2)+Math.pow(c,2)),b=b/a,c=c/a;this.K==this.wb&&this.L==this.xb&&(a*=2);if(6<a)a=6*Math.max(15,a),this.Ca=new de([this.K,this.L],[this.K+a*b,this.L+a*c],1300,qe),U(this.Ca,["animate"],this.wd,p,this),this.Ca.play(p)}}};
  s.zb=function(a,b){var c=Math.PI*(1/this.f.a.canvas.height)*(this.f.Eb/Math.pow(2,Nd(this.f.r,k)));hd(this.f.b,b*c,-2*a*c)};s.cc=function(a){this.zb(a.screenX-this.K,a.screenY-this.L);this.wb=this.K;this.xb=this.L;this.K=a.screenX;this.L=a.screenY;a.preventDefault()};s.wd=function(a){this.zb(a.x-this.K,a.y-this.L);this.K=a.x;this.L=a.y};function $(a,b){var c=b||{},d=z(a)?document.getElementById(a):a;if(!w(d)){var e=O("canvas",{style:"width:100%;height:100%;"});this.a=new Uc(e,o,function(){var a=O("a",{style:"font-size:110%;display:block;width:100%;top:50%;position:relative;text-align:center;color:#800000;text-shadow:rgba(0,0,0,0.4) 0 0 6px;",href:"http://www.webglearth.com/upgrade.html"},"You need a WebGL-enabled browser to run this application.");P(d,a)});if(x(this.a)){Vc(this.a);var f=O("div",{style:"width:100%;height:100%;position:relative;"});
  P(d,f);P(f,e);mc("mapquest");mc("osm");this.Dc=new pd(15);U(this.Dc,rd,B(function(){var a=this.a,b=a.c;b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);a.I.F=Ic(4);a.d.draw();a=this.Ec;G(a.Yb.ob(),a.oe,a)},this));var e=O("img",{style:"position:absolute;bottom:0;right:0"}),g=O("div",{style:"position:absolute;bottom:5px;left:5px;width:75%;font-size:8px;text-align:justify;color:#fff;font-family:Verdana,Arial;text-shadow:rgba(0,0,0,0.8) 0 0 4px;"});P(f,e);P(f,g);this.a.d=new Sd(this.a,j,g,e,x(c.map)?nc(c.map).La:
  j,O("p",o,"Powered by ",O("a",{href:"http://www.webglearth.org/",style:"color:#00f"},"WebGL Earth"),"."),c.atmosphere===p);this.Ec=new Wd(this.a.d,f);f=c.position;e=c.center;x(f)&&1<f.length?this.a.d.b.setPosition(J(f[0]),J(f[1])):x(e)&&1<e.length&&this.a.d.b.setPosition(J(e[0]),J(e[1]));f=c.zoom;x(f)&&this.a.d.r.setZoom(f);f=c.altitude;x(f)&&id(this.a.d.b,f);f=c.proxyHost;if(z(f))this.a.ab=f;this.w=new me(this.a.d.b);this.$d=o;if(c.panning!==p)this.$d=new re(this.a.d,this.w);this.ne=o;if(c.tilting!==
  p)this.ne=new pe(this.a.d,this.w);this.re=o;if(c.zooming!==p)this.re=new ie(this.a.d);this.a.bb();this.Dc.start()}}}s=$.prototype;s.setMap=function(a,b){var c=nc(a,b);x(c)&&this.a.d.r.ea(c.La)};s.ce=function(a){this.a.d.r.ea(a.La)};s.ee=function(a){this.a.d.r.ea(x(a)?a.La:o,p,k)};s.nc=function(a){return B(function(b){var c=ld(this.a.d,b.offsetX,b.offsetY);b.target=this;b.latitude=x(c)?c[0]:o;b.longitude=x(c)?c[1]:o;a(b)},this)};
  s.Vd=function(a,b){var c=U(this.a.canvas,a,this.nc(b));return b[A(this)+"___eventKey_"+a]=c};s.Nc=function(a,b){if(x(b)){var c=b[A(this)+"___eventKey_"+a];x(c)&&V(c)}else z(a)||V(a)};s.Td=function(a){Ec(this.a.canvas,a)};s.xd=function(a,b,c,d,e){a=new Vd(a,b,c,d,e);b=this.Ec;c=sa();d=b.Nb;a.parentElement&&a.detach();a.parentElement=d;a.parentElement.appendChild(a.element);b.Yb.set(c,a);return a};D("WebGLEarth",$);D("WebGLEarth.prototype.setCenter",function(a){this.w.cancel();this.a.d.b.setPosition(J(a[0]),J(a[1]));this.a.d.b.setTilt(0)});D("WebGLEarth.prototype.getCenter",function(){return[K(this.a.d.b.V),K(this.a.d.b.ba)]});D("WebGLEarth.prototype.setPosition",function(a,b,c){this.w.cancel();this.a.d.b.setPosition(J(a),J(b));x(c)&&this.a.d.r.setZoom(c)});D("WebGLEarth.prototype.getPosition",function(){return[K(this.a.d.b.V),K(this.a.d.b.ba)]});
  D("WebGLEarth.prototype.setAltitude",function(a){this.w.cancel();id(this.a.d.b,a)});D("WebGLEarth.prototype.getAltitude",function(){return this.a.d.b.B});D("WebGLEarth.prototype.setHeading",function(a){this.w.cancel();this.a.d.b.setHeading(J(a))});D("WebGLEarth.prototype.getHeading",function(){return K(this.a.d.b.getHeading())});D("WebGLEarth.prototype.setTilt",function(a){this.w.cancel();this.a.d.b.setTilt(J(a))});D("WebGLEarth.prototype.getTilt",function(){return K(this.a.d.b.getTilt())});
  D("WebGLEarth.prototype.setRoll",function(a){this.w.cancel();this.a.d.b.yb=J(a)});D("WebGLEarth.prototype.getRoll",function(){return K(this.a.d.b.yb)});D("WebGLEarth.prototype.setZoom",function(a){this.w.cancel();this.a.d.r.setZoom(a)});D("WebGLEarth.prototype.getZoom",function(){return this.a.d.r.getZoom()});D("WebGLEarth.prototype.flyTo",function(a,b,c,d,e){ne(this.w,J(a),J(b),c,d,e)});
  D("WebGLEarth.prototype.flyToFitBounds",function(a,b,c,d){var a=J(a),b=J(b),c=J(c),d=J(d),e;e=this.a.xa;var f=(a+b)/2,f=Od(f,c,f,d),g=Od(a,0,b,0),i=Math.min(Math.max(this.a.Ua,f/g),1);e=J(K(e)/(i+0.4)-2);f=Math.max(g,f);f=Math.min(Math.PI/2,e+f/12756274);e=9567205.5*(Math.sin(f)*Math.sqrt(1+1/Math.pow(Math.tan(e),2))-1);c=I(c,2*Math.PI);d=I(d,2*Math.PI);f=c-d;f<-Math.PI?c+=2*Math.PI:f>Math.PI&&(d+=2*Math.PI);a=[(a+b)/2,(c+d)/2];ne(this.w,a[0],a[1],Math.max(e,Md(this.a.d.r,this.a.d.r.D.pa()+0.1,a[0])))});
  D("WebGLEarth.prototype.handleResize",function(){return this.a.bb()});D("WebGLEarth.Maps",{MAPQUEST:"mapquest",OSM:"osm",BING:"bing",WMS:"wms",GOOGLE:"gooogle",CUSTOM:"custom"});D("WebGLEarth.prototype.initMap",mc);D("WebGLEarth.prototype.setMap",$.prototype.setMap);D("WebGLEarth.prototype.setBaseMap",$.prototype.ce);D("WebGLEarth.prototype.setOverlayMap",$.prototype.ee);D("WebGLEarth.prototype.on",$.prototype.Vd);D("WebGLEarth.prototype.off",$.prototype.Nc);D("WebGLEarth.prototype.offAll",$.prototype.Td);
  D("WebGLEarth.prototype.initMarker",$.prototype.xd);D("WebGLEarth.Map",$b);D("WebGLEarth.Map.prototype.setBoundingBox",$b.prototype.gc);D("WebGLEarth.Map.prototype.setOpacity",$b.prototype.de);D("WebGLEarth.Map.prototype.getOpacity",$b.prototype.ud);D("WebGLEarth.Marker",Vd);D("WebGLEarth.Marker.prototype.setPosition",function(a,b){this.lat=a;this.sb=b});
  D("WebGLEarth.Marker.prototype.bindPopup",function(a,b,c){a=new ub(a,b,c);if(this.u)(b=this.u.u)&&b.parentNode&&b.parentNode.removeChild(b);this.u=a;this.element.appendChild(this.u.u);a.u.style.bottom=this.Aa.toFixed(0)+"px";return this});D("WebGLEarth.Marker.prototype.openPopup",function(){this.Ab(k)});D("WebGLEarth.Marker.prototype.closePopup",function(){this.Ab(p)});Vd.prototype.nc=function(a){return B(function(b){b.target=this;b.latitude=this.lat;b.longitude=this.sb;a(b)},this)};
  D("WebGLEarth.Marker.prototype.on",function(a,b){var c=U(this.element,a,this.nc(b));return b[A(this)+"___eventKey_"+a]=c});D("WebGLEarth.Marker.prototype.off",$.prototype.Nc);D("WebGLEarth.Marker.prototype.offAll",function(a){Ec(this.element,a)});
  
  
  });