!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Custom=t()}(function(){return function i(a,n,s){function o(e,t){if(!n[e]){if(!a[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(l)return l(e,!0);throw(r=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",r}r=n[e]={exports:{}},a[e][0].call(r.exports,function(t){return o(a[e][1][t]||t)},r,r.exports,i,a,n,s)}return n[e].exports}for(var l="function"==typeof require&&require,t=0;t>16&255,n[s++]=e>>8&255,n[s++]=255&e;2===i&&(e=l[t.charCodeAt(r)]<<2|l[t.charCodeAt(r+1)]>>4,n[s++]=255&e);1===i&&(e=l[t.charCodeAt(r)]<<10|l[t.charCodeAt(r+1)]<<4|l[t.charCodeAt(r+2)]>>2,n[s++]=e>>8&255,n[s++]=255&e);return n},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],n=0,s=r-i;n>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}(i));return a.join("")}(t,n,s>2]+o[e<<4&63]+"==")):2==i&&(e=(t[r-2]<<8)+t[r-1],a.push(o[e>>10]+o[e>>4&63]+o[e<<2&63]+"="));return a.join("")};for(var o=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,n=i.length;a>>1;case"base64":return T(t).length;default:if(a)return i?-1:P(t).length;e=(""+e).toLowerCase(),a=!0}}function r(t,e,r){var i,a,n,s=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var i=t.length;(!e||e<0)&&(e=0);(!r||r<0||i=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=d.from(e,i)),d.isBuffer(e))return 0===e.length?-1:p(t,e,r,i,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(a?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):p(t,[e],r,i,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,i,a){var n=1,s=t.length,o=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s/=n=2,o/=2,r/=2}function l(t,e){return 1===n?t[e]:t.readUInt16BE(e*n)}if(a)for(var u=-1,h=r;h>8,i=i%256,a.push(i),a.push(r);return a}(e,t.length-r),t,r,i)}function y(t,e,r){r=Math.min(t.length,r);for(var i=[],a=e;a>>10&1023|55296),h=56320|1023&h),i.push(h),a+=d}return function(t){var e=t.length;if(e<=V)return String.fromCharCode.apply(String,t);var r="",i=0;for(;ie&&(t+=" ... "),""},d.prototype.compare=function(t,e,r,i,a){if(g(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),(e=void 0===e?0:e)<0||r>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(a<=i&&r<=e)return 0;if(a<=i)return-1;if(r<=e)return 1;if(this===t)return 0;for(var n=(a>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),o=Math.min(n,s),l=this.slice(i,a),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var a=this.length-e;if((void 0===r||athis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var n,s,o,l=!1;;)switch(i){case"hex":return function(t,e,r,i){r=Number(r)||0;var a=t.length-r;(!i||a<(i=Number(i)))&&(i=a),(a=e.length)/2t.length)throw new RangeError("Index out of range")}function W(t,e,r,i){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,a){return e=+e,r>>>=0,a||W(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function X(t,e,r,i,a){return e=+e,r>>>=0,a||W(t,0,r,8),n.write(t,e,r,i,52,8),r+8}d.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r>>=0,e>>>=0,r||q(t,e,this.length);for(var i=this[t],a=1,n=0;++n>>=0,e>>>=0,r||q(t,e,this.length);for(var i=this[t+--e],a=1;0>>=0,e||q(t,1,this.length),this[t]},d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||q(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||q(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||q(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||q(t,e,this.length);for(var i=this[t],a=1,n=0;++n>>=0,e>>>=0,r||q(t,e,this.length);for(var i=e,a=1,n=this[t+--i];0>>=0,e||q(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||q(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(t,e){t>>>=0,e||q(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readFloatLE=function(t,e){return t>>>=0,e||q(t,4,this.length),n.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||q(t,4,this.length),n.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||q(t,8,this.length),n.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||q(t,8,this.length),n.read(this,t,!1,52,8)},d.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||x(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,n=0;for(this[e]=255&t;++n>>=0,r>>>=0,i||x(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,n=1;for(this[e+a]=255&t;0<=--a&&(n*=256);)this[e+a]=t/n&255;return e+r},d.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeIntLE=function(t,e,r,i){t=+t,e>>>=0,i||x(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var a=0,n=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},d.prototype.writeIntBE=function(t,e,r,i){t=+t,e>>>=0,i||x(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var a=r-1,n=1,s=0;for(this[e+a]=255&t;0<=--a&&(n*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/n>>0)-s&255;return e+r},d.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},d.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return X(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return X(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,i){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),e>=t.length&&(e=t.length),(i=0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var a=(i=t.length-e>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(n=e;n>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function T(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function S(t,e,r,i){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function g(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function w(t){return t!=t}}.call(this)}.call(this,z("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:3}],3:[function(t,e,r){r.read=function(t,e,r,i,a){var n,s,o=8*a-i-1,l=(1<>1,h=-7,d=r?a-1:0,f=r?-1:1,r=t[e+d];for(d+=f,n=r&(1<<-h)-1,r>>=-h,h+=o;0>=-h,h+=i;0>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:n-1,m=i?1:-1,n=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(i=Math.pow(2,-s))<1&&(s--,i*=2),2<=(e+=1<=s+h?d/i:d*Math.pow(2,1-h))*i&&(s++,i/=2),u<=s+h?(o=0,s=u):1<=s+h?(o=(e*i-1)*Math.pow(2,a),s+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,a),s=0));8<=a;t[r+f]=255&o,f+=m,o/=256,a-=8);for(s=s<>1,h=-7,d=r?a-1:0,f=r?-1:1,r=t[e+d];for(d+=f,n=r&(1<<-h)-1,r>>=-h,h+=o;0>=-h,h+=i;0>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:n-1,m=i?1:-1,n=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(i=Math.pow(2,-s))<1&&(s--,i*=2),2<=(e+=1<=s+h?d/i:d*Math.pow(2,1-h))*i&&(s++,i/=2),u<=s+h?(o=0,s=u):1<=s+h?(o=(e*i-1)*Math.pow(2,a),s+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,a),s=0));8<=a;t[r+f]=255&o,f+=m,o/=256,a-=8);for(s=s<>16)+(e>>16)+(r>>16)<<16|65535&r}function o(t,e,r,i,a,n){return d((n=d(d(e,t),d(i,n)))<>>32-a,r)}function f(t,e,r,i,a,n,s){return o(e&r|~e&i,t,e,a,n,s)}function m(t,e,r,i,a,n,s){return o(e&i|r&~i,t,e,a,n,s)}function v(t,e,r,i,a,n,s){return o(e^r^i,t,e,a,n,s)}function p(t,e,r,i,a,n,s){return o(r^(e|~i),t,e,a,n,s)}function s(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r,i,a,n,s=1732584193,o=-271733879,l=-1732584194,u=271733878,h=0;h>5]>>>r%32&255);return e}function u(t){var e,r=[];for(r[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<>>4&15)+r.charAt(15&e);return i}function a(t){return unescape(encodeURIComponent(t))}function n(t){return l(s(u(t=a(t)),8*t.length))}function h(t,e){return function(t,e){var r,i=u(t),a=[],n=[];for(a[15]=n[15]=void 0,16>>0):4294967296*(e>>>0)+(t>>>0)}function h(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var a=r.pos-1;t<=a;a--)r.buf[a+i]=r.buf[a]}function d(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function W(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}a.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,n=this.pos;this.type=7&i,t(a,e,this),this.pos===n&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=q(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=W(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=q(this.buf,this.pos)+q(this.buf,this.pos+4)*n;return this.pos+=8,t},readSFixed64:function(){var t=q(this.buf,this.pos)+W(this.buf,this.pos+4)*n;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r=e[this.pos++],i=127&r;return r<128?i:(i|=(127&(r=e[this.pos++]))<<7,r<128?i:(i|=(127&(r=e[this.pos++]))<<14,r<128?i:(i|=(127&(r=e[this.pos++]))<<21,r<128?i:function(t,e,r){var i,a,n=r.buf;if(a=n[r.pos++],i=(112&a)>>4,a<128)return u(t,i,e);if(a=n[r.pos++],i|=(127&a)<<3,a<128)return u(t,i,e);if(a=n[r.pos++],i|=(127&a)<<10,a<128)return u(t,i,e);if(a=n[r.pos++],i|=(127&a)<<17,a<128)return u(t,i,e);if(a=n[r.pos++],i|=(127&a)<<24,a<128)return u(t,i,e);if(a=n[r.pos++],i|=(1&a)<<31,a<128)return u(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&e[this.pos])<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e=this.readVarint()+this.pos,r=this.pos;return 12<=(this.pos=e)-r&&o?(t=this.buf,o.decode(t.subarray(r,e))):function(t,e,r){var i,a,n,s="",o=e;for(;o>>10&1023|55296),u=56320|1023&u),s+=String.fromCharCode(u),o+=h}return s}(this.buf,r,e)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==a.Bytes)return t.push(this.readVarint(e));var r=l(this);for(t=t||[];this.pos>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(r,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(127>>=7)|(127>>=7)|(127>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,a,n=0;n>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);t=this.pos-e;128<=t&&h(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=1.0){ gl_FragColor = color; return; } float depth = getDepth(currD); // gl_FragColor = vec4(depth,0.0,0.0,1.0); // return; // float depth = czm_unpackDepth(texture2D(depthTexture, v_textureCoordinates)); vec4 positionEC = toEye(v_textureCoordinates, depth); vec3 normalEC = vec3(1.0); czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; shadowParameters.depthBias *= max(depth * 0.01, 1.0); vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); vec4 shadowPosition = _shadowMap_matrix * positionEC; shadowPosition /= shadowPosition.w; if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { gl_FragColor = color; return; } //坐标与视点位置距离,大于最大距离则舍弃阴影效果 vec4 lw = vec4(shadowMap_lightPositionWC,1.0); vec4 vw = czm_inverseView* vec4(positionEC.xyz, 1.0); if(distance(lw.xyz,vw.xyz)>dis){ gl_FragColor = color; return; } //水平夹角限制 vec3 ptOnSP = pointProjectOnPlane(shadowMap_lightUp,lw.xyz,vw.xyz); directionEC = ptOnSP - lw.xyz; float directionECMO = ptm(directionEC.xyz); float shadowMap_lightDirMO = ptm(shadowMap_lightDir.xyz); float cosJJ = dot(directionEC,shadowMap_lightDir)/(directionECMO*shadowMap_lightDirMO); float degJJ = acos(cosJJ)*(180.0 / PI); degJJ = abs(degJJ); if(degJJ>spzj/2.0){ gl_FragColor = color; return; } //垂直夹角限制 vec3 ptOnCZ = pointProjectOnPlane(shadowMap_lightRight,lw.xyz,vw.xyz); vec3 dirOnCZ = ptOnCZ - lw.xyz; float dirOnCZMO = ptm(dirOnCZ); float cosJJCZ = dot(dirOnCZ,shadowMap_lightDir)/(dirOnCZMO*shadowMap_lightDirMO); float degJJCZ = acos(cosJJCZ)*(180.0 / PI); degJJCZ = abs(degJJCZ); if(degJJCZ>czzj/2.0){ gl_FragColor = color; return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = _czm_shadowVisibility(marsShadow, shadowParameters); if(visibility==1.0){ gl_FragColor = mix(color,vec4(visibleColor,1.0),mixNum); }else{ // if(abs(shadowPosition.z-0.0)<0.01){ // return; // } gl_FragColor = mix(color,vec4(disVisibleColor,1.0),mixNum); } }`,uniforms:{czzj:function(){return e.verticalAngle},dis:function(){return e.distance},spzj:function(){return e.horizontalAngle},visibleColor:function(){return e.visibleAreaColor},disVisibleColor:function(){return e.hiddenAreaColor},mixNum:function(){return e.alpha},marsShadow:function(){return e.viewShadowMap._shadowMapTexture||e._defaultColorTexture},_shadowMap_matrix:function(){return e.viewShadowMap._shadowMapMatrix},shadowMap_lightPositionEC:function(){return e.viewShadowMap._lightPositionEC},shadowMap_lightPositionWC:function(){return e.viewShadowMap._lightCamera.position},shadowMap_lightDirectionEC:function(){return e.viewShadowMap._lightDirectionEC},shadowMap_lightUp:function(){return e.viewShadowMap._lightCamera.up},shadowMap_lightDir:function(){return e.viewShadowMap._lightCamera.direction},shadowMap_lightRight:function(){return e.viewShadowMap._lightCamera.right},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let t=new Cesium.Cartesian2;return t.x=1/e.viewShadowMap._textureSize.x,t.y=1/e.viewShadowMap._textureSize.y,Cesium.Cartesian4.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cesium.Cartesian4.fromElements(r.normalOffsetScale,e.viewShadowMap._distance,e.viewShadowMap.maximumDistance,e.viewShadowMap._darkness,this.combinedUniforms2)},depthTexture1:function(){return e.getSceneDepthTexture(e._map.scene)}}}),this._map.scene.postProcessStages.add(this.postProcess)}getSceneDepthTexture(t){var e=t._environmentState;let r=t._view;t=e.useGlobeDepthFramebuffer?r.globeDepth.framebuffer:void 0,e=r.sceneFramebuffer.getFramebuffer();return Cesium.defaultValue(t,e).depthStencilTexture}getFrustumQuaternion(t,e){var r=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),new Cesium.Cartesian3),i=Cesium.Cartesian3.normalize(t,new Cesium.Cartesian3);let a=new Cesium.Camera(this._map.scene);a.position=t,a.direction=r,a.up=i;var r=a.directionWC,i=a.upWC,n=a.rightWC,s=new Cesium.Cartesian3,e=new Cesium.Matrix3,t=new Cesium.Quaternion,n=Cesium.Cartesian3.negate(n,s),e=e;return Cesium.Matrix3.setColumn(e,0,n,e),Cesium.Matrix3.setColumn(e,1,i,e),Cesium.Matrix3.setColumn(e,2,r,e),Cesium.Quaternion.fromRotationMatrix(e,t)}update(t){this.viewShadowMap&&t.shadowMaps.push(this.viewShadowMap)}getOnLinePointByLen(t,e,r,i){var a=Cesium.Transforms.eastNorthUpToFixedFrame(t),n=Cesium.Matrix4.inverse(a,new Cesium.Matrix4);t=Cesium.Matrix4.multiplyByPoint(n,t,new Cesium.Cartesian3),e=Cesium.Matrix4.multiplyByPoint(n,e,new Cesium.Cartesian3);var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3);let s=r/Cesium.Cartesian3.distance(t,e);i&&(s+=1);n=Cesium.Cartesian3.multiplyByScalar(n,s,new Cesium.Cartesian3);return n=Cesium.Matrix4.multiplyByPoint(a,n,new Cesium.Cartesian3)}addPositionsHeight(i,a=0){if(a=Number(a),isNaN(a)||0==a)return i;if(Array.isArray(i)){let r=[];for(let t=0,e=i.length;tthis._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(r,t,e))return!0;if(!this._hasMetadata)return!1;for(var i=this._layers,a=i.length,n=0;nthis._availability._maximumLevel||this._availability.isTileAvailable(r,t,e))&&this._hasMetadata)for(var i=this._layers,a=i.length,n=0;n time && st.s < time1){\n float ff = st.s - time; color.a = ff / rate ;\n color.a *= ( .5 - abs(0.5 - st.t))/0.5;\n }\n if(time1 > 1.&& st.s < (time1 - 1.)){\n color.a = (st.s + 1. - time) / rate ;\n color.a *= ( .5 - abs(0.5 - st.t))/0.5;\n }\n dm.diffuse = color.rgb;\n dm.alpha = color.a ;\n return dm;\n}"}},{}],21:[function(t,e,r){e.exports=class i{static createPolygonDiffuse(t){var e=new i(t);return t.viewer.scene.primitives.add(e),e}constructor(t){this.viewer=t.viewer||window.viewer,t.positions||console.log("输入控制点为空"),this.controlPoints=t.positions,this.radius=t.radius||1e3,this.center=t.center||this.computeCenter(this.controlPoints),0i&&(i=n),sa&&(a=s);return Cesium.Cartesian3.fromRadians(e+(i-e)/2,r+(a-r)/2)}computeEllipsePosition_pd(t,e,r,i,a){let n=[];var s=a||360,o=(i-r)*Math.PI/180/s,l=r*Math.PI/180,u=Cesium.Transforms.eastNorthUpToFixedFrame(t);for(let t=0;t3-i?(e.push(Number("0x"+t.substring(r,r+2))),r+=2):(e.push(Number("0x"+t.charAt(r)+t.charAt(r))),r+=1);return e}}draw(t){}getRenderTileMap(e){let r={};for(let t=0;t/g,"")}static getAngle(t,e){if(e[0]-t[0]==0)return e[1]>t[0]?90:-90;t=(e[1]-t[1])/(e[0]-t[0]);return 360*Math.atan(t)/(2*Math.PI)}static getUpdateAngle(t,e){e=t-e;return 45r[1])return a=!0,a;i<-45&&-90r[0]&&(a=!0)}else e[0]>r[0]&&(a=!0);return a}static textToSameBearing(e){if(!(e.length<2))for(let t=1;t=i)return!1}}return!0}hideCollisionFeatures(e,r){for(let t=0;tt[0]?90:-90;t=(e[1]-t[1])/(e[0]-t[0]);return 360*Math.atan(t)/(2*Math.PI)}length(t,e,r,i){t=r-t,e=i-e;return Math.sqrt(t*t+e*e)}getNodePath(t,e){let r=[],i={},a=[];function n(t){var e=t[0];return t.splice(0,1),e}var s=e.length;let o=n(e),l=0;for(;;){if(a.length==s)return i.index=l,i.pointList=a,i;if(l>=t.length)return i.index=l,i.pointList=a,i;var u=t[l],h=t[l+1];if(0!=r.length){var d=this.length(r[0],r[1],u,h);if(d>=o){var f=this.getLengthPoint(r[0],r[1],u,h,o,null);let t=this.getAngle(r,[u,h]);90==t&&(t=0),-90==t&&(t=0),0==t&&(t=.5),45<=t?t-=90:t<=-45&&(t+=90);var m=[f,t];a.push(m),r[0]=f[0],r[1]=f[1],o=n(e)}else o-=d,r[0]=u,r[1]=h,l+=2}else r[0]=u,r[1]=h}return i.index=l,i.pointList=a,i}}},{}],48:[function(t,e,r){e.exports=i;var d=3;function i(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var n=0;n=u[0+d]&&i>=u[1+d]?(s[f]=!0,n.push(l[f])):s[f]=!1)}},i.prototype._forEachCell=function(t,e,r,i,a,n,s){for(var o=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(i),d=o;d<=u;d++)for(var f=l;f<=h;f++){var m=this.d*f+d;if(a.call(this,t,e,r,i,m,n,s))return}},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=d+this.cells.length+1+1,r=0,i=0;is?a.fontHeight:s),a}getPointAvoidBox(t,e,r,i,a,n,s){var o=[t[0]-.5*i,t[1]-.5*s,t[0]+.5*i+r+n,t[1]+.5*s],l=[t[0]-.5*i-r-n,o[1],t[0]+.5*i,o[3]],i=[t[0]-.5*n,t[1]-.5*a,t[0]+.5*n,t[1]+.5*a+r+s],n=[i[0],t[1]-r-s-.5*a,i[2],t[1]+.5*a];let u=[o=this.boxScale(o,e.pointBoxDisance),l=this.boxScale(l,e.pointBoxDisance),i=this.boxScale(i,e.pointBoxDisance),n=this.boxScale(n,e.pointBoxDisance)];if(!e.isFourDirections&&!e.isEightDirections)return[u[e.direction]];if(e.isFourDirections)return 0n[0]?i:n)[0],n=[a,(i[1]n[1]?i:n)[1]],this.boxScale(n,r.lineArrowBoxDisance),t.boxs=[n],t.arrowPoint=s):t.hiden=!0}isMessy(t,e,r,i){var a=e[0][0];let n=a[0],s=a[1],o=a[0],l=a[1],u=e[0][1],h=e[0][1];for(let t=0;to&&(o=d[0]),d[0]l&&(l=d[1]),d[1]h&&(h=f),fr.angle){if(0!=r.angleSwitch||!r.angleColor)return!0;t.lineFillStyle=r.angleColor}return!1}getLineBoxs(e,r,i,t){let a=[],n=[];for(let t=0;t=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}updateAngle(e){var r=d.getUpdateAngle(e[0][1],this.bearing);for(let t=0;t{var e,r=Math.floor(t/256);i[r]?(e=i[r].glyphs[t])&&(l[t]=e):(void 0===u[r]&&(u[r]=[],h++),u[r].push(t))};for(let t=0;t{if(!t){var i=this.stacks[s][e]=r.stacks[0];for(let t=0;t 65535 not supported");void 0===this.loading[e]&&(this.loading[e]={});const a=this.loading[e];if(a[r])a[r].push(i);else{a[r]=[i];s=(n=e,s=256*r+"-"+(256*r+255),i=this.url,n=encodeURIComponent(e),i.replace("{fontstack}",n).replace("{range}",s));let t=new u({url:s});t.fetchArrayBuffer().then(function(t){var e=new o(new l(t));for(let t=0;t128<=t&&t<=255,Arabic:t=>1536<=t&&t<=1791,"Arabic Supplement":t=>1872<=t&&t<=1919,"Arabic Extended-A":t=>2208<=t&&t<=2303,"Hangul Jamo":t=>4352<=t&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>5120<=t&&t<=5759,"Unified Canadian Aboriginal Syllabics Extended":t=>6320<=t&&t<=6399,"General Punctuation":t=>8192<=t&&t<=8303,"Letterlike Symbols":t=>8448<=t&&t<=8527,"Number Forms":t=>8528<=t&&t<=8591,"Miscellaneous Technical":t=>8960<=t&&t<=9215,"Control Pictures":t=>9216<=t&&t<=9279,"Optical Character Recognition":t=>9280<=t&&t<=9311,"Enclosed Alphanumerics":t=>9312<=t&&t<=9471,"Geometric Shapes":t=>9632<=t&&t<=9727,"Miscellaneous Symbols":t=>9728<=t&&t<=9983,"Miscellaneous Symbols and Arrows":t=>11008<=t&&t<=11263,"CJK Radicals Supplement":t=>11904<=t&&t<=12031,"Kangxi Radicals":t=>12032<=t&&t<=12255,"Ideographic Description Characters":t=>12272<=t&&t<=12287,"CJK Symbols and Punctuation":t=>12288<=t&&t<=12351,Hiragana:t=>12352<=t&&t<=12447,Katakana:t=>12448<=t&&t<=12543,Bopomofo:t=>12544<=t&&t<=12591,"Hangul Compatibility Jamo":t=>12592<=t&&t<=12687,Kanbun:t=>12688<=t&&t<=12703,"Bopomofo Extended":t=>12704<=t&&t<=12735,"CJK Strokes":t=>12736<=t&&t<=12783,"Katakana Phonetic Extensions":t=>12784<=t&&t<=12799,"Enclosed CJK Letters and Months":t=>12800<=t&&t<=13055,"CJK Compatibility":t=>13056<=t&&t<=13311,"CJK Unified Ideographs Extension A":t=>13312<=t&&t<=19903,"Yijing Hexagram Symbols":t=>19904<=t&&t<=19967,"CJK Unified Ideographs":t=>19968<=t&&t<=40959,"Yi Syllables":t=>40960<=t&&t<=42127,"Yi Radicals":t=>42128<=t&&t<=42191,"Hangul Jamo Extended-A":t=>43360<=t&&t<=43391,"Hangul Syllables":t=>44032<=t&&t<=55215,"Hangul Jamo Extended-B":t=>55216<=t&&t<=55295,"Private Use Area":t=>57344<=t&&t<=63743,"CJK Compatibility Ideographs":t=>63744<=t&&t<=64255,"Arabic Presentation Forms-A":t=>64336<=t&&t<=65023,"Vertical Forms":t=>65040<=t&&t<=65055,"CJK Compatibility Forms":t=>65072<=t&&t<=65103,"Small Form Variants":t=>65104<=t&&t<=65135,"Arabic Presentation Forms-B":t=>65136<=t&&t<=65279,"Halfwidth and Fullwidth Forms":t=>65280<=t&&t<=65519}},{}],57:[function(t,e,r){"use strict";const i=t("./is_char_in_unicode_block");e.exports.allowsIdeographicBreaking=function(t){for(const e of t)if(!r.charAllowsIdeographicBreaking(e.charCodeAt(0)))return!1;return!0},e.exports.allowsVerticalWritingMode=function(t){for(const e of t)if(r.charHasUprightVerticalOrientation(e.charCodeAt(0)))return!0;return!1},e.exports.allowsLetterSpacing=function(t){for(const e of t)if(!r.charAllowsLetterSpacing(e.charCodeAt(0)))return!1;return!0},e.exports.charAllowsLetterSpacing=function(t){return!i.Arabic(t)&&(!i["Arabic Supplement"](t)&&(!i["Arabic Extended-A"](t)&&(!i["Arabic Presentation Forms-A"](t)&&!i["Arabic Presentation Forms-B"](t))))},e.exports.charAllowsIdeographicBreaking=function(t){return!(t<11904)&&(!!i["Bopomofo Extended"](t)||(!!i.Bopomofo(t)||(!!i["CJK Compatibility Forms"](t)||(!!i["CJK Compatibility Ideographs"](t)||(!!i["CJK Compatibility"](t)||(!!i["CJK Radicals Supplement"](t)||(!!i["CJK Strokes"](t)||(!!i["CJK Symbols and Punctuation"](t)||(!!i["CJK Unified Ideographs Extension A"](t)||(!!i["CJK Unified Ideographs"](t)||(!!i["Enclosed CJK Letters and Months"](t)||(!!i["Halfwidth and Fullwidth Forms"](t)||(!!i.Hiragana(t)||(!!i["Ideographic Description Characters"](t)||(!!i["Kangxi Radicals"](t)||(!!i["Katakana Phonetic Extensions"](t)||(!!i.Katakana(t)||(!!i["Vertical Forms"](t)||(!!i["Yi Radicals"](t)||!!i["Yi Syllables"](t))))))))))))))))))))},r.charHasUprightVerticalOrientation=function(t){return 746===t||747===t||!(t<4352)&&(!!i["Bopomofo Extended"](t)||(!!i.Bopomofo(t)||(!(!i["CJK Compatibility Forms"](t)||65097<=t&&t<=65103)||(!!i["CJK Compatibility Ideographs"](t)||(!!i["CJK Compatibility"](t)||(!!i["CJK Radicals Supplement"](t)||(!!i["CJK Strokes"](t)||(!(!i["CJK Symbols and Punctuation"](t)||12296<=t&&t<=12305||12308<=t&&t<=12319||12336===t)||(!!i["CJK Unified Ideographs Extension A"](t)||(!!i["CJK Unified Ideographs"](t)||(!!i["Enclosed CJK Letters and Months"](t)||(!!i["Hangul Compatibility Jamo"](t)||(!!i["Hangul Jamo Extended-A"](t)||(!!i["Hangul Jamo Extended-B"](t)||(!!i["Hangul Jamo"](t)||(!!i["Hangul Syllables"](t)||(!!i.Hiragana(t)||(!!i["Ideographic Description Characters"](t)||(!!i.Kanbun(t)||(!!i["Kangxi Radicals"](t)||(!!i["Katakana Phonetic Extensions"](t)||(!(!i.Katakana(t)||12540===t)||(!(!i["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||65306<=t&&t<=65310||65339===t||65341===t||65343===t||65371<=t&&t<=65503||65507===t||65512<=t&&t<=65519)||(!(!i["Small Form Variants"](t)||65112<=t&&t<=65118||65123<=t&&t<=65126)||(!!i["Unified Canadian Aboriginal Syllabics"](t)||(!!i["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!i["Vertical Forms"](t)||(!!i["Yijing Hexagram Symbols"](t)||(!!i["Yi Syllables"](t)||!!i["Yi Radicals"](t))))))))))))))))))))))))))))))},r.charHasNeutralVerticalOrientation=function(t){return!(!i["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!i["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!i["Letterlike Symbols"](t)||(!!i["Number Forms"](t)||(!(!i["Miscellaneous Technical"](t)||!(8960<=t&&t<=8967||8972<=t&&t<=8991||8996<=t&&t<=9e3||9003===t||9085<=t&&t<=9114||9150<=t&&t<=9165||9167===t||9169<=t&&t<=9179||9186<=t&&t<=9215))||(!(!i["Control Pictures"](t)||9251===t)||(!!i["Optical Character Recognition"](t)||(!!i["Enclosed Alphanumerics"](t)||(!!i["Geometric Shapes"](t)||(!(!i["Miscellaneous Symbols"](t)||9754<=t&&t<=9759)||(!(!i["Miscellaneous Symbols and Arrows"](t)||!(11026<=t&&t<=11055||11088<=t&&t<=11097||11192<=t&&t<=11243))||(!!i["CJK Symbols and Punctuation"](t)||(!!i.Katakana(t)||(!!i["Private Use Area"](t)||(!!i["CJK Compatibility Forms"](t)||(!!i["Small Form Variants"](t)||(!!i["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||9984<=t&&t<=10087||10102<=t&&t<=10131||65532===t||65533===t)))))))))))))))))},r.charHasRotatedVerticalOrientation=function(t){return!(r.charHasUprightVerticalOrientation(t)||r.charHasNeutralVerticalOrientation(t))}},{"./is_char_in_unicode_block":56}],58:[function(t,n,e){"use strict";const s=t("./script_detection");n.exports=function(e){let r="";for(let t=0;t":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},{"./script_detection":57}],59:[function(t,e,r){Cesium.Cartesian3,Cesium.Color,Cesium.defined,Cesium.CallbackProperty,Cesium.Math;const c=Cesium.when;Cesium.Matrix4,Cesium.Cartesian4;e.exports=class{constructor(t,e,r,i,a,n){this.name=t,this.level=r,this.viewer=i,this.options=a,this.type="model",this.state=1,this.modelArray=[],this.urlMap=a.urlTypeLevelMap,this.readyPromise=c.defer(),this.ready=!1,this.load(e)}load(t){let r={};for(var e in t){var i=t[e];for(let e=0;e(o[a]=!0,"define"===e?` #ifndef HAS_UNIFORM_u_${a} varying ${r} ${i} ${a}; #else uniform ${r} ${i} u_${a}; #endif `:` #ifdef HAS_UNIFORM_u_${a} ${r} ${i} ${a} = u_${a}; #endif `)),vertexSource:e=e.replace(r,(t,e,r,i,a)=>{var n="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":n;return o[a]?"define"===e?` #ifndef HAS_UNIFORM_u_${a} uniform lowp float u_${a}_t; attribute ${r} ${n} a_${a}; varying ${r} ${i} ${a}; #else uniform ${r} ${i} u_${a}; #endif `:"vec4"==s?` #ifndef HAS_UNIFORM_u_${a} ${a} = a_${a}; #else ${r} ${i} ${a} = u_${a}; #endif `:` #ifndef HAS_UNIFORM_u_${a} ${a} = unpack_mix_${s}(a_${a}, u_${a}_t); #else ${r} ${i} ${a} = u_${a}; #endif `:"define"===e?` #ifndef HAS_UNIFORM_u_${a} uniform lowp float u_${a}_t; attribute ${r} ${n} a_${a}; #else uniform ${r} ${i} u_${a}; #endif `:"vec4"==s?` #ifndef HAS_UNIFORM_u_${a} ${r} ${i} ${a} = a_${a}; #else ${r} ${i} ${a} = u_${a}; #endif `:` #ifndef HAS_UNIFORM_u_${a} ${r} ${i} ${a} = unpack_mix_${s}(a_${a}, u_${a}_t); #else ${r} ${i} ${a} = u_${a}; #endif `}),staticAttributes:i,staticUniforms:a}}static makeShader(t,e,r){r=t.createShader(r);return t.shaderSource(r,e),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)||alert("Error compiling shader: "+t.getShaderInfoLog(r)),r}}e.exports=m},{"./Shaders":62}],62:[function(t,e,r){"use strict";e.exports={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\nfloat evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\n\n// To minimize the number of attributes needed in the mapbox-gl-native shaders,\n// we encode a 4-component color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nuniform highp vec4 color;\nuniform mediump float radius;\nuniform lowp float blur;\nuniform lowp float opacity;\nuniform vec4 stroke_color;\nuniform mediump float stroke_width;\nuniform lowp float stroke_opacity;\n\nvoid main() {\n\n float extrude_length = length(v_extrude);\n float antialiased_blur = -max(blur, v_antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n //gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\n\n\nuniform lowp float u_devicepixelratio;\n//uniform highp vec4 color;\nuniform mediump float radius;\n//uniform lowp float blur;\n//uniform lowp float opacity;\n//uniform vec4 stroke_color;\nuniform mediump float stroke_width;\n//uniform lowp float stroke_opacity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\nvoid main(void) {\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * (radius + stroke_width) * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n \n\n if (u_pitch_with_map) {\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5 + extrude), 0, 1);\n //gl_Position.xy += extrude;\n } else {\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n gl_Position.xy += extrude * gl_Position.w;\n gl_Position.z = 0.0;\n }\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / u_devicepixelratio / (radius + stroke_width);\n}\n\n\n\n\n\n\n\n\n\n"},fill:{fragmentSource:"uniform highp vec4 u_color;\nuniform lowp float u_opacity;\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\nuniform mat4 u_matrix;\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_Position.y = - gl_Position.y;\n}\n"},fillOutline:{fragmentSource:"uniform highp vec4 outline_color;\nuniform lowp float opacity;\n\nvarying vec2 v_pos;\n\nvoid main() {\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_Position.y = - gl_Position.y;\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_Position.y = - gl_Position.y;\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_Position.y = - gl_Position.y;\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},line:{fragmentSource:"\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nuniform highp vec4 color;\nuniform lowp float blur;\nuniform lowp float opacity;\nvoid main() {\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\nattribute vec2 a_txy;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n uniform mediump float a_gapwidth;\n uniform float a_offset;\nmediump float gapwidth;\nlowp float offset;\n\n\nvoid main() {\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_txy;\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = a_gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * a_offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n// vec2 pos = a_pos;\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n\n gl_Position = u_matrix * vec4(a_pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n gl_Position.y = - gl_Position.y;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_width;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset; \n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n gl_Position.y = - gl_Position.y;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n\nuniform highp vec4 color;\nuniform lowp float blur;\nuniform lowp float opacity;\n\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, -v_tex_a).a;\n float sdfdist_b = texture2D(u_image, -v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\nattribute vec2 a_txy;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n\nuniform mediump float a_gapwidth;\nuniform lowp float a_offset;\nmediump float gapwidth;\nlowp float offset;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_txy;\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = a_gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * a_offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = a_pos;\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n gl_Position.y = - gl_Position.y;\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n gl_Position.y = - gl_Position.y;\n v_pos = a_texture_pos / 32768.0;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_dimension;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n highp vec2 epsilon = 1.0 / u_dimension;\n float scale = (u_dimension.x - 2.0) / u_dimension.x;\n v_pos = (a_texture_pos / 32768.0) * scale + epsilon;\n}\n"}}},{}],63:[function(t,e,r){const l=Cesium.when,i=Cesium.Credit,a=Cesium.defaultValue,u=Cesium.defined,h=Cesium.DeveloperError,n=Cesium.Ellipsoid,s=Cesium.Event,o=Cesium.GeographicTilingScheme,d=Cesium.HeightmapTerrainData,f=Cesium.Resource,m=Cesium.TerrainProvider,v=Cesium.RequestState,p=t("md5-node");function c(t){if(t=a(t,a.EMPTY_OBJECT),this.name="RGBWorldTerrainProvider",this._tileMatrixLabels=t.tileMatrixLabels,!u(t.url))throw new h("options.url is required.");var e=f.createIfNeeded(t.url);this._resource=e,this._errorEvent=new s,this._ready=!1,this._readyPromise=l.defer();e=t.credit;"string"==typeof e&&(e=new i(e)),this._credit=e,this._tilingScheme=void 0,this._rectangles=[];e=a(t.ellipsoid,n.WGS84);this._maxLevel=a(t.maxLevel,15),this._tilingScheme=a(t.tilingScheme,new o({ellipsoid:e})),this._width=parseInt(a(t.width,65)),this.tileSize=Cesium.tileSize,this._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(e,65,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this.processor=new Cesium.TaskProcessor("TerrainWorker",Number.POSITIVE_INFINITY),t.url&&(this.url=t.url,this.indexDbName="terrain_"+p(t.url));t=this._tilingScheme instanceof o?"GeographicTilingScheme":"WebMercatorTilingScheme";let r=this.processor.scheduleTask({init:!0,w:this._width,indexDbName:this.indexDbName,tilingSchemeName:t,maxLevel:this._maxLevel,tileSize:this.tileSize});r.then(function(){this._ready=!0,this._readyPromise.resolve(!0)}.bind(this))}Object.defineProperties(c.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),c.prototype.requestTileGeometry=function(t,e,r,i){if(!this.ready)throw new h("requestTileGeometry must not be called before ready returns true.");var a=this._tileMatrixLabels,n=u(a)?a[0]:0,a=r+parseInt(n),n=this._resource.getDerivedResource({request:i}),t={z:a,y:e,x:t};n.setTemplateValues(t);t={url:n.url,xyz:{x:t.x,y:t.y,z:r}};r>this._maxLevel&&(t.resourceUrl=this.url);let s=this.processor.scheduleTask(t);var o=l.defer();return s.then(function(t,e,r){if(!r)return e.state=v.CANCELLED,void t.reject();r=new d({buffer:r.sData,_minimumHeight:r._minimumHeight,_maximumHeight:r._maximumHeight,width:this._width,height:this._width});t.resolve(r)}.bind(this,o,i),function(t){i.state=v.CANCELLED,o.reject()}.bind(this,o,i)),o.promise},c.prototype.getLevelMaximumGeometricError=function(t){if(!this.ready)throw new h("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<this.height)return console.log("LineAtlas out of space"),null;let e=0;for(let t=0;t 0.70710678){\n color1.a = pow(fff,4.);\n }\n }\n material.diffuse = color.rgb;\n material.alpha = color1.a ;\n return material;\n}\n"}createPolygonScanShader(){return"czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec2 center = (st - scanCenter)*scale;\n float time = direction * czm_frameNumber * 3.1415926 / 180.;\n float sin_t = sin(time);\n float cos_t = cos(time);\n vec2 center_rotate = vec2(center.s*cos_t-center.t*sin_t+0.5,center.s*sin_t+center.t*cos_t+0.5);\n vec4 color = texture2D(image,center_rotate);\n vec3 tColor = czm_gammaCorrect(color.rgb * highlightColor.rgb);\n tColor *= vec3(1.2,1.2,1.2);\n if(length(center)>0.48){\n tColor = highlightColor.rgb * 1.2;\n }\n material.diffuse = tColor;\n material.alpha = color.a * 2.;\n return material;\n}\n"}computeScanTextureCoordAndRate(t,e){e=this.computeMinMaxCoords(e),t=this.carte2carto(t);let r=new Cesium.Cartesian2;return r.x=(t.longitude-e[0])/(e[2]-e[0]),r.y=(t.latitude-e[1])/(e[3]-e[1]),e=(e[2]-e[0])/(e[3]-e[1]),{tc:r,rate:e}}computeMinMaxCoords(t){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE;var n,s,o;for(o in t)n=(s=this.carte2carto(t[o])).longitude,s=s.latitude,ni&&(i=n),sa&&(a=s);return[e,r,i,a]}carte2carto(t){return Cesium.Cartographic.fromCartesian(t)}computeEllipsePosition_pls(t,e,r,i,a){let n=[];var s=a||360,o=(i-r)*Math.PI/180/s,l=r*Math.PI/180,u=Cesium.Transforms.eastNorthUpToFixedFrame(t);for(let t=0;t min(p1.x, p2.x) && checkPoint.x <= max(p1.x, p2.x)) {\n if (checkPoint.y <= max(p1.y, p2.y)) {\n if (p1.x != p2.x) {\n xinters = (checkPoint.x - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;\n if (p1.y == p2.y || checkPoint.y <= xinters) {\n counter++;\n }\n }\n }\n }\n p1 = p2;\n }\n float f = float(counter) / 2.;\n float ff = f - floor(f);\n if(ff > 0.000001)\n return 1;\n else\n return 0;\n}\n",l+="void lidarScan"+o+"(){\n";h=Cesium.Transforms.eastNorthUpToFixedFrame(h);let s=Cesium.Matrix4.inverse(h,new Cesium.Matrix4);var d,h="mat4 ienu_mat1 = mat4("+s[0].toFixed(15)+","+s[1].toFixed(15)+","+s[2].toFixed(15)+","+s[3].toFixed(15)+","+s[4].toFixed(15)+","+s[5].toFixed(15)+","+s[6].toFixed(15)+","+s[7].toFixed(15)+","+s[8].toFixed(15)+","+s[9].toFixed(15)+","+s[10].toFixed(15)+","+s[11].toFixed(15)+","+s[12].toFixed(15)+","+s[13].toFixed(15)+","+s[14].toFixed(15)+","+s[15].toFixed(15)+");\n";for(d in l+=h,l+="vec2 scan_polygon["+u.length+"];\n",u){let t=Cesium.Matrix4.multiplyByPoint(s,u[d],new Cesium.Cartesian3);l+="scan_polygon["+d+"] = vec2("+t.x.toFixed(5)+","+t.y.toFixed(5)+");\n"}l+="int isCircle = "+a+";\n",l+="float speed = "+t.toFixed(5)+";\n",l+="float rate = 1. / "+e.toFixed(5)+";\n",l+="float radius = "+n.toFixed(5)+";\n",l+="float direction = "+r.toFixed(5)+";\n",l+="vec3 color = vec3("+i.red.toFixed(5)+","+i.green.toFixed(5)+","+i.blue.toFixed(5)+");\n",l+=" vec4 tpoint = ienu_mat1 * vec4(v_xh_position2 ,1.);\n tpoint /= tpoint.w;\n vec2 txy = tpoint.xy;\n int f = 0;\n if(isCircle == 1)\n f = 1;\n else\n f = isInPolygon"+o+"( txy, scan_polygon );\n if(f == 1){\n vec2 st = normalize(txy / radius);\n float time = fract(czm_frameNumber / speed) * direction;\n float angle = 3.1415926535898 * 2.0 * time;\n vec2 normal = vec2(sin(angle),cos(angle));\n float ff = normal.x * st.t - normal.y * st.s;\n float distance = length(txy);\n if(ff < 0.0 && distance < radius){\n float fff = dot(normal,st);\n if(fff > 0.70710678){\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, pow(fff,4.));\n }\n }\n }\n}\n"}let e="void main(){\n";for(t in this.lightMap)e+=" lidarScan"+t+"();\n";return e+="}\n","varying vec3 v_xh_position2;\n"+l+e}}e.exports=i},{"./Light.js":73}],79:[function(t,e,r){t=t("./Light.js");class i extends t{constructor(){super(),this.type="UpDownScanLight"}updateLightArray(){}getGlobeSurfaceShader(){}getPolygonColorPrimitiveShader(){return{vertexShaderSource:Cesium.ShaderSource.replaceMain(this.getPolygonColorPrimitiveVs(),this.type),fragmentShaderSource:Cesium.ShaderSource.replaceMain(this.getFs(),this.type)}}getPolygonColorPrimitiveVs(){return"varying vec3 v_xh_position3;\n void main(){\n vec4 p = czm_computePosition();\n v_xh_position3 = (czm_modelViewRelativeToEye * p).xyz;\n}\n"}getFs(){let t=null;for(var e in this.lightMap)t=this.lightMap[e];var r=t.position,i=t.maxHeight||10,a=t.scanHeight||50,n=(t.scanWidth||2)/a,s=t.speed||600,o=t.color||new Cesium.Color(.1,.3,.5,1),l=r,u=Cesium.Cartographic.fromCartesian(l),h=Cesium.Cartesian3.fromRadians(u.longitude,u.latitude,u.height+2e5),d=new window.Cesium.Cartesian3(Math.floor(l.x),Math.floor(l.y),Math.floor(l.z)),r=new window.Cesium.Cartesian3(l.x-Math.floor(l.x),l.y-Math.floor(l.y),l.z-Math.floor(l.z)),u=new window.Cesium.Cartesian3(Math.floor(h.x),Math.floor(h.y),Math.floor(h.z)),l=new window.Cesium.Cartesian3(h.x-Math.floor(h.x),h.y-Math.floor(h.y),h.z-Math.floor(h.z)),h="void main(){\n";return h+="float speed = "+this.isContainPoint(s)+";\n",h+="float rate = "+this.isContainPoint(n)+";\n",h+="float mHeight = "+this.isContainPoint(i)+";\n",h+="float sHeight = "+this.isContainPoint(a)+";\n",h+="vec3 color = vec3("+this.isContainPoint(o.red)+","+this.isContainPoint(o.green)+","+this.isContainPoint(o.blue)+");\n",h+="vec3 high1 = vec3("+this.isContainPoint(d.x)+","+this.isContainPoint(d.y)+","+this.isContainPoint(d.z)+");\n",h+="vec3 low1 = vec3("+this.isContainPoint(r.x)+","+this.isContainPoint(r.y)+","+this.isContainPoint(r.z)+");\n",h+="vec3 high2 = vec3("+this.isContainPoint(u.x)+","+this.isContainPoint(u.y)+","+this.isContainPoint(u.z)+");\n",h+="vec3 low2 = vec3("+this.isContainPoint(l.x)+","+this.isContainPoint(l.y)+","+this.isContainPoint(l.z)+");\n","varying vec3 v_xh_position3;\nvec3 calPoint(vec3 high,vec3 low){\n vec4 tPoint = czm_translateRelativeToEye(high,low);\n return (czm_modelViewRelativeToEye *tPoint).xyz;\n}\nvec3 pointProjectOnPlane(vec3 planeNormal,vec3 planeOrigin,vec3 point)\n{\n vec3 dd = point - planeOrigin;\n float d = dot(planeNormal,dd);\n return (point - planeNormal * d);\n}\nfloat calHeight(vec3 o,vec3 up,vec3 p)\n{\n vec3 normal = up - o;\n normal = normalize(normal);\n vec3 op = p - o;\n return dot(normal,op);\n}\nvoid b2tScan(float ch,float mh,float sh,float speed,float sRate,vec3 color){\n float a11 = fract(czm_frameNumber / speed) * 3.14159265 * 2.;\n float a12 = ch / mh + sin(a11) * 0.2 + 0.5;\n gl_FragColor.rgb *= a12;\n float a13 = fract(czm_frameNumber / speed);\n float ah = clamp(ch / sh, 0.0, 1.0);\n a13 = abs(a13 - 0.5) * 2.0;\n float a_diff = step(sRate, abs(ah - a13));\n if(a_diff < 0.5)\n gl_FragColor.rgb = color.rgb;\n}\n"+(h+=" vec3 origin = calPoint(high1,low1);\n vec3 originAbove = calPoint(high2,low2);\n float ch = calHeight(origin, originAbove, v_xh_position3);\n b2tScan(ch,mHeight,sHeight,speed,rate,color);\n}\n")}isContainPoint(t){let e=t.toString();return e.indexOf(".")<0&&(e+="."),e}}e.exports=i},{"./Light.js":73}],80:[function(t,e,r){e.exports=class i{static createWave3dTileLight(t){return new i(t)}constructor(t){this.viewer=t.viewer||window.viewer,this.positions=t.positions,this.center=t.center,this.radius=t.radius,this.center&&0i&&(i=n),sa&&(a=s);return[e,r,i,a]}carte2carto_prs(t){return Cesium.Cartographic.fromCartesian(t)}}},{}],81:[function(t,e,r){t=t("./Light.js");class i extends t{constructor(){super(),this.type="WaveLight"}updateLightArray(){}getGlobeSurfaceShader(){return{vertexShaderSource:Cesium.ShaderSource.replaceMain(this.getGlobeSurfaceVS(),this.type),fragmentShaderSource:Cesium.ShaderSource.replaceMain(this.getFs(),this.type)}}getPolygonColorPrimitiveShader(){return{vertexShaderSource:Cesium.ShaderSource.replaceMain(this.getPolygonColorPrimitiveVs(),this.type),fragmentShaderSource:Cesium.ShaderSource.replaceMain(this.getFs(),this.type)}}getGlobeSurfaceVS(){return` varying vec3 v_xh_position1; void main(){ #ifdef QUANTIZATION_BITS12 vec2 xy = czm_decompressTextureCoordinates(compressed0.x); vec2 zh = czm_decompressTextureCoordinates(compressed0.y); vec3 position = vec3(xy, zh.x); float height = zh.y; vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; position = (u_scaleAndBias * vec4(position, 1.0)).xyz; #else // A single float per element vec3 position = position3DAndHeight.xyz; #endif v_xh_position1 = position + u_center3D; } `}getPolygonColorPrimitiveVs(){return"varying vec3 v_xh_position1;\nvoid main(){\n v_xh_position1 = position3DHigh + position3DLow;\n}\n"}getFs(){var o,t;let l="";for(o in this.lightMap){var u=this.lightMap[o].polygon||[new Cesium.Cartesian3],h=this.lightMap[o].position;let t=this.lightMap[o].speed||600,e=this.lightMap[o].count||3,r=this.lightMap[o].direction||-1,i=this.lightMap[o].color||new Cesium.Color(.3,.5,.8,1),a=this.lightMap[o].isCircle||1,n=this.lightMap[o].radius||0;this.lightMap[o].polygon&&(a=-1);h=Cesium.Transforms.eastNorthUpToFixedFrame(h);let s=Cesium.Matrix4.inverse(h,new Cesium.Matrix4);var d,h="mat4 ienu_mat = mat4("+s[0].toFixed(15)+","+s[1].toFixed(15)+","+s[2].toFixed(15)+","+s[3].toFixed(15)+","+s[4].toFixed(15)+","+s[5].toFixed(15)+","+s[6].toFixed(15)+","+s[7].toFixed(15)+","+s[8].toFixed(15)+","+s[9].toFixed(15)+","+s[10].toFixed(15)+","+s[11].toFixed(15)+","+s[12].toFixed(15)+","+s[13].toFixed(15)+","+s[14].toFixed(15)+","+s[15].toFixed(15)+");\n";for(d in l+="int isInPolygonCircle"+o+"(vec2 checkPoint, vec2 polygonPoints["+u.length+"]) {\n int counter = 0;\n float xinters;\n vec2 p1;\n vec2 p2;\n const int pointCount = "+u.length+";\n p1 = polygonPoints[0];\n\t\n for (int i = 1; i < pointCount; i++) {\n p2 = polygonPoints[i ];\n if (checkPoint.x > min(p1.x, p2.x) && checkPoint.x <= max(p1.x, p2.x)) {\n if (checkPoint.y <= max(p1.y, p2.y)) {\n if (p1.x != p2.x) {\n xinters = (checkPoint.x - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;\n if (p1.y == p2.y || checkPoint.y <= xinters) {\n counter++;\n }\n }\n }\n }\n p1 = p2;\n }\n float f = float(counter) / 2.;\n float ff = f - floor(f);\n if(ff > 0.000001)\n return 1;\n else\n return 0;\n}\n",l+="void circleScan"+o+"(){\n",l+=h,l+="vec2 scan_polygon["+u.length+"];\n",u){let t=Cesium.Matrix4.multiplyByPoint(s,u[d],new Cesium.Cartesian3);l+="scan_polygon["+d+"] = vec2("+t.x.toFixed(5)+","+t.y.toFixed(5)+");\n"}l+="int isCircle = "+a+";\n",l+="float speed = "+t.toFixed(5)+";\n",l+="float rate = 1. / "+e.toFixed(5)+";\n",l+="float radius = "+n.toFixed(5)+";\n",l+="float direction = "+r.toFixed(5)+";\n",l+="vec3 color = vec3("+i.red.toFixed(5)+","+i.green.toFixed(5)+","+i.blue.toFixed(5)+");\n",l+=" vec4 tpoint = ienu_mat * vec4(v_xh_position1 ,1.);\n tpoint /= tpoint.w;\n vec2 txy = tpoint.xy;\n int f = 0;\n if(isCircle == 1)\n f = 1;\n else f = isInPolygonCircle"+o+"( txy, scan_polygon );\n if(f == 1){\n float time = fract(czm_frameNumber / speed) * direction;\n float rr = radius * time;\n float ring = rate * radius;\n float dis = length(txy);\n float f = abs(dis - rr) /ring;\n float ff = fract(f);\n if(dis < radius &&ff < rate){\n float ta = ff / rate ;\n gl_FragColor.rgb = mix(color,gl_FragColor.rgb,ta);\n }\n }\n}\n"}let e="void main(){\n";for(t in this.lightMap)e+=" circleScan"+t+"();\n";return e+="}\n","varying vec3 v_xh_position1;\n"+l+e}}e.exports=i},{"./Light.js":73}],82:[function(t,o,l){"use strict";o.exports.now=window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date);const e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;l.frame=function(t){return e(t)};const r=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;function i(t){return 0==(t&t-1)}function a(t){--t;for(var e=1;e<32;e<<=1)t|=t>>e;return t+1}l.cancelFrame=function(t){r(t)},l.timed=function(r,i,a){if(!i)return r.call(a,1),null;let n=!1;const s=o.exports.now();return l.frame(function t(e){n||((e=o.exports.now())>=s+i?r.call(a,1):(r.call(a,(e-s)/i),l.frame(t)))}),function(){n=!0}},l.getImageData=function(t){const e=window.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},l.createPowerOfTwoImageFromImage=function(t){var e;return i(t.width)&&i(t.height)||((e=window.document.createElement("canvas")).width=a(t.width),e.height=a(t.height),e.getContext("2d").drawImage(t,0,0,t.width,t.height),t=e),t},l.hardwareConcurrency=window.navigator.hardwareConcurrency||4,Object.defineProperty(l,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),l.supportsWebp=!1;const n=window.document.createElement("img");n.onload=function(){l.supportsWebp=!0},n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{}],83:[function(t,e,r){const{HTMLImageElement:o,HTMLCanvasElement:l,HTMLVideoElement:u,ImageData:h}=window;e.exports=class{constructor(t,e,r,i){this.gl=t,this.format=r,this.texture=t.createTexture(),this.update(e,i)}update(t,e,r){var{width:i,height:a}=t,n=!(this.size&&this.size[0]===i&&this.size[1]===a||r);const s=this.gl;this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),s.pixelStorei(s.UNPACK_ALIGNMENT,1),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.format===s.RGBA&&(!e||!1!==e.premultiply)),n?(this.size=[i,a],t instanceof o||t instanceof l||t instanceof u||t instanceof h?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,a,0,this.format,s.UNSIGNED_BYTE,t.data)):({x:n,y:r}=r||{x:0,y:0},t instanceof o||t instanceof l||t instanceof u||t instanceof h?s.texSubImage2D(s.TEXTURE_2D,0,n,r,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,n,r,i,a,s.RGBA,s.UNSIGNED_BYTE,t.data)),this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)}bind(t,e,r){const i=this.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){this.gl.deleteTexture(this.texture),this.texture=null}}},{}],84:[function(t,e,r){function n(t,{width:e,height:r},i,a){if(a){if(a.length!==e*r*i)throw new RangeError("mismatched image size")}else a=new Uint8Array(e*r*i);return t.width=e,t.height=r,t.data=a,t}function s(e,r,i,a,n,s){if(0===n.width||0===n.height)return r;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>r.width||n.height>r.height||a.x>r.width-n.width||a.y>r.height-n.height)throw new RangeError("out of range destination coordinates for image copy");var o=e.data;const l=r.data;for(let t=0;t{let i=[],a=-9999,n=[];for(let t=0,e=r.length;t=h.x&&n[t].y>=h.y&&n[t].z>=h.z&&(h=n[t]),e[t].x<=u.x&&e[t].y<=u.y&&e[t].z<=u.z&&(u=e[t])}t=Cesium.Cartesian3.subtract(h,u,new Cesium.Cartesian3),t=.5*Cesium.Cartesian3.magnitude(t);return new Cesium.Geometry({attributes:s,indices:o,primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:new Cesium.BoundingSphere(Cesium.Cartesian3.ZERO,t)})}}},{}],91:[function(t,e,r){var i=t("./TerrainEditBase");const a=t("./Pit");class n extends i{constructor(t,e={}){super(t,e),this._clipOutSide=Cesium.defaultValue(e.clipOutSide,!1)}get terrainEditCtl(){return this._map.scene.globe._surface.tileProvider._excavateAnalysis}get clipOutSide(){return this.terrainEditCtl.showTailorOnly}set clipOutSide(t){this.terrainEditCtl.showTailorOnly=t}get diffHeight(){return this.options.diffHeight}set diffHeight(t){this.options.diffHeight=t}clear(){for(let e=0;e{var t=t.positions;t&&(t=Cesium.BoundingSphere.fromPoints(t),Cesium.Cartesian3.add(e,t.center,e))}),this.totalCenter=Cesium.Cartesian3.multiplyByScalar(e,1/this._areaList.length,new Cesium.Cartesian3)}_prepareFlood(){const f=this._map.scene.context;this.trans=Cesium.Transforms.eastNorthUpToFixedFrame(this.totalCenter),this.inverTrans=Cesium.Matrix4.inverse(this.trans,new Cesium.Matrix4);let m=99999999,v=99999999,p=-99999999,c=-99999999;this._areaList.forEach(t=>{var e=t.positions,r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e)}),i=(r=Cesium.PolygonGeometry.createGeometry(r)).indices,a=r.attributes.position.values,n=a.length;let s=[],o=[];for(let e=0;e=t.x&&(m=t.x),v>=t.y&&(v=t.y),p<=t.x&&(p=t.x),c<=t.y&&(c=t.y)}t.localPos=s;e=new Float64Array(o),r=Cesium.BoundingSphere.fromVertices(e),e=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})},indices:i,primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:r}),i=Cesium.ShaderProgram.fromCache({context:f,vertexShaderSource:`attribute vec3 position; void main() { vec4 pos = vec4(position.xyz,1.0); gl_Position = czm_projection*pos; }`,fragmentShaderSource:`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }`,attributeLocations:{position:0}}),e=Cesium.VertexArray.fromGeometry({context:f,geometry:e,attributeLocations:i._attributeLocations,bufferUsage:Cesium.BufferUsage.STATIC_DRAW,interleave:!0});let d=new Cesium.RenderState;d.depthRange.near=-1e6,d.depthRange.far=1e6,t.drawAreaCommand=new Cesium.DrawCommand({boundingVolume:r,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:e,shaderProgram:i,renderState:d,pass:Cesium.Pass.TRANSLUCENT})}),this.ratio=(c-v)/(p-m),this.totalRect=[m,v,p,c]}prepareCamera(){this.ortCamera={viewMatrix:Cesium.Matrix4.IDENTITY,inverseViewMatrix:Cesium.Matrix4.IDENTITY,frustum:new Cesium.OrthographicOffCenterFrustum,positionCartographic:{height:0,latitude:0,longitude:0},positionWC:new Cesium.Cartesian3(0,0,6e4),directionWC:new Cesium.Cartesian3(0,0,-1),upWC:new Cesium.Cartesian3(0,1,0),rightWC:new Cesium.Cartesian3(1,0,0),viewProjectionMatrix:Cesium.Matrix4.IDENTITY},this.ortCamera.frustum.left=this.totalRect[0],this.ortCamera.frustum.top=this.totalRect[3],this.ortCamera.frustum.right=this.totalRect[2],this.ortCamera.frustum.bottom=this.totalRect[1],this.ortCamera.frustum.near=.1,this.ortCamera.frustum.far=-12e4,this.floodRect=new Cesium.Cartesian4(this.totalRect[0],this.totalRect[1],this.totalRect[2]-this.totalRect[0],this.totalRect[3]-this.totalRect[1])}prepareFBO(){let t,e;e=1{const e=t.drawAreaCommand;e&&t.show&&(a.updatePass(e.pass),e.framebuffer=this.yanmoFbo,e.execute(r,i))})}beginTailor(){this.terrainEditCtl.inverFloodCenterMat=this.inverTrans,this.terrainEditCtl.floodArea=this.yanmoFbo,this.terrainEditCtl.enableFlood=!0,this.terrainEditCtl.floodRect=this.floodRect,this.terrainEditCtl.globe=!1}_setFloodVar(){this.floodVar=[this.minHeight,this.minHeight,this.maxHeight,this.maxHeight-this.minHeight]}removeArrayItem(t,e){e=t.indexOf(e);return-1{const e=t.drawCommand;e&&t.show&&(i.updatePass(e.pass),e.framebuffer=this.fbo,e.execute(r,this._passState))})}}_activeModelEditor(){}deActiveEdit(){this.tileset.modelEditor.IsYaPing[0]=!1}_preparePos(){let n,s=99999,o=this.matrix;this._areaList.forEach(t=>{if(t.show){let e=[];var r=t.positions;if(r&&2{var i=r.localPos;if(i){var a=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(i),perPositionHeight:!0}),n=Cesium.PolygonGeometry.createGeometry(a),s=Cesium.ShaderProgram.fromCache({context:o,vertexShaderSource:`uniform mat4 myPorjection; attribute vec3 position; varying vec2 depth; void main() { vec4 pos = vec4(position.xyz,1.0); depth = pos.zw; pos.z = 0.0; gl_Position = czm_projection*pos; }`,fragmentShaderSource:`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif #define OES_texture_float_linear varying vec2 depth; vec4 packDepth(float depth) { vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; enc = fract(enc); enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); return enc; } void main() { float fDepth = (depth.x / 5000.0)/2.0 + 0.5; // gl_FragColor = packDepth(fDepth); gl_FragColor = vec4(1.0,0.0,0.0,1.0); }`,attributeLocations:{position:0}}),i=Cesium.VertexArray.fromGeometry({context:o,geometry:n,attributeLocations:s._attributeLocations,bufferUsage:Cesium.BufferUsage.STATIC_DRAW,interleave:!0});let t=new Cesium.RenderState;t.depthTest.enabled=!1,t.depthRange.near=-1e6,t.depthRange.far=1e6;a=Cesium.BoundingRectangle.fromPoints(r.localPos,new Cesium.BoundingRectangle);l>a.x&&(l=a.x),u>a.y&&(u=a.y),h=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function f(t){return null!=t&&t._isBuffer}function m(t,e){if(f(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var r=(t="string"!=typeof t?""+t:t).length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return T(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;default:if(i)return T(t).length;e=(""+e).toLowerCase(),i=!0}}function e(t,e,r){var i=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var i=t.length;(!e||e<0)&&(e=0);(!r||r<0||i=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if(f(e="string"==typeof e?w.from(e,i):e))return 0===e.length?-1:p(t,e,r,i,a);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(a?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):p(t,[e],r,i,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,i,a){var n=1,s=t.length,o=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s/=n=2,o/=2,r/=2}function l(t,e){return 1===n?t[e]:t.readUInt16BE(e*n)}if(a)for(var u=-1,h=r;h>8,i=i%256,a.push(i),a.push(r);return a}(e,t.length-r),t,r,i)}function y(t,e,r){r=Math.min(t.length,r);for(var i=[],a=e;a>>10&1023|55296),h=56320|1023&h),i.push(h),a+=d}return function(t){var e=t.length;if(e<=V)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i"},w.prototype.compare=function(t,e,r,i,a){if(!f(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),(e=void 0===e?0:e)<0||r>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(a<=i&&r<=e)return 0;if(a<=i)return-1;if(r<=e)return 1;if(this===t)return 0;for(var n=(a>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),o=Math.min(n,s),l=this.slice(i,a),u=t.slice(e,r),h=0;hthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var n,s,o,l=!1;;)switch(i){case"hex":return function(t,e,r,i){r=Number(r)||0;var a=t.length-r;if((!i||a<(i=Number(i)))&&(i=a),(a=e.length)%2!=0)throw new TypeError("Invalid hex string");a/2t.length)throw new RangeError("Index out of range")}function W(t,e,r,i){e<0&&(e=65535+e+1);for(var a=0,n=Math.min(t.length-r,2);a>>8*(i?a:1-a)}function N(t,e,r,i){e<0&&(e=4294967295+e+1);for(var a=0,n=Math.min(t.length-r,4);a>>8*(i?a:3-a)&255}function X(t,e,r,i){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,i,a){return a||X(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function P(t,e,r,i,a){return a||X(t,0,r,8),n.write(t,e,r,i,52,8),r+8}function T(t,e){var r;e=e||1/0;for(var i=t.length,a=null,n=[],s=0;s>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function S(t,e,r,i){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function g(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}w.prototype.slice=function(t,e){var r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):r>>8):W(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,i){t=+t,e|=0,i||x(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var a=0,n=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},w.prototype.writeIntBE=function(t,e,r,i){t=+t,e|=0,i||x(this,t,e,r,(i=Math.pow(2,8*r-1))-1,-i);var a=r-1,n=1,s=0;for(this[e+a]=255&t;0<=--a&&(n*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/n>>0)-s&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,i){if(r=r||0,i||0===i||(i=this.length),e>=t.length&&(e=t.length),(i=0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var a,n=(i=t.length-e>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o>24&255,t>>16&255,t>>8&255,255&t]}static bytesToInt(t){return t[0]<<24|t[1]<<16|t[2]<<8|t[3]}static varintToInt(e){let r=[],i=[],a=3,n=0;for(let t=e.length-1;0<=t&&(0<=t-1?i[0]=e[t-1]<<7-n:i[0]=0,-1!==a);t--)r[a]=(127&e[t])>>n|i[0],a--,n++;var t=r[0]<<24&4278190080|r[1]<<16&16711680|r[2]<<8&65280|255&r[3];return t=t>>1^-(1&t)}static intToVarint(e){if(0===e)return[0];e=this._zigZagEncoding(e);let r=[],i,a=0;for(let t=5;0>7*(t-1)&127,0!==a&&(i|=128),0!==i&&r.push(i),a=i;return r}static varintToIntArray(e){let r=[];let i=0,a=[];for(let t=0;t>7&1)&&0>31^t<<1}}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:2}],99:[function(t,e,r){e.exports=class{constructor(t){this._viewer=t,this.entity=null,this.handler=null,this.moving=!1,this._leftDown=this._leftDownHandler.bind(this),this._leftUp=this._leftUpHandler.bind(this),this._move=this._moveHandler.bind(this),this.handler=new Cesium.ScreenSpaceEventHandler(this._viewer.canvas)}enable(){this.handler.setInputAction(this._leftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(this._leftUp,Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.setInputAction(this._move,Cesium.ScreenSpaceEventType.MOUSE_MOVE)}disable(){this._viewer.scene.screenSpaceCameraController.enableRotate=!0,this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.moving=!1,this.entity=null}_leftDownHandler(t){this.entity=this._viewer.scene.pick(t.position),this.moving=!0,this.entity&&(this._viewer.scene.screenSpaceCameraController.enableRotate=!1)}_leftUpHandler(){this.moving=!1,this.entity=null,this._viewer.scene.screenSpaceCameraController.enableRotate=!0}_moveHandler(t){if(this.moving&&this.entity&&this.entity.id){t=this._viewer.camera.getPickRay(t.endPosition),t=this._viewer.scene.globe.pick(t,this._viewer.scene);const e=viewer.scene.globe.ellipsoid,r=e.cartesianToCartographic(t);t=this.entity.id.position.getValue();const i=e.cartesianToCartographic(t);this.entity.id.position=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3.fromRadians(r.longitude,r.latitude,i.height)},!1)}}}},{}],100:[function(t,e,r){e.exports=class{constructor(t){this._viewer=t,this.entity=null,this.handler=null,this.moving=!1,this._leftDown=this._leftDownHandler.bind(this),this._leftUp=this._leftUpHandler.bind(this),this._move=this._moveHandler.bind(this),this.handler=new Cesium.ScreenSpaceEventHandler(this._viewer.canvas)}enable(){this.handler.setInputAction(this._leftDown,Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(this._leftUp,Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.setInputAction(this._move,Cesium.ScreenSpaceEventType.MOUSE_MOVE)}disable(){this._viewer.scene.screenSpaceCameraController.enableRotate=!0,this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.moving=!1,this.entity=null}_leftDownHandler(t){this.entity=this._viewer.scene.pick(t.position),this.moving=!0,this.entity&&(this._viewer.scene.screenSpaceCameraController.enableRotate=!1)}_leftUpHandler(){this.moving=!1,this.entity=null,this._viewer.scene.screenSpaceCameraController.enableRotate=!0}_moveHandler(t){this.moving&&this.entity&&this.entity.primitive&&(t=this._viewer.camera.getPickRay(t.endPosition),t=this._viewer.scene.globe.pick(t,this._viewer.scene),this.entity.primitive.modelMatrix=Cesium.Matrix4.setTranslation(this.entity.primitive.modelMatrix,t,new Cesium.Matrix4),this.entity.primitive.resetDrawCommands&&this.entity.primitive.resetDrawCommands())}}},{}],101:[function(t,e,r){const f=Cesium.when;e.exports=class{static getDBMap(r,n){let t=f.defer(),s=[];for(let e=0;e=e[0]&&t[1]>=e[1]&&t[2]<=e[2]&&t[3]<=e[3]}static Utf8ArrayToStr(t){for(var e,r,i,a="",n=t.length,s=0;s>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(e);break;case 12:case 13:r=t[s++],a+=String.fromCharCode((31&e)<<6|63&r);break;case 14:r=t[s++],i=t[s++],a+=String.fromCharCode((15&e)<<12|(63&r)<<6|(63&i)<<0)}return a}}e.exports=v},{}],104:[function(t,e,r){!function(t){!function(){e.exports=class{constructor(){this.layerHeaderProBuffer=t.alloc(0),this.coordinateBufferArray=[],this.featureArray=[]}getLayerHeaderProBuffer(){return this.layerHeaderProBuffer}setLayerHeaderProBuffer(t){this.layerHeaderProBuffer=t}getFeatureArray(){return this.featureArray}setFeatureArray(t){this.featureArray=t}getCoordinateBufferArray(){return this.coordinateBufferArray}setCoordinateBufferArray(t){this.coordinateBufferArray=t}}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:2}],105:[function(t,e,r){e.exports=class{static composeShader(t){var e,r;let i="",a="";for(r in t){var n=t[r];i=i+n.name+"();",a+=n.shader}return e="void main(){\n"+i+"}",a+e}static composeMainShader(t,e){var r=t.split(/void\s+main\s*\(\s*(?:void)?\s*\)/g),t=r[0];let i=r[1];r=i.lastIndexOf("}");i=i.substring(0,r);let a="",n="";for(var s in e){var o=e[s];a=a+o.name+"();",n+=o.shader}return t=t+n+"void main()\n"+i+a+"}",console.log(t),t}}},{}],106:[function(t,e,r){function n(t,e,r={}){return e&&(t&&t.scene&&(t=t.scene),(Cesium.defaultValue(r.has3dtiles,!1)?i:s)(t,e,r))}function i(r,i,a={}){a.cartographic=a.cartographic||Cesium.Cartographic.fromCartesian(i);var t=a.cartographic;let n=a.callback;if(a.asyn)r.clampToHeightMostDetailed([i],a.objectsToExclude,.2).then(function(t){var e=t[0];if(Cesium.defined(e)){t=Cesium.Cartographic.fromCartesian(e),e=t.height;if(Cesium.defined(e)&&-1e3>7&1)&&0=e[0]&&t[1]>=e[1]&&t[2]<=e[2]&&t[3]<=e[3]}}e.exports=v},{}],113:[function(t,e,r){e.exports=class{constructor(t,e,r,i){var a=t/e,e=r/e;this.maxPerCell=null==i?1:i,this.cells={},this.d=a+2*e,this.n=a,this.padding=e,this.scale=a/t;a=e/a*t;this.min=-a,this.max=t+a}filter(t,e){if(tthis.max||ethis.max)return!1;t=this.convertToCellCoord(t),e=this.convertToCellCoord(e),e=this.d*e+t;if(this.cells[e]>=this.maxPerCell)return!1;t=this.cells[e];return this.cells[e]=null==t?1:+t,!0}filterByBox(t){var r=this.convertToCellCoord(t[0]),i=this.convertToCellCoord(t[2]),a=this.convertToCellCoord(t[1]),n=this.convertToCellCoord(t[3]);for(let e=r;e<=i;e++)for(let t=a;t<=n;t++){var s=this.d*t+e;if(this.cells[s])return!1}for(let e=r;e<=i;e++)for(let t=a;t<=n;t++){var o=this.d*t+e;this.cells[o]=1}return!0}clean(){this.cells={},this.saveCount=0}convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}}},{}],114:[function(t,e,r){e.exports={read:function(t,e,r,i,a){var n,s,o=8*a-i-1,l=(1<>1,h=-7,d=r?a-1:0,f=r?-1:1,r=t[e+d];for(d+=f,n=r&(1<<-h)-1,r>>=-h,h+=o;0>=-h,h+=i;0>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:n-1,m=i?1:-1,n=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(i=Math.pow(2,-s))<1&&(s--,i*=2),2<=(e+=1<=s+h?d/i:d*Math.pow(2,1-h))*i&&(s++,i/=2),u<=s+h?(o=0,s=u):1<=s+h?(o=(e*i-1)*Math.pow(2,a),s+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,a),s=0));8<=a;t[r+f]=255&o,f+=m,o/=256,a-=8);for(s=s<>>i!=e)return-1;if(r|=e<>>2))){if(s<=o+3)return!1;i=r-60,r=1+((r=n[o]+(n[o+1]<<8)+(n[o+2]<<16)+(n[o+3]<<24))&u[i]),o+=i}if(s>>2&7),a=n[o]+(e>>>5<<8),o+=1;break;case 2:if(s<=o+1)return!1;r=1+(e>>>2),a=n[o]+(n[o+1]<<8),o+=2;break;case 3:if(s<=o+3)return!1;r=1+(e>>>2),a=n[o]+(n[o+1]<<8)+(n[o+2]<<16)+(n[o+3]<<24),o+=4}if(0===a||l