UNPKG

@mapgis/webclient-cesium-plugin

Version:

A lightweight 3D GIS network client development platform based on WebGL.

1 lines 2.06 MB
!function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=25)}([function(e,t){e.exports=function(){try{return window.MapGISCommon}catch(e){return{}}}()},function(module,__webpack_exports__,__webpack_require__){"use strict";var _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__),_DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2);function convertTextSymbolOptions(e,t){const i={};t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{});const n=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.layerOpacity,1);let r={};if(e){r=e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Symbol?e.toJSON():e;const t=(r=JSON.parse(JSON.stringify(r))).font||{};let{verticalAlignment:s,horizontalAlignment:a}=e;const{textWraps:o,rotated:l,textDecorationUnderlineWidth:u,textDecorationUnderlineColor:c,textDecorationThroughlineColor:h,textDecorationThroughlineWidth:d,textShadowColor:p,textShadowBlur:m,textExtraIcon:f,backgroundColor:y,backgroundImage:g}=e;let _,C;switch(s){case"middle":C=Cesium.VerticalOrigin.CENTER;break;case"top":C=Cesium.VerticalOrigin.TOP;break;case"bottom":C=Cesium.VerticalOrigin.BOTTOM;break;case"baseline":default:C=Cesium.VerticalOrigin.BASELINE}switch(a){case"center":_=Cesium.HorizontalOrigin.CENTER;break;case"left":_=Cesium.HorizontalOrigin.LEFT;break;case"right":_=Cesium.HorizontalOrigin.RIGHT;break;default:_=Cesium.HorizontalOrigin.CENTER}i.horizontalOrigin=_,i.verticalOrigin=C,r.textWraps=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(o,!0),l||(r.angle=0),(0!==u&&c||"underline"===t.decoration)&&(r.showTextDecorationUnderline=!0),(0!==d&&h||"line-through"===t.decoration)&&(r.showTextDecorationThroughline=!0),p&&0!==m&&(r.showTextShadow=!0),void 0!==r.letterSpacing&&(r.letterSpacing+="px"),y||g?(r.showBackground=!0,r.backgroundImage=g,r.backgroundColor=y):(r.showBackground=!1,r.backgroundColor=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color(0,0,0,1)),["color","haloColor","backgroundColor","borderLineColor","textDecorationUnderlineColor","textDecorationThroughlineColor","textShadowColor"].forEach(e=>{if(r[e]){const t=_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color.fromColor(r[e]);t.alpha*=n,r[e]=t.toCssRGBAString()}}),f&&(r.showTextExtraIcon=!0,r.textExtraIcon=e.textExtraIcon,r.textExtraIconAnchor=e.textExtraIconAnchor,r.textExtraIconSize=e.textExtraIconSize),r.yoffset*=-1,r.lineMaxNum=Number.MAX_VALUE}return i.symbol=r,i}class CesiumPluginUtil{static convertColorToRgb(e){return e instanceof _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color?Cesium.Color.fromCssColorString(e.toCssRGBAString()):"string"==typeof e?Cesium.Color.fromCssColorString(e):(e=new _mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Color,Cesium.Color.fromCssColorString(e.toCssRGBAString()))}static convertTextSymbolToLabelNoteStyle(e,t){const i=convertTextSymbolOptions(e,t);return _DynamicLabelsUtil__WEBPACK_IMPORTED_MODULE_1__.a.parseNoteOptions("Point",i)}static convertLabelClassToLabelNoteStyle(e){const{symbol:t}=e,i=e.extensionOptions?e.extensionOptions:{},n=convertTextSymbolOptions(t);n.minScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.minScale,e.minScale),n.maxScale=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(i.maxScale,e.maxScale),e.labelPlacement&&(n.labelPlacement=e.labelPlacement),n.repeatLabel=e.repeatLabel,n.repeatLabelDistance=e.repeatLabelDistance,n.repeatStartRate=e.repeatStartRate,n.repeatEndRate=e.repeatEndRate,n.lineLabelSpread=e.lineLabelSpread,n.labelPositionAlong=e.labelPositionAlong,n.skeletonLineStartRate=e.skeletonLineStartRate,n.skeletonLineEndRate=e.skeletonLineEndRate,n.groundScale=e.groundScale;const r=e.elevationInfo,{mode:s,offset:a,featureExpressionInfo:o,unit:l}=r;let u=1;"mile"===l?u=1609.34:"kilometers"===l&&(u=1e3),n.labelHeight=a*u;let c=0;return"OnTheGround"===s?c=1:"RelativeToGround"===s&&(c=2),n.heightReference=c,Object.entries(i).forEach(e=>{n[e[0]]=e[1]}),n}static parseExpression(feature,expression){if(!expression)return"";const excuteStr=expression.replace(/\$feature/g,"feature.attributes");try{const v=eval(excuteStr);return v}catch(e){_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.Log.info("字段表达式输入值非法")}return""}static toCartesian3Position(e,t){let i;return i="degrees"===t?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]):Cesium.Cartesian3.fromRadians(e[0],e[1],e[2])}static createBillboardOptions(e,t){(t=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t,{})).heightReference=Object(_mapgis_webclient_common__WEBPACK_IMPORTED_MODULE_0__.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=t.graphic,n=i._feature.symbol;let r;r=i._canvas?i._canvas:n.url;let s={show:i.show,position:e,image:r,color:new Cesium.Color(1,1,1,i._layerOpacity*n.color.alpha),width:n.size||n.width,height:n.size||n.height,pixelOffset:new Cesium.Cartesian2(n.xoffset,-1*n.yoffset),verticalOrigin:Cesium.VerticalOrigin.CENTER,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,heightReference:t.heightReference,rotation:n.angle};return s=Object.assign(s,n.extensionOptions)}static calcRhumbArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),n=Cesium.Cartesian3.fromDegrees(t[0],t[1]),r=Cesium.Ellipsoid.WGS84;e=r.cartesianToCartographic(i),t=r.cartesianToCartographic(n);const s=new Cesium.EllipsoidRhumbLine(e,t,r),a=s.surfaceDistance/2,o=s.interpolateUsingSurfaceDistance(a,t),l=Cesium.Math.toDegrees(o.longitude),u=Cesium.Math.toDegrees(o.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,u,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,u]}static calcCartesianArcCenter(e,t){const i=Cesium.Cartesian3.fromDegrees(e[0],e[1]),n=Cesium.Cartesian3.fromDegrees(t[0],t[1]),r=Cesium.Ellipsoid.WGS84;e=r.cartesianToCartographic(i),t=r.cartesianToCartographic(n);const s=new Cesium.EllipsoidGeodesic;s.setEndPoints(e,t);const a=s.surfaceDistance/2,o=s.interpolateUsingSurfaceDistance(a,t),l=Cesium.Math.toDegrees(o.longitude),u=Cesium.Math.toDegrees(o.latitude);if(void 0!==e[2]&&void 0!==t[2]){return[l,u,((e[2]?e[2]:0)+(t[2]?t[2]:0))/2]}return[l,u]}}__webpack_exports__.a=CesiumPluginUtil},function(e,t,i){"use strict";var n=i(0);function r(e,t,i,n,r,s,a,o,l,u,c,h,d){var p=!1,m=!1;if(0===l?m=!0:1===l?p=!0:(p=!0,m=!0),!t.includes("#=")||t.includes("#-")||t.includes("#+")||(t=t.replace("#=","")),f(t)){var _=t.split("/"),C=_[1],v=_[2];if(_.length>4)v=_.slice(2,_.length-1).join("/");var b=r,x=A=parseInt(c.fontSize);e.textBaseline="middle";var w=e.measureText(C).width,T=e.measureText(v).width,S=w>T?w:T,M=A/2;p&&(e.strokeText(C,b+S/2-w/2,x-M),e.strokeText(v,b+S/2-T/2,x+M)),m&&(e.fillText(C,b+S/2-w/2,x-M),e.fillText(v,b+S/2-T/2,x+M));return e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(b,x),e.lineTo(b+S,x),e.lineWidth=1,e.stroke(),e.closePath(),c.fontStyle&&"normal"!==c.fontStyle&&(S+=.5*A),{width:S*d,height:h.height}}if(y(t)){var E=t,P=0,A=parseInt(c.fontSize),D=c.font,I=`${c.fontStyle} ${c.fontVariant} ${c.fontWeight} ${.666*A}px ${c.fontFamily}`,L=(b=r,x=A/2/d+A/2+s,0);e.textBaseline="middle";M=A/3;for(var k=E.split("#"),R=k[0],O=1;O<k.length;O++){var B=k[O];if(/^[-+=]$/.test(B[0]))break;R+="#"+B}if(R.length>0){g(e,R,b,x,D,m,p);var F=e.measureText(R).width;b+=F,P+=F}var V=[];(k=(E=E.slice(R.length)).split("#")).shift();for(O=0;O<k.length;O++)if(O>0&&/^[-+=]$/.test(k[O][0]))V.push(k[O]);else{var N=V.pop();Cesium.defined(N)||(N="");var z=0===O?"":"#";V.push(N+z+k[O])}k=V;for(O=0;O<k.length;O++){var G=k[O],j=G[0],H=G.substring(1);if("+"===j)g(e,H,b,x-M,I,m,p),L=L>(U=e.measureText(H).width)?L:U;else if("-"===j){var U;g(e,H,b,x+M,I,m,p),L=L>(U=e.measureText(H).width)?L:U}else if("="===j){g(e,H,b+=L,x,D,m,p),b+=o=e.measureText(H).width,P+=o}B=k[O+1];if(Cesium.defined(B))"="===B[0]&&(P+=L);else"+"!==j&&"-"!==j||(P+=L)}return c.fontStyle&&"normal"!==c.fontStyle&&(P+=.5*A),{width:P*d,height:h.height}}var W=e.measureText(t).width,q=a+s,Y=parseInt(u);if(W<i||-1===n)p&&e.strokeText(t,r,q),m&&e.fillText(t,r,q);else{var K=t.split(""),X=0,Z=0,J=r,Q=s+a,$=0;for(O=0;O<K.length;O++){H=K[O];var ee=e.measureText(H).width;X+ee-Y===o&&(ee-=Y),X+=ee,Z=ee,$<=n&&(X<=o?J=r+X-Z:(Z=0,X=ee,J=r,Q=a*(($+=1)+1)+s),p&&e.strokeText(H,J,Q),m&&e.fillText(H,J,Q))}}}function s(e,t){var i=void 0!==t?t:{},n=f(e),s=y(e),a=Cesium.defaultValue(i.textWraps,!0),l=Cesium.defaultValue(i.lineWidth,80),c=Cesium.defaultValue(i.lineMaxNum,3),h=0;i.drawStyles&&i.drawStyles.haloSize&&(h=i.drawStyles.haloSize);var d=Cesium.defaultValue(i.showBackground,!1),p=5,m=5;Cesium.defined(i.backgroundPadding)&&(Array.isArray(i.backgroundPadding)?(p=i.backgroundPadding[0],m=i.backgroundPadding[1]):(p=i.backgroundPadding,m=i.backgroundPadding));var g=i.backgroundImage,_=Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)");d||(p=0,m=0),(!a||n||s)&&(c=-1);var C=Cesium.defaultValue(i.fontStyleOptions,{}),v=new o(C),b=Cesium.defaultValue(i.lineHeight,Cesium.defaultValue(parseInt(v.fontSize)),20),x=u(e,v,l,c,b,i.letterSpacing),w=document.createElement("canvas"),T=w.getContext("2d"),S=e,M=i.textDefinition<=1?1:i.textDefinition,E=0;v.fontStyle&&"normal"!==v.fontStyle&&(E=.5);var P=p+h,A=m+h,D=x.right+E*parseInt(v.fontSize)+2*P,I=x.bottom+2*A;T.save(),T.font=`${C.fontSize} ${C.fontFamily}`,n?(D=T.measureText(S).width,I=2*parseInt(v.fontSize)):s&&(D=T.measureText(S).width,I+=.3*parseInt(v.fontSize)),T.restore();var L=[0,0],k=[0,0],R=Cesium.defaultValue(i.showTextExtraIcon,!1),O=Cesium.defaultValue(i.textExtraIconSize,20),B=Cesium.defaultValue(i.textExtraIcon,"");if(R)switch(i.textExtraIconAnchor){case"top":L=[0,O],k=[D/2-O/2,0],D+=0,I+=O;break;case"left":L=[O,0],k=[0,I/2-O/2],D+=O,I+=0;break;case"right":L=[0,0],k=[D,I/2-O/2],D+=O,I+=0;break;case"bottom":L=[0,0],k=[D/2-O/2,I],D+=0,I+=O;break;default:L=[0,O],k=[D/2-O/2,0],D+=0,I+=O}var F=D*M,V=I*M;w.width=F,w.height=V,T.scale(M,M),document.body.appendChild(w),T.save(),d&&("function"==typeof g?g(T,L[0],L[1],D,I):g?T.drawImage(g,L[0],L[1],D,I):(T.fillStyle=_,T.fillRect(L[0],L[1],D,I))),T.restore(),R&&B&&(T.save(),T.drawImage(B,k[0],k[1],O,O),T.restore()),T.save(),w.style.letterSpacing=i.letterSpacing,T.font=v.font,T.textBaseline="bottom";var N=Cesium.defaultValue(i.drawStyles,{}),z=Cesium.defaultValue(i.drawMode,0);T.fillStyle=N.color,T.strokeStyle=N.haloColor,T.lineWidth=N.haloSize,Cesium.defaultValue(i.showTextShadow,!1)&&(T.shadowOffsetX=i.textShadowOffsetX,T.shadowOffsetY=i.textShadowOffsetY,T.shadowColor=i.textShadowColor,T.shadowBlur=i.textShadowBlur);var G=r(T,S,l,c,P+L[0],A+L[1],b,x.right,z,i.letterSpacing,v,w,M);if(T.restore(),function(e,t,i,n,r,s,a,o){for(var l=s/a,u=Cesium.defaultValue(o.showTextDecorationUnderline,!1),c=Cesium.defaultValue(o.textDecorationUnderlineColor,"rgba(0,0,0,1)"),h=Cesium.defaultValue(o.textDecorationUnderlineWidth,1),d=Cesium.defaultValue(o.showTextDecorationThroughline,!1),p=Cesium.defaultValue(o.textDecorationThroughlineColor,"rgba(0,0,0,1)"),m=Cesium.defaultValue(o.textDecorationThroughlineWidth,1),f=(i-r-s)/2+r,y=0;y<l;y++)g(e,t,f,a),f+=a;function g(e,t,i,r){e.save(),d&&(e.beginPath(),e.lineWidth=m,e.strokeStyle=p,e.moveTo(n,i+r/2),e.lineTo(t+n,i+r/2),e.stroke()),e.restore(),e.save(),u&&(e.beginPath(),e.lineWidth=h,e.strokeStyle=c,e.moveTo(n,i+r),e.lineTo(t+n,i+r),e.stroke()),e.restore()}}(T,x.right,I,L[0],L[1],x.bottom,b,i),document.body.removeChild(w),Cesium.defined(G)){var j=document.createElement("canvas");j.width=G.width,j.height=G.height,j.getContext("2d").drawImage(w,0,0),w=j}return w}function a(e,t,i){var n=a.canvas||(a.canvas=document.createElement("canvas")),r=n.getContext("2d"),s=0;return r.font=t,i&&(n.style.letterSpacing=i.letterSpacing,s=(e.split("").length-1)*parseFloat(i.letterSpacing)),r.measureText(e).width+s}function o(e){var t=Cesium.defaultValue(e.fontStyle,"normal"),i=Cesium.defaultValue(e.fontVariant,"normal"),n=Cesium.defaultValue(e.fontWeight,"normal"),r=Cesium.defaultValue(e.fontSize,"15px"),s=Cesium.defaultValue(e.fontFamily,"simHei"),a=t+" "+i+" "+n+" "+r+" "+s;this.font=a,this.fontStyle=t,this.fontVariant=i,this.fontWeight=n,this.fontSize=r,this.fontFamily=s}function l(e,t,i,n,r){if(!e)return"";var s,o,l=e.split(""),u=[],c=0,h=0;for(s=0;s<l.length;s++)if(h+=a(o=l[s],t.font),u.push(o),h>i){if(h=0,(c+=1)===n){u[u.length-1]="..";break}u.push("\n")}return"\n"===u[u.length-1]&&u.splice(u.length-1,1),u.toString().replace(/,/g,"")}function u(e,t,i,n,r,s){var o=a(e,t.font,{letterSpacing:s}),l=o/i,u=Math.ceil(l);if(-1===n||o<i)return{top:0,left:0,right:o,bottom:r};var c=0;return c=u<=n?u*r:n*r,{top:0,left:0,right:function(e,t,i,n){for(var r=e.split(""),s=parseInt(n),a=0,o=0;o<r.length;o++){var l=i(r[o]);if(!(a+l+s<=t)){a-=s;break}a+=l+s}return a}(e,i,function(e){return a(e,t.font,{letterSpacing:s})},s),bottom:c}}function c(e){var t=Cesium.defaultValue(e,{}),i=Cesium.defaultValue(t.symbol,{}),n=Cesium.defaultValue(i.font,{}),r=Cesium.defaultValue(t.pointDetail,t),s=Cesium.defaultValue(t.lineDetail,t),a=Cesium.defaultValue(t.polygonDetail,t);return{symbol:{color:Cesium.defaultValue(i.color,"rgba(0,0,0,1)"),haloColor:Cesium.defaultValue(i.haloColor,"rgba(255,255,255,0.5)"),haloSize:Cesium.defaultValue(i.haloSize,0),lineHeight:Cesium.defaultValue(i.lineHeight,1.1),lineWidth:Cesium.defaultValue(i.lineWidth,80),lineMaxNum:Cesium.defaultValue(i.lineMaxNum,3),textWraps:Cesium.defaultValue(i.textWraps,!1),letterSpacing:Cesium.defaultValue(i.letterSpacing,"0px"),xoffset:Cesium.defaultValue(i.xoffset,0),yoffset:Cesium.defaultValue(i.yoffset,0),angle:Cesium.defaultValue(i.angle,0),font:{size:Cesium.defaultValue(n.size,20),family:Cesium.defaultValue(n.family,"simHei"),weight:Cesium.defaultValue(n.weight,"normal"),style:Cesium.defaultValue(n.style,"normal")},showBackground:Cesium.defaultValue(i.showBackground,!1),backgroundColor:Cesium.defaultValue(i.backgroundColor,"rgba(42,42,42,0.8)"),backgroundPadding:Cesium.defaultValue(i.backgroundPadding,5),backgroundImage:Cesium.defaultValue(i.backgroundImage,void 0),showTextExtraIcon:Cesium.defaultValue(i.showTextExtraIcon,!1),textExtraIcon:Cesium.defaultValue(i.textExtraIcon,void 0),textExtraIconAnchor:Cesium.defaultValue(i.textExtraIconAnchor,"top"),textExtraIconSize:Cesium.defaultValue(i.textExtraIconSize,void 0),showTextDecorationUnderline:Cesium.defaultValue(i.showTextDecorationUnderline,!1),textDecorationUnderlineColor:Cesium.defaultValue(i.textDecorationUnderlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationUnderlineWidth:Cesium.defaultValue(i.textDecorationUnderlineWidth,1),showTextDecorationThroughline:Cesium.defaultValue(i.showTextDecorationThroughline,!1),textDecorationThroughlineColor:Cesium.defaultValue(i.textDecorationThroughlineColor,Cesium.defaultValue(i.color,"rgba(255,255,255,1)")),textDecorationThroughlineWidth:Cesium.defaultValue(i.textDecorationThroughlineWidth,1),showTextShadow:Cesium.defaultValue(i.showTextShadow,!1),textShadowOffsetX:Cesium.defaultValue(i.textShadowOffsetX,1),textShadowOffsetY:Cesium.defaultValue(i.textShadowOffsetY,1),textShadowColor:Cesium.defaultValue(i.textShadowColor,"#cccccc"),textShadowBlur:Cesium.defaultValue(i.textShadowBlur,2)},maxScale:Cesium.defaultValue(t.maxScale,void 0),minScale:Cesium.defaultValue(t.minScale,void 0),scaleByDistance:Cesium.defaultValue(t.scaleByDistance,void 0),distanceDisplayCondition:Cesium.defaultValue(t.distanceDisplayCondition,void 0),heightReference:Cesium.defaultValue(t.heightReference,void 0),disableDepthTestDistance:Cesium.defaultValue(t.disableDepthTestDistance,void 0),pixelOffsetScaleByDistance:Cesium.defaultValue(t.pixelOffsetScaleByDistance,void 0),translucencyByDistance:Cesium.defaultValue(t.translucencyByDistance,void 0),cstyle:Cesium.defaultValue(t.style,void 0),cshow:Cesium.defaultValue(t.show,!0),cposition:Cesium.defaultValue(t.position,void 0),ctext:Cesium.defaultValue(t.text,void 0),cfont:Cesium.defaultValue(t.font,void 0),cfillColor:Cesium.defaultValue(t.fillColor,void 0),coutlineColor:Cesium.defaultValue(t.outlineColor,void 0),coutlineWidth:Cesium.defaultValue(t.outlineWidth,void 0),cshowBackground:Cesium.defaultValue(t.showBackground,void 0),cbackgroundColor:Cesium.defaultValue(t.backgroundColor,void 0),cbackgroundPadding:Cesium.defaultValue(t.backgroundPadding,void 0),cpixelOffset:Cesium.defaultValue(t.pixelOffset,void 0),ceyeOffset:Cesium.defaultValue(t.eyeOffset,void 0),chorizontalOrigin:Cesium.defaultValue(t.horizontalOrigin,void 0),cverticalOrigin:Cesium.defaultValue(t.verticalOrigin,void 0),cscale:Cesium.defaultValue(t.scale,1),renderMode:Cesium.defaultValue(t.renderMode,"canvas"),groundScale:Cesium.defaultValue(t.groundScale,20),labelHeight:Cesium.defaultValue(t.labelHeight,0),repeatLabel:Cesium.defaultValue(t.repeatLabel,!0),repeatLabelDistance:Cesium.defaultValue(t.repeatLabelDistance,6e3),repeatStartRate:Cesium.defaultValue(t.repeatStartRate,.3),repeatEndRate:Cesium.defaultValue(t.repeatEndRate,.7),pointDetail:{labelPlacement:Cesium.defaultValue(r.labelPlacement,"above-center"),currentAttributeName:Cesium.defaultValue(r.currentAttributeName,"n")},lineDetail:{labelPlacement:Cesium.defaultValue(s.labelPlacement,"above-line"),lineLabelSpread:Cesium.defaultValue(s.lineLabelSpread,"auto-spread"),labelPositionAlong:Cesium.defaultValue(s.labelPositionAlong,"middle"),currentAttributeName:Cesium.defaultValue(s.currentAttributeName,"ln")},polygonDetail:{labelPlacement:Cesium.defaultValue(a.labelPlacement,"skeleton"),currentAttributeName:Cesium.defaultValue(a.currentAttributeName,"name"),skeletonLineStartRate:Cesium.defaultValue(a.skeletonLineStartRate,.4),skeletonLineEndRate:Cesium.defaultValue(a.skeletonLineEndRate,.6)}}}function h(e,t){var i=t.symbol;e.symbol=i,e.renderMode=t.renderMode;var n=i.font,r={};r.fontStyle=n.style,r.fontVariant="normal",r.fontWeight=n.weight,r.fontSize=n.size+"px",r.fontFamily=n.family,e.fontStyleOptions=r,e.lineWidth=i.lineWidth,e.lineHeight=Math.max(i.lineHeight,1.1)*n.size,e.letterSpacing=i.letterSpacing;var s={},a=t.cstyle;s.color=i.color,s.haloColor=i.haloColor,s.haloSize=i.haloSize,void 0===a&&(s.color&&"none"!==s.color&&(a=0),s.haloColor&&"none"!==s.haloColor&&0!==s.haloSize&&(a=0===a?2:1),void 0===a&&(a=0)),e.drawStyles=s,e.drawMode=a,e.rotated=Cesium.defaultValue(i.rotated,!1),e.angle=Cesium.defaultValue(i.angle,0),e.showBackground=i.showBackground,e.backgroundColor=i.backgroundColor,e.backgroundPadding=i.backgroundPadding,e.backgroundImage=i.backgroundImage,e.showTextExtraIcon=i.showTextExtraIcon,e.textExtraIcon=i.textExtraIcon,e.textExtraIconAnchor=i.textExtraIconAnchor,e.textExtraIconSize=Cesium.defaultValue(i.textExtraIconSize,n.size),e.showTextDecorationUnderline=i.showTextDecorationUnderline,e.textDecorationUnderlineColor=i.textDecorationUnderlineColor,e.textDecorationUnderlineWidth=i.textDecorationUnderlineWidth,e.showTextDecorationThroughline=i.showTextDecorationThroughline,e.textDecorationThroughlineColor=i.textDecorationThroughlineColor,e.textDecorationThroughlineWidth=i.textDecorationThroughlineWidth,e.showTextShadow=i.showTextShadow,e.textShadowOffsetX=i.textShadowOffsetX,e.textShadowOffsetY=i.textShadowOffsetY,e.textShadowColor=i.textShadowColor,e.textShadowBlur=i.textShadowBlur,e.verticalAlignment=i.verticalAlignment,e.horizontalAlignment=i.horizontalAlignment,e.defaultText=i.text,e.xoffset=i.xoffset,e.yoffset=i.yoffset,e.textWraps=i.textWraps,e.lineMaxNum=i.lineMaxNum,e.labelHeight=t.labelHeight,e.maxScale=t.maxScale,e.minScale=t.minScale,e.scaleByDistance=t.scaleByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightReference=t.heightReference,e.disableDepthTestDistance=t.disableDepthTestDistance,e.pixelOffsetScaleByDistance=t.pixelOffsetScaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.cshow=t.cshow,e.cposition=t.cposition,e.ctext=t.ctext,e.cfont=t.cfont,e.cfillColor=t.cfillColor,e.coutlineColor=t.coutlineColor,e.coutlineWidth=t.coutlineWidth,e.cshowBackground=t.cshowBackground,e.cbackgroundColor=t.cbackgroundColor,e.cbackgroundPadding=t.cbackgroundPadding,e.cpixelOffset=t.cpixelOffset,e.ceyeOffset=t.ceyeOffset,e.chorizontalOrigin=t.chorizontalOrigin,e.cverticalOrigin=t.cverticalOrigin,e.cscale=t.cscale,e.groundScale=t.groundScale,e.repeatLabel=t.repeatLabel,e.repeatLabelDistance=t.repeatLabelDistance,e.repeatStartRate=t.repeatStartRate,e.repeatEndRate=t.repeatEndRate;e.textDefinition=2}function d(e){var t={},i=c(e);h(t,i);for(var n=i.pointDetail;t.angle<0;)t.angle+=360;for(;t.angle>360;)t.angle-=360;t.currentAttributeName=n.currentAttributeName;var r=0,s=0;if(t.labelPlacement=Cesium.defaultValue(n.labelPlacement,"above-center"),"angle"===t.labelPlacement)r=0,s=0;else if("labels-layer"===t.labelPlacement)r=1,s=1;else switch(t.labelPlacement){case"center-center":r=0,s=0;break;case"center-left":r=-1,s=0;break;case"center-right":r=1,s=0;break;case"above-center":r=0,s=1;break;case"below-center":r=0,s=-1;break;case"above-left":r=-1,s=1;break;case"above-right":r=1,s=1;break;case"below-left":r=-1,s=-1;break;case"below-right":r=1,s=-1;break;default:r=0,s=0}return t.positionOffsetXRate=r,t.positionOffsetYRate=s,t}function p(e){var t={},i=c(e);h(t,i);var n=i.lineDetail;t.currentAttributeName=n.currentAttributeName,t.lineLabelSpread=n.lineLabelSpread,t.labelPositionAlong=n.labelPositionAlong,t.repeat=n.repeat,t.angle=0;var r=0,s=0;switch(t.type=Cesium.defaultValue(n.labelPlacement,"on-line"),t.type){case"on-line":r=0,s=0,t.xoffset=0,t.yoffset=0;break;case"above-line":r=0,s=1;break;case"below-line":r=0,s=-1;break;default:r=0,s=0,t.xoffset=0,t.yoffset=0}return t.positionOffsetXRate=r,t.positionOffsetYRate=s,t}function m(e){var t={},i=c(e);h(t,i),t.rotated=!1,t.angle=0;var n=i.polygonDetail;t.currentAttributeName=n.currentAttributeName,t.skeletonLineStartRate=n.skeletonLineStartRate,t.skeletonLineEndRate=n.skeletonLineEndRate;return t.positionOffsetXRate=0,t.positionOffsetYRate=1,t.type=n.labelPlacement,t}function f(e){var t=!1,i=e.charAt(0),n=e.charAt(e.length-1);if("/"===i&&"/"===n){var r=e.match(/\//g);r&&r.length>=3&&(t=!0)}return t}function y(e){var t=!1;return(e.includes("#+")||e.includes("#-"))&&(t=!0),t}function g(e,t,i,n,r,s,a){e.font=r,a&&e.strokeText(t,i,n),s&&e.fillText(t,i,n)}var _={drawText:r,createNoteCanvas:s,getTextWidth:a,calcNoteBounds:u,parseLabelsOption:c,FontStyleOptions:o,parseNoteOptions:function(e,t){if("Point"===e)return d(t);if("Line"===e)return p(t);if("Polygon"===e)return m(t);throw new Error("要素类型不匹配,无法解析注记选项!")},parsePointOptions:d,parseLineOptions:p,parsePolygonOptions:m,calcWrapsDetailText:l,createNoteBillBoardOptions:function(e,t,i,r){var a=s(t,r),o=r.positionOffsetXRate,l=r.positionOffsetYRate,u=r.textDefinition,c=r.scaleByDistance,h=r.distanceDisplayCondition;h=void 0===h?[r.maxScale,r.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(r.maxScale,r.minScale):r.distanceDisplayCondition;var d,p=r.heightReference||Cesium.HeightReference.NONE,m=r.disableDepthTestDistance||0,f=r.pixelOffsetScaleByDistance,y=r.translucencyByDistance,g=r.cshow,_=r.cposition,C=r.cpixelOffset,v=r.ceyeOffset,b=r.chorizontalOrigin,x=r.cverticalOrigin,w=r.cscale,T=r.xoffset,S=r.yoffset,M=r.angle,E=Cesium.Cartographic.fromCartesian(i);E.height=E.height+r.labelHeight,d=Cesium.Cartographic.toCartesian(E);var P=M/180*Math.PI,A=0,D=0;if("labels-layer"===r.type){var I=a.width;A=I/2*Math.cos(P),D=I/2*Math.sin(P)}return C&&(C=new Cesium.Cartesian2(C.x+A,C.y-D)),{show:g,image:a,position:_||d,id:e,pixelOffset:C||new Cesium.Cartesian2(T+A,S-D),eyeOffset:v,horizontalOrigin:Object(n.defined)(b)?b:o,verticalOrigin:Object(n.defined)(x)?x:l,rotation:P,scaleByDistance:c,scale:1/u*w,distanceDisplayCondition:h,heightReference:p,disableDepthTestDistance:m,pixelOffsetScaleByDistance:f,translucencyByDistance:y}},createLabelOptions:function(e,t,i,n){var r,s=n.positionOffsetXRate,a=n.positionOffsetYRate,u=n.xoffset,c=n.yoffset,h=n.angle,d=n.drawStyles,p=n.scaleByDistance,m=n.distanceDisplayCondition;m=void 0===m?[n.maxScale,n.minScale].some(function(e){return void 0===e})?void 0:new Cesium.DistanceDisplayCondition(n.maxScale,n.minScale):n.distanceDisplayCondition;var f=n.heightReference||Cesium.HeightReference.NONE,y=n.disableDepthTestDistance||0,g=n.pixelOffsetScaleByDistance,_=n.translucencyByDistance,C=n.cshow,v=n.cposition,b=n.ctext,x=n.cfont,w=n.cfillColor,T=n.coutlineColor,S=n.coutlineWidth,M=n.cshowBackground,E=n.cbackgroundColor,P=n.cbackgroundPadding,A=n.cpixelOffset,D=n.ceyeOffset,I=n.chorizontalOrigin,L=n.cverticalOrigin,k=n.cscale;r=0===n.drawMode?Cesium.LabelStyle.FILL:(n.drawMode,Cesium.LabelStyle.FILL_AND_OUTLINE);var R=new o(n.fontStyleOptions),O=t;n.textWraps&&(O=l(t,R,n.lineWidth,n.lineMaxNum));var B=Cesium.defaultValue(M,Cesium.defaultValue(n.showBackground,!1)),F=5,V=5;Cesium.defined(n.backgroundPadding)&&(Array.isArray(n.backgroundPadding)?(F=n.backgroundPadding[0],V=n.backgroundPadding[1]):(F=n.backgroundPadding,V=n.backgroundPadding));var N,z=Cesium.defaultValue(n.backgroundColor,"rgba(42,42,42,0.8)"),G=Cesium.Cartographic.fromCartesian(i);G.height=G.height+n.labelHeight,N=Cesium.Cartographic.toCartesian(G);var j=h/180*Math.PI;return{show:C,text:b||O,font:x||R.font,position:v||N,id:e,pixelOffset:A||new Cesium.Cartesian2(u,c),eyeOffset:D,horizontalOrigin:I||s,verticalOrigin:L||a,rotation:j,scaleByDistance:p,fillColor:w||Cesium.Color.fromCssColorString(d.color),outlineColor:T||Cesium.Color.fromCssColorString(d.haloColor),outlineWidth:S||0!==d.haloSize?d.haloSize:void 0,style:r,scale:k,showBackground:B,backgroundColor:E||Cesium.Color.fromCssColorString(z),backgroundPadding:P||new Cesium.Cartesian2(F,V),distanceDisplayCondition:m,heightReference:f,disableDepthTestDistance:y,pixelOffsetScaleByDistance:g,translucencyByDistance:_}},createGroundOptions:function(e,t,i,n){var r,a=s(t,n),o=n.positionOffsetXRate,l=n.positionOffsetYRate,u=n.textDefinition,c=n.groundScale,h=n.cscale,d=n.angle,p=new Image;p.src=a.toDataURL("image/png");var m,f=a.width?a.width*h*c:100,y=a.height?a.height*h*c:100,g=[new Cesium.Cartesian3(0,0,0),new Cesium.Cartesian3(f,0,0),new Cesium.Cartesian3(f,y,0),new Cesium.Cartesian3(0,y,0)],_=Cesium.Matrix4.IDENTITY.clone(),C=Cesium.Transforms.eastNorthUpToFixedFrame(i);1===o?Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),_):-1===o?Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-f,0,0)),_):Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(-f/2,0,0)),_),_=1===l?Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y,0)),_):-1===l?Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,0,0)),_):Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0,-y/2,0)),_),Cesium.Matrix4.multiply(_,Cesium.Matrix4.fromScale(new Cesium.Cartesian3(1/u,1/u,1)),_),m=g.map(function(e){var t=Cesium.Matrix4.multiplyByPoint(C,Cesium.Matrix4.multiplyByPoint(_,e,_),new Cesium.Cartesian3),i=Cesium.Cartographic.fromCartesian(t);return Cesium.Cartographic.toCartesian(i)});var v=new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromCartesianArray(m),rotation:d*Math.PI/180,stRotation:d*Math.PI/180,height:1}),b=new Cesium.GeometryInstance({id:Cesium.createGuid(),geometry:v});return(r=new Cesium.GroundPrimitive({geometryInstances:b,asynchronous:!0,classificationType:Cesium.ClassificationType.TERRAIN,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({type:"MapGISLabelGround",fabric:{materials:{SwipeMaterial:{type:"MaskMaterial"},ImageMaterial:{type:"Image",uniforms:{image:p}}},components:{markCull:"SwipeMaterial.markCull",diffuse:"ImageMaterial.diffuse",alpha:"ImageMaterial.alpha"}}})}),swipeEnabled:n.swipeEnabled,swipeInverse:n.swipeInverse}))._cacheGroundRect=v.rectangle,r}};t.a=_},function(e,t,i){"use strict";(function(e,n){i.d(t,"a",function(){return K}),i.d(t,"b",function(){return Xi}),i.d(t,"c",function(){return pi}),i.d(t,"d",function(){return Zi});var r={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label