xy-map 1.1.40 → 1.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/babel/browser/342/200/223polyfill.js +5710 -0
- package/draco/README.md +32 -0
- package/draco/draco_decoder.js +52 -0
- package/draco/draco_decoder.wasm +0 -0
- package/draco/draco_encoder.js +33 -0
- package/draco/draco_wasm_wrapper.js +104 -0
- package/draco/gltf/draco_decoder.js +48 -0
- package/draco/gltf/draco_decoder.wasm +0 -0
- package/draco/gltf/draco_encoder.js +33 -0
- package/draco/gltf/draco_wasm_wrapper.js +104 -0
- package/favicon.ico +0 -0
- package/fonts/element-icons.f1a45d74.ttf +0 -0
- package/fonts/element-icons.ff18efd1.woff +0 -0
- package/img/MM.png +0 -0
- package/img/MM_D.png +0 -0
- package/img/MM_W.png +0 -0
- package/img/arrow.png +0 -0
- package/img/arrow_white.png +0 -0
- package/img/blue.jpg +0 -0
- package/img/loading.gif +0 -0
- package/img/marker.png +0 -0
- package/img/waternormals.jpg +0 -0
- package/index.html +1 -0
- package/js/111.e9fdb1f3.js +1 -0
- package/js/162.b345164e.js +63 -0
- package/js/167.d57ec1cb.js +1 -0
- package/js/198.80beff91.js +1 -0
- package/js/219.3a689b1b.js +1 -0
- package/js/253.41b875a4.js +1 -0
- package/js/255.c143b772.js +1 -0
- package/js/268.95e45860.js +1 -0
- package/js/276.d62811c9.js +1 -0
- package/js/393.708dca7a.js +1 -0
- package/js/394.37bd1740.js +1 -0
- package/js/420.a5d42144.js +1 -0
- package/js/423.c8c68750.js +13 -0
- package/js/425.089d4a6d.js +1 -0
- package/js/451.6012db1d.js +1 -0
- package/js/465.1b20115a.js +1 -0
- package/js/481.3b16690a.js +1 -0
- package/js/484.51df3ccd.js +1 -0
- package/js/508.d7ab8810.js +1 -0
- package/js/526.28c8ccaf.js +56 -0
- package/js/567.5b231b3a.js +1 -0
- package/js/631.2131af52.js +1 -0
- package/js/634.36055198.js +1 -0
- package/js/683.93dbeb16.js +1 -0
- package/js/707.5125b998.js +1 -0
- package/js/71.d8429480.js +1 -0
- package/js/729.1100db03.js +1 -0
- package/js/782.ec8fab3a.js +1 -0
- package/js/802.d6bbea52.js +1 -0
- package/js/843.61a15a56.js +1 -0
- package/js/885.bef21720.js +1 -0
- package/js/952.a0a65852.js +1 -0
- package/js/973.88a539a6.js +1 -0
- package/js/979.e70d60df.js +1 -0
- package/js/app.7c4c88d3.js +1 -0
- package/js/chunk-vendors.e12da29b.js +32 -0
- package/markdown/flyTo.md +57 -0
- package/markdown/init.md +39 -0
- package/markdown/mapSdk.md +32 -0
- package/markdown/tools.md +129 -0
- package/model/blue/nx.png +0 -0
- package/model/blue/ny.png +0 -0
- package/model/blue/nz.png +0 -0
- package/model/blue/px.png +0 -0
- package/model/blue/py.png +0 -0
- package/model/blue/pz.png +0 -0
- package/model/blue.jpg +0 -0
- package/model/ferrari.glb +0 -0
- package/model/hdr/hdr1.hdr +0 -0
- package/model/hdr/hdr2.hdr +0 -0
- package/model/hdr/venice_sunset_1k.hdr +0 -0
- package/model/taoshan/baseColor_1.png +0 -0
- package/model/taoshan/baseColor_10.jpg +0 -0
- package/model/taoshan/baseColor_11.jpg +0 -0
- package/model/taoshan/baseColor_12.jpg +0 -0
- package/model/taoshan/baseColor_13.jpg +0 -0
- package/model/taoshan/baseColor_14.jpg +0 -0
- package/model/taoshan/baseColor_15.jpg +0 -0
- package/model/taoshan/baseColor_16.jpg +0 -0
- package/model/taoshan/baseColor_17.jpg +0 -0
- package/model/taoshan/baseColor_18.jpg +0 -0
- package/model/taoshan/baseColor_19.jpg +0 -0
- package/model/taoshan/baseColor_2.png +0 -0
- package/model/taoshan/baseColor_20.jpg +0 -0
- package/model/taoshan/baseColor_21.jpg +0 -0
- package/model/taoshan/baseColor_22.jpg +0 -0
- package/model/taoshan/baseColor_23.jpg +0 -0
- package/model/taoshan/baseColor_24.jpg +0 -0
- package/model/taoshan/baseColor_25.jpg +0 -0
- package/model/taoshan/baseColor_26.jpg +0 -0
- package/model/taoshan/baseColor_27.jpg +0 -0
- package/model/taoshan/baseColor_3.jpg +0 -0
- package/model/taoshan/baseColor_4.jpg +0 -0
- package/model/taoshan/baseColor_5.png +0 -0
- package/model/taoshan/baseColor_6.jpg +0 -0
- package/model/taoshan/baseColor_7.jpg +0 -0
- package/model/taoshan/baseColor_8.jpg +0 -0
- package/model/taoshan/baseColor_9.jpg +0 -0
- package/model/taoshan/taoshan.bin +0 -0
- package/model/taoshan/taoshan.gltf +1 -0
- package/package.json +2 -2
- package/demo.html +0 -1
- package/xy-map.common.js +0 -120590
- package/xy-map.umd.js +0 -120609
- package/xy-map.umd.min.js +0 -57
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[253],{2253:function(e,t,i){i.r(t),i.d(t,{default:function(){return p}});var n=function(){var e=this;e._self._c;return e._m(0)},r=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"full-height relative overflow"},[t("div",{staticClass:"full-height",attrs:{id:"map"}})])}],a=i(83526),o=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"adcode":530114,"name":"呈贡区","center":[102.801382,24.889275],"centroid":[102.855526,24.864324],"childrenNum":0,"level":"district","acroutes":[100000,530000,530100],"parent":{"adcode":530100}},"geometry":{"type":"MultiPolygon","coordinates":[[[[102.853205,24.697924],[102.854152,24.699056],[102.854862,24.701756],[102.85507,24.703064],[102.856709,24.706861],[102.856665,24.708614],[102.856354,24.709764],[102.855685,24.710533],[102.8547,24.712531],[102.854057,24.715091],[102.853459,24.71801],[102.85052,24.723179],[102.848448,24.726382],[102.84563,24.728655],[102.843058,24.732083],[102.842492,24.735306],[102.841436,24.73829],[102.838609,24.741255],[102.838307,24.744019],[102.839287,24.745645],[102.839772,24.746806],[102.840249,24.748427],[102.841755,24.748906],[102.845544,24.748494],[102.860179,24.748681],[102.863985,24.747344],[102.867019,24.74692],[102.86878,24.746944],[102.8709,24.746017],[102.871664,24.744692],[102.872694,24.740834],[102.872927,24.738228],[102.873241,24.736854],[102.874005,24.735935],[102.874949,24.735543],[102.876252,24.735569],[102.878108,24.736462],[102.880381,24.738559],[102.881908,24.739813],[102.882628,24.740176],[102.88446,24.745999],[102.884877,24.751079],[102.886863,24.753182],[102.889382,24.753448],[102.894373,24.753515],[102.895433,24.755343],[102.898905,24.756162],[102.898828,24.760882],[102.899523,24.7633],[102.901415,24.763613],[102.9055,24.765598],[102.907282,24.766338],[102.908738,24.76659],[102.911651,24.766277],[102.91316,24.766195],[102.913859,24.766359],[102.914699,24.76716],[102.914936,24.768432],[102.914102,24.770467],[102.913344,24.773064],[102.913797,24.77471],[102.915718,24.776762],[102.917648,24.77792],[102.918394,24.779058],[102.918545,24.779879],[102.918074,24.780806],[102.916322,24.780447],[102.913702,24.783028],[102.91218,24.783519],[102.910721,24.784256],[102.909851,24.785791],[102.909792,24.789343],[102.910478,24.792568],[102.910443,24.794767],[102.90928,24.797459],[102.908865,24.798985],[102.905683,24.801806],[102.903588,24.803312],[102.903519,24.805723],[102.903833,24.806963],[102.903857,24.808454],[102.903232,24.810161],[102.9018,24.811657],[102.903339,24.814148],[102.903623,24.815907],[102.904067,24.817597],[102.904449,24.821668],[102.904484,24.823644],[102.905612,24.825944],[102.906829,24.826412],[102.908543,24.826596],[102.911384,24.827403],[102.913045,24.828104],[102.915641,24.830162],[102.915075,24.83162],[102.908889,24.833725],[102.909297,24.841536],[102.910029,24.845446],[102.909724,24.846452],[102.910307,24.847407],[102.910769,24.849953],[102.910733,24.852258],[102.911192,24.854803],[102.91467,24.858777],[102.917165,24.861121],[102.919693,24.861386],[102.922502,24.860042],[102.923867,24.858336],[102.924334,24.854193],[102.92625,24.852024],[102.925533,24.846405],[102.926107,24.844219],[102.927978,24.844491],[102.930867,24.848193],[102.930755,24.854531],[102.931832,24.854304],[102.936175,24.8512],[102.937758,24.852445],[102.938436,24.859771],[102.944022,24.862541],[102.948035,24.862602],[102.948784,24.862669],[102.950622,24.863531],[102.951493,24.863502],[102.954278,24.862479],[102.956193,24.862038],[102.957812,24.861933],[102.959239,24.862172],[102.95939,24.863327],[102.958153,24.866909],[102.960015,24.868159],[102.963413,24.873576],[102.963892,24.876755],[102.965476,24.87849],[102.965124,24.883384],[102.966841,24.883372],[102.969052,24.882875],[102.970351,24.882206],[102.971651,24.881102],[102.972337,24.882028],[102.9729,24.88412],[102.972864,24.885496],[102.974963,24.886299],[102.975567,24.884993],[102.980158,24.882875],[102.982579,24.882425],[102.984713,24.883194],[102.989218,24.885326],[102.990171,24.885344],[102.992933,24.886673],[102.996192,24.88929],[102.997649,24.8914],[102.998895,24.8935],[103.000191,24.896891],[103.000298,24.899538],[103.000324,24.904156],[103.000446,24.909755],[103.000437,24.913806],[103.000612,24.919522],[103.001118,24.920541],[103.00049,24.921893],[102.999392,24.923786],[102.998042,24.925547],[102.997945,24.931612],[102.997666,24.933227],[102.995618,24.933884],[102.993336,24.933612],[102.988342,24.928458],[102.98381,24.925844],[102.982973,24.925675],[102.979086,24.921478],[102.977964,24.921461],[102.97662,24.92314],[102.976579,24.926204],[102.977073,24.927892],[102.976916,24.928038],[102.976813,24.934725],[102.980427,24.946554],[102.989642,24.958011],[102.992332,24.964055],[102.992264,24.968667],[102.990929,24.972106],[102.98783,24.975516],[102.9845,24.976847],[102.982425,24.981462],[102.980874,24.981004],[102.977914,24.979889],[102.976049,24.978929],[102.974445,24.978447],[102.971011,24.977866],[102.968617,24.978097],[102.966325,24.977589],[102.961065,24.973119],[102.957016,24.97236],[102.953446,24.97323],[102.94985,24.975942],[102.945759,24.97772],[102.944279,24.97967],[102.94435,24.980843],[102.944158,24.982665],[102.944131,24.984157],[102.94332,24.986912],[102.941781,24.988272],[102.938474,24.988684],[102.92881,24.990152],[102.927132,24.990126],[102.924861,24.988191],[102.922697,24.986144],[102.921185,24.984875],[102.91988,24.984308],[102.917334,24.983844],[102.91483,24.983663],[102.913042,24.983882],[102.910085,24.983348],[102.908782,24.982747],[102.906044,24.981138],[102.903934,24.980333],[102.899242,24.977954],[102.896969,24.977052],[102.893219,24.975005],[102.891777,24.973931],[102.890498,24.973362],[102.889752,24.973446],[102.888867,24.973937],[102.887973,24.974777],[102.886612,24.976561],[102.885292,24.977332],[102.884353,24.977311],[102.883462,24.977011],[102.881293,24.975823],[102.878907,24.975174],[102.87716,24.975364],[102.869153,24.97504],[102.863361,24.976228],[102.86212,24.98148],[102.860489,24.982093],[102.857769,24.979527],[102.854075,24.97969],[102.854039,24.981585],[102.852826,24.984945],[102.848439,24.984886],[102.8349,24.980709],[102.834559,24.979848],[102.834198,24.979723],[102.832307,24.978108],[102.832351,24.975881],[102.833417,24.974462],[102.833287,24.972074],[102.831224,24.969295],[102.828409,24.968831],[102.82137,24.96242],[102.819662,24.958204],[102.817527,24.955795],[102.817069,24.952125],[102.817122,24.949261],[102.815059,24.947804],[102.811939,24.946966],[102.809364,24.944703],[102.808878,24.942309],[102.807534,24.939266],[102.802869,24.936979],[102.799081,24.934541],[102.795298,24.931148],[102.792906,24.928727],[102.790147,24.926937],[102.78875,24.926277],[102.786687,24.924387],[102.782916,24.922051],[102.779521,24.920287],[102.779695,24.919846],[102.783191,24.916823],[102.783573,24.915231],[102.783407,24.91279],[102.78431,24.910211],[102.783866,24.9096],[102.781646,24.907731],[102.780486,24.906636],[102.778748,24.906341],[102.777022,24.905716],[102.774237,24.904056],[102.769403,24.899894],[102.765688,24.897809],[102.761192,24.896062],[102.760343,24.895781],[102.759289,24.895694],[102.756571,24.893921],[102.750095,24.893415],[102.740348,24.891353],[102.733412,24.888697],[102.727152,24.886688],[102.719527,24.883378],[102.705117,24.881385],[102.718005,24.8683],[102.721909,24.862628],[102.723822,24.858935],[102.731752,24.845689],[102.737615,24.830501],[102.739788,24.81731],[102.741369,24.815916],[102.749473,24.79248],[102.752495,24.779727],[102.755683,24.777514],[102.756663,24.776248],[102.759469,24.776953],[102.761393,24.776862],[102.762193,24.773634],[102.764111,24.773991],[102.764803,24.770885],[102.763539,24.769502],[102.764031,24.768435],[102.757785,24.766417],[102.756672,24.764613],[102.756264,24.759531],[102.758128,24.754021],[102.762237,24.750158],[102.767586,24.747929],[102.77339,24.748011],[102.779438,24.748789],[102.784488,24.748859],[102.785103,24.748421],[102.786089,24.746853],[102.788241,24.744385],[102.790384,24.74206],[102.792491,24.738354],[102.795674,24.73148],[102.795768,24.731363],[102.799593,24.729336],[102.804693,24.726172],[102.810299,24.723015],[102.814591,24.722609],[102.818623,24.723121],[102.821612,24.725004],[102.825392,24.725054],[102.828927,24.724867],[102.831215,24.723972],[102.832487,24.723068],[102.834308,24.719628],[102.837629,24.717364],[102.840142,24.717858],[102.840844,24.721096],[102.842578,24.723194],[102.844331,24.723907],[102.845589,24.723925],[102.847131,24.7221],[102.847918,24.720494],[102.848726,24.717732],[102.848768,24.714968],[102.847267,24.714254],[102.84373,24.714441],[102.839701,24.71416],[102.83873,24.712303],[102.839778,24.709778],[102.84336,24.706826],[102.846826,24.704345],[102.849064,24.701355],[102.85168,24.698465],[102.853205,24.697924]]]]}}]}'),l={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",zoom:11.5,center:[102.83643451528434,24.81972792178513],pitch:50,bearing:0}}},mounted(){this.init()},methods:{init(){a.mapSdk.initMap(this.config).then((e=>{this.map=e,a.mapSdk.drawCityBorder(o,{lineColor:"#00fff2",lineWidth:4,lineOpacity:1,fillColor:"rgb(2,26,79)",fillOpacity:.4})}))}}},c=l,s=i(43736),u=(0,s.Z)(c,n,r,!1,null,null,null),p=u.exports}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[255],{71255:function(t,i,e){e.r(i),e.d(i,{default:function(){return g}});var a=function(){var t=this;t._self._c;return t._m(0)},n=[function(){var t=this,i=t._self._c;return i("div",{staticClass:"full-height relative overflow"},[i("div",{staticClass:"full-height",attrs:{id:"map"}})])}],o=e(83526);const{addDiyPoint:h}=o.mapDraw,{toGeoJson:s}=o.mapTools;var l={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",center:[131.073341552,45.800152475],pitch:62,zoom:14,bearing:15.6}}},mounted(){this.init()},methods:{init(){o.mapSdk.initMap(this.config).then((t=>{this.map=t,this.getPoint()}))},getPoint(){let t=this.map;const i=140,e={width:i,height:i,data:new Uint8Array(i*i*4),onAdd:function(){const t=document.createElement("canvas");t.width=this.width,t.height=this.height,this.context=t.getContext("2d")},render:function(){const e=1e3,a=performance.now()%e/e,n=i/2*.3,o=i/2*.7*a+n,h=this.context;return h.clearRect(0,0,this.width,this.height),h.beginPath(),h.arc(this.width/2,this.height/2,o,0,2*Math.PI),h.fillStyle=`rgba(255, 200, 200, ${1-a})`,h.fill(),h.beginPath(),h.arc(this.width/2,this.height/2,n,0,2*Math.PI),h.fillStyle="rgba(255, 100, 100, 1)",h.strokeStyle="white",h.lineWidth=2+4*(1-a),h.fill(),h.stroke(),this.data=h.getImageData(0,0,this.width,this.height).data,t.triggerRepaint(),!0}};let a=[{id:1,name:"动画点1",lngLat:[131.073341552,45.800152475]},{id:2,name:"动画点2",lngLat:[131.073341552,45.820152475]}],n=s(a,"Point","lngLat");t.addImage("pulsing-dot",e,{pixelRatio:2}),h({id:"point",data:n,style:{layout:{"icon-image":"pulsing-dot","text-size":11,"text-offset":[0,1.3]}},click:t=>{console.log(t);let i=t.properties;o.mapSdk.addPopup(t.position,`<div>${i.name}</div>`),o.mapSdk.easeTo(t.position)}})}}},d=l,r=e(43736),c=(0,r.Z)(d,a,n,!1,null,null,null),g=c.exports}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[268],{50268:function(t,e,i){i.r(e),i.d(e,{default:function(){return y}});var o=function(){var t=this;t._self._c;return t._m(0)},a=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"full-height relative overflow"},[e("div",{staticClass:"full-height",attrs:{id:"map"}})])}],n=i(44162),r=i(29377);const{addLayerPoint:s,addLayerImagePoint:d,addFlashPoint:c}=n.Gx,{toGeoJson:p,pointToGeoJson:l}=n.zg;var h={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",center:[131.05098966709647,45.805820772845436],pitch:62,zoom:12,bearing:15.6},view3D:!0,data:[{id:1,name:"测试点1",lnglat:[131.1515798484043,45.85405632167139]},{id:2,name:"测试点2",lnglat:[131.04196826087988,45.85512848048487]}]}},mounted(){this.init()},methods:{init(){n.xt.initMap(this.config).then((t=>{this.map=t,this.getPoint(),this.getPoint2()}))},getPoint(){d({id:"point",data:r,image:{width:20,height:20,src:"/img/MM.png"},click:t=>{let e=t.properties;n.xt.addPopup(t.coordinates,`<div>${e.name}</div>`),n.xt.easeTo(t.coordinates);let i=l(t.coordinates);c({id:"flash",data:i,time:3e3,size:120},"point")}})},getPoint2(){let t=p(this.data,"Point","lnglat");s({id:"point2",data:t,style:{paint:{"circle-radius":6,"circle-stroke-width":2}},text:{show:!0,layout:{"text-field":"{name}","text-offset":[0,1.8]}},click:t=>{let e=t.properties;n.xt.addPopup(t.coordinates,`<div>${e.name}</div>`),n.xt.easeTo(t.coordinates)}}),c({id:"flash2",data:t,timer:0,size:80},"point2")}}},u=h,m=i(43736),g=(0,m.Z)(u,o,a,!1,null,null,null),y=g.exports},29377:function(t){t.exports=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[131.056690398,45.822296793]},"properties":{"name":"点1","x_coord":"131.056690398","y_coord":"45.822296793","height":190.272,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.097374145,45.815258676]},"properties":{"name":"点2","x_coord":"131.097374145","y_coord":"45.815258676","height":203.167,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.088619414,45.845299417]},"properties":{"name":"点3","x_coord":"131.088619414","y_coord":"45.845299417","height":188.253,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.073341552,45.800152475]},"properties":{"name":"点4","x_coord":"131.073341552","y_coord":"45.800152475","height":200.755,"desc":""}}]}')}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[276],{67276:function(t,e,o){o.r(e),o.d(e,{default:function(){return m}});var i=function(){var t=this;t._self._c;return t._m(0)},n=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"full-height relative overflow"},[e("div",{staticClass:"full-height",attrs:{id:"map"}})])}],a=o(44162),r=o(29377);const{addLayerPoint:s,addLayerImagePoint:p}=a.Gx,{toGeoJson:d}=a.zg;var c={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",center:[131.05098966709647,45.805820772845436],pitch:62,zoom:12,bearing:15.6},view3D:!0,data:[{id:1,name:"测试点1",lnglat:[131.1515798484043,45.85405632167139]},{id:2,name:"测试点2",lnglat:[131.04196826087988,45.85512848048487]}]}},mounted(){this.init()},methods:{init(){a.xt.initMap(this.config).then((t=>{this.map=t,this.getPoint(),this.getPoint2()}))},getPoint(){p({id:"point",data:r,image:{width:20,height:20,src:"/img/MM.png"},click:t=>{console.log(t);let e=t.properties;a.xt.addPopup(t.position,`<div>${e.name}</div>`),a.xt.easeTo(t.position),console.log(this.map.hasImage("point-marker"))}})},getPoint2(){let t=d(this.data,"Point","lnglat");s({id:"point2",data:t,text:{show:!0,layout:{"text-field":"{name}","text-offset":[0,1.2]}},click:t=>{console.log(t);let e=t.properties;a.xt.addPopup(t.position,`<div>${e.name}</div>`),a.xt.easeTo(t.position)}})}}},l=c,h=o(43736),g=(0,h.Z)(l,i,n,!1,null,null,null),m=g.exports},29377:function(t){t.exports=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[131.056690398,45.822296793]},"properties":{"name":"点1","x_coord":"131.056690398","y_coord":"45.822296793","height":190.272,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.097374145,45.815258676]},"properties":{"name":"点2","x_coord":"131.097374145","y_coord":"45.815258676","height":203.167,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.088619414,45.845299417]},"properties":{"name":"点3","x_coord":"131.088619414","y_coord":"45.845299417","height":188.253,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.073341552,45.800152475]},"properties":{"name":"点4","x_coord":"131.073341552","y_coord":"45.800152475","height":200.755,"desc":""}}]}')}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[393],{86393:function(e,t,i){i.r(t),i.d(t,{default:function(){return P}});var o=function(){var e=this;e._self._c;return e._m(0)},n=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"full-height relative overflow"},[t("div",{staticClass:"full-height",attrs:{id:"map"}})])}],a=i(83526),r=i(16790),p=i(29377),s=i(81906);const{addLayerLine:d,addLayerImagePoint:l,addLayerPoint:c,addLayerPolygon:g}=a.mapDraw,{toGeoJson:f}=a.mapTools,{setHigh:y}=a.mapLayers;var m={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",center:[131.073341552,45.800152475],pitch:62,zoom:13,bearing:15.6}}},mounted(){this.init()},methods:{init(){a.mapSdk.initMap(this.config).then((e=>{this.map=e,this.getPoint(),this.getLine(),this.getLine2(),this.getPolygon()}))},getPoint(){l({id:"point",data:p,image:{width:20,height:20,src:"/img/MM.png"},high:!0,click:e=>{console.log(e);let t=e.properties;a.mapSdk.addPopup(e.position,`<div>${t.name}</div>`),a.mapSdk.easeTo(e.position),y("point",["==",["string",["get","name"]],t.name])}})},getLine(){d({id:"line",data:r,text:{show:!0,layout:{"text-field":"{name}"}},high:!0,click:e=>{a.mapSdk.addPopup(e.position,"<div>line</div>")}}),y("line",["has","name"])},getLine2(){let e=[{id:"1",name:"点击高亮线1",lnglat:[[131.1515798484043,45.85405632167139],[131.073341552,45.800152475],[131.04196826087988,45.85512848048487]]},{id:"2",name:"测试线2",lnglat:[[131.023341552,45.820152475],[131.04196826087988,45.83512848048487]]}],t=f(e,"LineString","lnglat");d({id:"line2",data:t,text:{show:!0,layout:{"text-field":"{name}","text-offset":[0,1.2]}},style:{paint:{"line-width":6,"line-opacity":.8,"line-color":"#28b2ff"}},high:{paint:{"line-width":6,"line-color":"#28ccaa","line-opacity":.8}},animate:{paint:{"line-width":6,"line-opacity":1,"line-gradient":["interpolate",["linear"],["line-progress"],0,"transparent",1,"rgba(255, 255, 255, 0.6)"]},step:400},click:e=>{console.log(e);let t=e.properties;y("line2",["==",["string",["get","id"]],t.id]),a.mapSdk.addPopup(e.position,"<div>line</div>")}})},getPolygon(){g({id:"polygon",data:s,text:{show:!0,layout:{"text-field":"{name}"}},high:{paint:{"fill-color":"#ff0","fill-opacity":.5}},click:e=>{console.log(e);let t=e.properties;a.mapSdk.addPopup(e.position,`<div>${t.name}</div>`),y("polygon",["==",["string",["get","name"]],t.name])}})}}},h=m,u=i(43736),_=(0,u.Z)(h,o,n,!1,null,null,null),P=_.exports},29377:function(e){e.exports=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[131.056690398,45.822296793]},"properties":{"name":"点1","x_coord":"131.056690398","y_coord":"45.822296793","height":190.272,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.097374145,45.815258676]},"properties":{"name":"点2","x_coord":"131.097374145","y_coord":"45.815258676","height":203.167,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.088619414,45.845299417]},"properties":{"name":"点3","x_coord":"131.088619414","y_coord":"45.845299417","height":188.253,"desc":""}},{"type":"Feature","geometry":{"type":"Point","coordinates":[131.073341552,45.800152475]},"properties":{"name":"点4","x_coord":"131.073341552","y_coord":"45.800152475","height":200.755,"desc":""}}]}')},16790:function(e){e.exports=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"LineString","coordinates":[[131.10037821876563,45.80397194056788],[131.095400038834,45.813241654923345],[131.09505671608008,45.81907814173975],[131.1015798484043,45.82405632167139],[131.1077596579746,45.826974565079595],[131.11359614479102,45.83057945399561],[131.12011927711524,45.838990861466314],[131.13076228248633,45.84259575038233],[131.13591212379492,45.84980552821436]]},"properties":{"name":"线1","length":6562.954472,"desc":""}},{"type":"Feature","geometry":{"type":"LineString","coordinates":[[131.06038111793555,45.82663124232569],[131.06621760475196,45.82912033229151],[131.06630343544043,45.83238189845362],[131.07196826087988,45.83512848048487],[131.07282656776465,45.82903450160303],[131.07454318153418,45.82594459681788],[131.07660311805762,45.82809036402979],[131.07728976356543,45.83306854396143],[131.0810663138584,45.833240205338384],[131.08312625038184,45.8342701736001],[131.08338374244727,45.83710258631983],[131.0858728324131,45.84010666041651],[131.088018599625,45.8397633376626],[131.08870524513281,45.84302490382471]]},"properties":{"name":"线2","length":5051.296953,"desc":""}}]}')},81906:function(e){e.exports=JSON.parse('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[131.04543685913086,45.792663966565144],[131.04612350463867,45.78739726631928],[131.05676651000977,45.784284891343724],[131.06517791748047,45.78943218677224],[131.06620788574216,45.794698694740546],[131.05367660522458,45.79637429745708],[131.04543685913086,45.792663966565144]]]},"properties":{"name":"多边形1","Layer":"新建图层","desc":"","Style":"BRUSH(fc:#4d90fe50,id:ogr-brush-0);PEN(c:#4d90feff,w:2.000000px,id:ogr-pen-0);LABEL(f:黑体,s:11.000000pt,c:#ffffffff,w:100.000000,o:#000000ff)","BM_Name":"多边形1","BM_Time":"22-09-23 15:21:06","BM_Perimet":"","BM_Area":"1.514平方公里"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[131.01531028747556,45.82257895307965],[131.01659774780273,45.81552046461448],[131.02234840393066,45.81199088483646],[131.03015899658203,45.814084730339076],[131.04140281677246,45.81964799447073],[131.03625297546387,45.82443315333113],[131.0280990600586,45.82796194448517],[131.01531028747556,45.82257895307965]]]},"properties":{"name":"多边形2","Layer":"新建图层","desc":"","Style":"BRUSH(fc:#4d90fe50,id:ogr-brush-0);PEN(c:#4d90feff,w:2.000000px,id:ogr-pen-0);LABEL(f:黑体,s:11.000000pt,c:#ffffffff,w:100.000000,o:#000000ff)","BM_Name":"多边形2","BM_Time":"22-09-23 15:21:49","BM_Perimet":"","BM_Area":"2.204平方公里"}}]}')}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[394],{85394:function(e,t,i){i.r(t),i.d(t,{default:function(){return f}});var n=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"full-height relative overflow"},[t("div",{staticClass:"full-height",attrs:{id:"map"}})])}],o=i(44162);const{addLayerLine:l}=o.Gx,{toGeoJson:s,loadImage:r}=o.zg,{setLayout:c,hasLayer:d}=o.LY;var p={data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",center:[131.05098966709647,45.805820772845436],pitch:62,zoom:12,bearing:15.6}}},mounted(){this.init()},destroyed(){this.map=null},methods:{init(){o.xt.initMap(this.config).then((e=>{this.map=e,this.getLine()}))},getLine(){let e=this.map,t=[{id:1,name:"测试线",lngLat:[[131.1515798484043,45.85405632167139],[131.073341552,45.800152475],[131.04196826087988,45.85512848048487]]}],i=s(t,"LineString","lngLat");l({id:"line",data:i,text:{show:!1,layout:{"text-field":"{name}"}},style:{paint:{"line-width":12,"line-color":"#ff67aa","line-opacity":.7}},click:e=>{console.log(e);let t=e.properties;o.xt.addPopup(e.position,`<div>${t.name}</div>`)}}),r("/img/arrow.png",24,24).then((i=>{e.addImage("arrowIcon",i);let n="line-arrow",a=5;e.addLayer({id:n,type:"symbol",source:"line",layout:{"symbol-placement":"line","symbol-spacing":50,"icon-image":"arrowIcon","icon-size":.4}});let l=setInterval((()=>{if(d(n)){let e=a++%50+5;c(n,"icon-offset",[e,0])}else clearInterval(l)}),10);o.xt.fitLineBounds(t[0].lngLat)}))}}},u=p,h=i(43736),m=(0,h.Z)(u,n,a,!1,null,null,null),f=m.exports}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self["webpackChunkxy_map"]=self["webpackChunkxy_map"]||[]).push([[420],{64944:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return Te}});var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"full-height relative overflow"},[t("div",{staticClass:"full-height",attrs:{id:"map"}}),t("div",{staticClass:"form"},[t("div",[t("div",{staticClass:"margin-bottom"},[e._v("经度:")]),t("el-input",{attrs:{type:"number",step:"0.0001"},on:{change:e.addModel},model:{value:e.lng,callback:function(t){e.lng=t},expression:"lng"}})],1),t("div",{staticClass:"margin-top"},[t("div",{staticClass:"margin-bottom"},[e._v("纬度:")]),t("el-input",{attrs:{type:"number",step:"0.0001"},on:{change:e.addModel},model:{value:e.lat,callback:function(t){e.lat=t},expression:"lat"}})],1),t("div",{staticClass:"mt-15"},[t("el-button",{on:{click:e.getCamera}},[e._v("获取摄像机")])],1)]),t("map-rain",{directives:[{name:"show",rawName:"v-show",value:e.isRain,expression:"isRain"}],ref:"rain",attrs:{id:"rain"}}),t("map-load",{attrs:{loadTime:3e3,loading:e.loading}})],1)},r=[],o=s(44162),i=(s(45461),s(11114));class a extends i.aNw{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new p(e)})),this.register((function(e){return new R(e)})),this.register((function(e){return new A(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new T(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new d(e)})),this.register((function(e){return new _(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new y(e)}))}load(e,t,s,n){const r=this;let o;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:i.Zp0.extractUrlBase(e),this.manager.itemStart(e);const a=function(t){n?n(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)},c=new i.hH6(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,(function(s){try{r.parse(s,o,(function(s){t(s),r.manager.itemEnd(e)}),a)}catch(n){a(n)}}),s,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let r;const o={},a={};if("string"===typeof e)r=JSON.parse(e);else if(e instanceof ArrayBuffer){const t=i.Zp0.decodeText(new Uint8Array(e,0,4));if(t===E){try{o[l.KHR_BINARY_GLTF]=new S(e)}catch(u){return void(n&&n(u))}r=JSON.parse(o[l.KHR_BINARY_GLTF].content)}else r=JSON.parse(i.Zp0.decodeText(new Uint8Array(e)))}else r=e;if(void 0===r.asset||r.asset.version[0]<2)return void(n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const c=new ee(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i<this.pluginCallbacks.length;i++){const e=this.pluginCallbacks[i](c);a[e.name]=e,o[e.name]=!0}if(r.extensionsUsed)for(let i=0;i<r.extensionsUsed.length;++i){const e=r.extensionsUsed[i],t=r.extensionsRequired||[];switch(e){case l.KHR_MATERIALS_UNLIT:o[e]=new h;break;case l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[e]=new P;break;case l.KHR_DRACO_MESH_COMPRESSION:o[e]=new L(r,this.dracoLoader);break;case l.KHR_TEXTURE_TRANSFORM:o[e]=new b;break;case l.KHR_MESH_QUANTIZATION:o[e]=new N;break;default:t.indexOf(e)>=0&&void 0===a[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(s,n)}parseAsync(e,t){const s=this;return new Promise((function(n,r){s.parse(e,t,n,r)}))}}function c(){let e={};return{get:function(t){return e[t]},add:function(t,s){e[t]=s},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const l={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class u{constructor(e){this.parser=e,this.name=l.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const n=t[s];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let n=t.cache.get(s);if(n)return n;const r=t.json,o=r.extensions&&r.extensions[this.name]||{},a=o.lights||[],c=a[e];let l;const u=new i.Ilk(16777215);void 0!==c.color&&u.fromArray(c.color);const h=void 0!==c.range?c.range:0;switch(c.type){case"directional":l=new i.Ox3(u),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new i.cek(u),l.distance=h;break;case"spot":l=new i.PMe(u),l.distance=h,c.spot=c.spot||{},c.spot.innerConeAngle=void 0!==c.spot.innerConeAngle?c.spot.innerConeAngle:0,c.spot.outerConeAngle=void 0!==c.spot.outerConeAngle?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),l.decay=2,void 0!==c.intensity&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),n=Promise.resolve(l),t.cache.add(s,n),n}createNodeAttachment(e){const t=this,s=this.parser,n=s.json,r=n.nodes[e],o=r.extensions&&r.extensions[this.name]||{},i=o.light;return void 0===i?null:this._loadLight(i).then((function(e){return s._getNodeRef(t.cache,i,e)}))}}class h{constructor(){this.name=l.KHR_MATERIALS_UNLIT}getMaterialType(){return i.vBJ}extendParams(e,t,s){const n=[];e.color=new i.Ilk(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==r.baseColorTexture&&n.push(s.assignTexture(e,"map",r.baseColorTexture,i.knz))}return Promise.all(n)}}class d{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class p{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&r.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&r.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(r.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new i.FM8(e,e)}return Promise.all(r)}}class m{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];return void 0!==o.iridescenceFactor&&(t.iridescence=o.iridescenceFactor),void 0!==o.iridescenceTexture&&r.push(s.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),void 0!==o.iridescenceIor&&(t.iridescenceIOR=o.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==o.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),void 0!==o.iridescenceThicknessTexture&&r.push(s.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(r)}}class f{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new i.Ilk(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];return void 0!==o.sheenColorFactor&&t.sheenColor.fromArray(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&r.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,i.knz)),void 0!==o.sheenRoughnessTexture&&r.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}}class g{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];return void 0!==o.transmissionFactor&&(t.transmission=o.transmissionFactor),void 0!==o.transmissionTexture&&r.push(s.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(r)}}class T{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&r.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new i.Ilk(a[0],a[1],a[2]),Promise.all(r)}}class x{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class _{constructor(e){this.parser=e,this.name=l.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser,s=t.json.materials[e];return s.extensions&&s.extensions[this.name]?i.EJi:null}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&r.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new i.Ilk(a[0],a[1],a[2]),void 0!==o.specularColorTexture&&r.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,i.knz)),Promise.all(r)}}class R{constructor(e){this.parser=e,this.name=l.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const r=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class A{constructor(e){this.parser=e,this.name=l.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],i=n.images[o.source];let a=s.textureLoader;if(i.uri){const e=s.options.manager.getHandler(i.uri);null!==e&&(a=e)}return this.detectSupport().then((function(r){if(r)return s.loadTextureImage(e,o.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class v{constructor(e){this.name=l.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const e=s.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then((function(t){const s=e.byteOffset||0,n=e.byteLength||0,o=e.count,i=e.byteStride,a=new Uint8Array(t,s,n);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(o,i,a,e.mode,e.filter).then((function(e){return e.buffer})):r.ready.then((function(){const t=new ArrayBuffer(o*i);return r.decodeGltfBuffer(new Uint8Array(t),o,i,a,e.mode,e.filter),t}))}))}return null}}class y{constructor(e){this.name=l.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||void 0===s.mesh)return null;const n=t.meshes[s.mesh];for(const i of n.primitives)if(i.mode!==H.TRIANGLES&&i.mode!==H.TRIANGLE_STRIP&&i.mode!==H.TRIANGLE_FAN&&void 0!==i.mode)return null;const r=s.extensions[this.name],o=r.attributes,a=[],c={};for(const i in o)a.push(this.parser.getDependency("accessor",o[i]).then((e=>(c[i]=e,c[i]))));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then((e=>{const t=e.pop(),s=t.isGroup?t.children:[t],n=e[0].count,r=[];for(const o of s){const e=new i.yGw,t=new i.Pa4,s=new i._fP,a=new i.Pa4(1,1,1),l=new i.SPe(o.geometry,o.material,n);for(let r=0;r<n;r++)c.TRANSLATION&&t.fromBufferAttribute(c.TRANSLATION,r),c.ROTATION&&s.fromBufferAttribute(c.ROTATION,r),c.SCALE&&a.fromBufferAttribute(c.SCALE,r),l.setMatrixAt(r,e.compose(t,s,a));for(const n in c)"TRANSLATION"!==n&&"ROTATION"!==n&&"SCALE"!==n&&o.geometry.setAttribute(n,c[n]);i.Tme.prototype.copy.call(l,o),l.frustumCulled=!1,this.parser.assignFinalMaterial(l),r.push(l)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]})))}}const E="glTF",w=12,M={JSON:1313821514,BIN:5130562};class S{constructor(e){this.name=l.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,w);if(this.header={magic:i.Zp0.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==E)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-w,n=new DataView(e,w);let r=0;while(r<s){const t=n.getUint32(r,!0);r+=4;const s=n.getUint32(r,!0);if(r+=4,s===M.JSON){const s=new Uint8Array(e,w+r,t);this.content=i.Zp0.decodeText(s)}else if(s===M.BIN){const s=w+r;this.body=e.slice(s,s+t)}r+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class L{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=l.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,i={},a={},c={};for(const l in o){const e=j[l]||l.toLowerCase();i[e]=o[l]}for(const l in e.attributes){const t=j[l]||l.toLowerCase();if(void 0!==o[l]){const n=s.accessors[e.attributes[l]],r=F[n.componentType];c[t]=r.name,a[t]=!0===n.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t){n.decodeDracoFile(e,(function(e){for(const t in e.attributes){const s=e.attributes[t],n=a[t];void 0!==n&&(s.normalized=n)}t(e)}),i,c)}))}))}}class b{constructor(){this.name=l.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class I extends i.Wid{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),s=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),n=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new i.Ilk).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(e){for(const t in a)e.uniforms[t]=a[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",s).replace("#include <roughnessmap_fragment>",n).replace("#include <metalnessmap_fragment>",r).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(e){a.specular.value=e}},specularMap:{get:function(){return a.specularMap.value},set:function(e){a.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(e){a.glossiness.value=e}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(e){a.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class P{constructor(){this.name=l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return I}extendParams(e,t,s){const n=t.extensions[this.name];e.color=new i.Ilk(1,1,1),e.opacity=1;const r=[];if(Array.isArray(n.diffuseFactor)){const t=n.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==n.diffuseTexture&&r.push(s.assignTexture(e,"map",n.diffuseTexture,i.knz)),e.emissive=new i.Ilk(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new i.Ilk(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){const t=n.specularGlossinessTexture;r.push(s.assignTexture(e,"glossinessMap",t)),r.push(s.assignTexture(e,"specularMap",t,i.knz))}return Promise.all(r)}createMaterial(e){const t=new I(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=i.IOt,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class N{constructor(){this.name=l.KHR_MESH_QUANTIZATION}}class C extends i._C8{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,r=e*n*3+n;for(let o=0;o!==n;o++)t[o]=s[r+o];return t}interpolate_(e,t,s,n){const r=this.resultBuffer,o=this.sampleValues,i=this.valueSize,a=2*i,c=3*i,l=n-t,u=(s-t)/l,h=u*u,d=h*u,p=e*c,m=p-c,f=-2*d+3*h,g=d-h,T=1-f,x=g-h+u;for(let _=0;_!==i;_++){const e=o[m+_+i],t=o[m+_+a]*l,s=o[p+_+i],n=o[p+_]*l;r[_]=T*e+x*t+f*s+g*n}return r}}const O=new i._fP;class k extends C{interpolate_(e,t,s,n){const r=super.interpolate_(e,t,s,n);return O.fromArray(r).normalize().toArray(r),r}}const H={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},U={9728:i.TyD,9729:i.wem,9984:i.YLQ,9985:i.qyh,9986:i.aH4,9987:i.D1R},D={33071:i.uWy,33648:i.OoA,10497:i.rpg},G={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},B={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},K={CUBICSPLINE:void 0,LINEAR:i.NMF,STEP:i.Syv},z={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function V(e){return void 0===e["DefaultMaterial"]&&(e["DefaultMaterial"]=new i.Wid({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:i.Wl3})),e["DefaultMaterial"]}function X(e,t,s){for(const n in s.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=s.extensions[n])}function q(e,t){void 0!==t.extras&&("object"===typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function W(e,t,s){let n=!1,r=!1,o=!1;for(let l=0,u=t.length;l<u;l++){const e=t[l];if(void 0!==e.POSITION&&(n=!0),void 0!==e.NORMAL&&(r=!0),void 0!==e.COLOR_0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(e);const i=[],a=[],c=[];for(let l=0,u=t.length;l<u;l++){const u=t[l];if(n){const t=void 0!==u.POSITION?s.getDependency("accessor",u.POSITION):e.attributes.position;i.push(t)}if(r){const t=void 0!==u.NORMAL?s.getDependency("accessor",u.NORMAL):e.attributes.normal;a.push(t)}if(o){const t=void 0!==u.COLOR_0?s.getDependency("accessor",u.COLOR_0):e.attributes.color;c.push(t)}}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(c)]).then((function(t){const s=t[0],i=t[1],a=t[2];return n&&(e.morphAttributes.position=s),r&&(e.morphAttributes.normal=i),o&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}function J(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let s=0,n=t.weights.length;s<n;s++)e.morphTargetInfluences[s]=t.weights[s];if(t.extras&&Array.isArray(t.extras.targetNames)){const s=t.extras.targetNames;if(e.morphTargetInfluences.length===s.length){e.morphTargetDictionary={};for(let t=0,n=s.length;t<n;t++)e.morphTargetDictionary[s[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Y(e){const t=e.extensions&&e.extensions[l.KHR_DRACO_MESH_COMPRESSION];let s;return s=t?"draco:"+t.bufferView+":"+t.indices+":"+Z(t.attributes):e.indices+":"+Z(e.attributes)+":"+e.mode,s}function Z(e){let t="";const s=Object.keys(e).sort();for(let n=0,r=s.length;n<r;n++)t+=s[n]+":"+e[s[n]]+";";return t}function Q(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function $(e){return e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"}class ee{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new c,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const s=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,r=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"===typeof createImageBitmap||s||n&&r<98?this.textureLoader=new i.dpR(this.options.manager):this.textureLoader=new i.QRU(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.hH6(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])})).then((function(t){const o={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:s,userData:{}};X(r,o,n),q(o,n),Promise.all(s._invokeAll((function(e){return e.afterRoot&&e.afterRoot(o)}))).then((function(){e(o)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const s=t[n].joints;for(let t=0,n=s.length;t<n;t++)e[s[t]].isBone=!0}for(let n=0,r=e.length;n<r;n++){const t=e[n];void 0!==t.mesh&&(this._addNodeRef(this.meshCache,t.mesh),void 0!==t.skin&&(s[t.mesh].isSkinnedMesh=!0)),void 0!==t.camera&&this._addNodeRef(this.cameraCache,t.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),r=(e,t)=>{const s=this.associations.get(e);null!=s&&this.associations.set(t,s);for(const[n,o]of e.children.entries())r(o,t.children[n])};return r(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const r=e(t[n]);r&&s.push(r)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this.loadNode(t);break;case"mesh":n=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":n=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":n=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(n.map((function(t,n){return s.getDependency(e,n)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[l.KHR_BINARY_GLTF].body);const n=this.options;return new Promise((function(e,r){s.load(i.Zp0.resolveURL(t.uri,n.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const s=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+s)}))}loadAccessor(e){const t=this,s=this.json,n=this.json.accessors[e];if(void 0===n.bufferView&&void 0===n.sparse)return Promise.resolve(null);const r=[];return void 0!==n.bufferView?r.push(this.getDependency("bufferView",n.bufferView)):r.push(null),void 0!==n.sparse&&(r.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(r).then((function(e){const r=e[0],o=G[n.type],a=F[n.componentType],c=a.BYTES_PER_ELEMENT,l=c*o,u=n.byteOffset||0,h=void 0!==n.bufferView?s.bufferViews[n.bufferView].byteStride:void 0,d=!0===n.normalized;let p,m;if(h&&h!==l){const e=Math.floor(u/h),s="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+e+":"+n.count;let l=t.cache.get(s);l||(p=new a(r,e*h,n.count*h/c),l=new i.vpT(p,h/c),t.cache.add(s,l)),m=new i.kB5(l,o,u%h/c,d)}else p=null===r?new a(n.count*o):new a(r,u,n.count*o),m=new i.TlE(p,o,d);if(void 0!==n.sparse){const t=G.SCALAR,s=F[n.sparse.indices.componentType],c=n.sparse.indices.byteOffset||0,l=n.sparse.values.byteOffset||0,u=new s(e[1],c,n.sparse.count*t),h=new a(e[2],l,n.sparse.count*o);null!==r&&(m=new i.TlE(m.array.slice(),m.itemSize,m.normalized));for(let e=0,n=u.length;e<n;e++){const t=u[e];if(m.setX(t,h[e*o]),o>=2&&m.setY(t,h[e*o+1]),o>=3&&m.setZ(t,h[e*o+2]),o>=4&&m.setW(t,h[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m}))}loadTexture(e){const t=this.json,s=this.options,n=t.textures[e],r=n.source,o=t.images[r];let i=this.textureLoader;if(o.uri){const e=s.manager.getHandler(o.uri);null!==e&&(i=e)}return this.loadTextureImage(e,r,i)}loadTextureImage(e,t,s){const n=this,r=this.json,o=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,s).then((function(t){t.flipY=!1,t.name=o.name||a.name||"";const s=r.samplers||{},c=s[o.sampler]||{};return t.magFilter=U[c.magFilter]||i.wem,t.minFilter=U[c.minFilter]||i.D1R,t.wrapS=D[c.wrapS]||i.rpg,t.wrapT=D[c.wrapT]||i.rpg,n.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[c]=l,l}loadImageSource(e,t){const s=this,n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const o=n.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",l=!1;if(void 0!==o.bufferView)c=s.getDependency("bufferView",o.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:o.mimeType});return c=a.createObjectURL(t),c}));else if(void 0===o.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then((function(e){return new Promise((function(s,n){let o=s;!0===t.isImageBitmapLoader&&(o=function(e){const t=new i.xEZ(e);t.needsUpdate=!0,s(t)}),t.load(i.Zp0.resolveURL(e,r.path),o,void 0,n)}))})).then((function(e){return!0===l&&a.revokeObjectURL(c),e.userData.mimeType=o.mimeType||$(o.uri),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),e}));return this.sourceCache[e]=u,u}assignTexture(e,t,s,n){const r=this;return this.getDependency("texture",s.index).then((function(o){if(void 0===s.texCoord||0==s.texCoord||"aoMap"===t&&1==s.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+s.texCoord+" for texture "+t+" not yet supported."),r.extensions[l.KHR_TEXTURE_TRANSFORM]){const e=void 0!==s.extensions?s.extensions[l.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=r.associations.get(o);o=r.extensions[l.KHR_TEXTURE_TRANSFORM].extendTexture(o,e),r.associations.set(o,t)}}return void 0!==n&&(o.encoding=n),e[t]=o,o}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.UY4,i.F5T.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.nls,i.F5T.prototype.copy.call(t,s),t.color.copy(s.color),this.cache.add(e,t)),s=t}if(n||r||o){let e="ClonedMaterial:"+s.uuid+":";s.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),n&&(e+="derivative-tangents:"),r&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=s.clone(),r&&(t.vertexColors=!0),o&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(s))),s=t}s.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=s}getMaterialType(){return i.Wid}loadMaterial(e){const t=this,s=this.json,n=this.extensions,r=s.materials[e];let o;const a={},c=r.extensions||{},u=[];if(c[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=n[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=e.getMaterialType(),u.push(e.extendParams(a,r,t))}else if(c[l.KHR_MATERIALS_UNLIT]){const e=n[l.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),u.push(e.extendParams(a,r,t))}else{const s=r.pbrMetallicRoughness||{};if(a.color=new i.Ilk(1,1,1),a.opacity=1,Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;a.color.fromArray(e),a.opacity=e[3]}void 0!==s.baseColorTexture&&u.push(t.assignTexture(a,"map",s.baseColorTexture,i.knz)),a.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,a.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(u.push(t.assignTexture(a,"metalnessMap",s.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",s.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),u.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===r.doubleSided&&(a.side=i.ehD);const h=r.alphaMode||z.OPAQUE;if(h===z.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===z.MASK&&(a.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&o!==i.vBJ&&(u.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new i.FM8(1,1),void 0!==r.normalTexture.scale)){const e=r.normalTexture.scale;a.normalScale.set(e,e)}return void 0!==r.occlusionTexture&&o!==i.vBJ&&(u.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(a.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&o!==i.vBJ&&(a.emissive=(new i.Ilk).fromArray(r.emissiveFactor)),void 0!==r.emissiveTexture&&o!==i.vBJ&&u.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,i.knz)),Promise.all(u).then((function(){let s;return s=o===I?n[l.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new o(a),r.name&&(s.name=r.name),q(s,r),t.associations.set(s,{materials:e}),r.extensions&&X(n,s,r),s}))}createUniqueName(e){const t=i.iUV.sanitizeNodeName(e||"");let s=t;for(let n=1;this.nodeNamesUsed[s];++n)s=t+"_"+n;return this.nodeNamesUsed[s]=!0,s}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function r(e){return s[l.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(s){return ne(s,e,t)}))}const o=[];for(let a=0,c=e.length;a<c;a++){const s=e[a],c=Y(s),u=n[c];if(u)o.push(u.promise);else{let e;e=s.extensions&&s.extensions[l.KHR_DRACO_MESH_COMPRESSION]?r(s):ne(new i.u9r,s,t),n[c]={primitive:s,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,n=this.extensions,r=s.meshes[e],o=r.primitives,a=[];for(let i=0,c=o.length;i<c;i++){const e=void 0===o[i].material?V(this.cache):this.getDependency("material",o[i].material);a.push(e)}return a.push(t.loadGeometries(o)),Promise.all(a).then((function(s){const a=s.slice(0,s.length-1),c=s[s.length-1],l=[];for(let h=0,d=c.length;h<d;h++){const s=c[h],u=o[h];let d;const p=a[h];if(u.mode===H.TRIANGLES||u.mode===H.TRIANGLE_STRIP||u.mode===H.TRIANGLE_FAN||void 0===u.mode)d=!0===r.isSkinnedMesh?new i.TUv(s,p):new i.Kj0(s,p),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),u.mode===H.TRIANGLE_STRIP?d.geometry=re(d.geometry,i.UlW):u.mode===H.TRIANGLE_FAN&&(d.geometry=re(d.geometry,i.z$h));else if(u.mode===H.LINES)d=new i.ejS(s,p);else if(u.mode===H.LINE_STRIP)d=new i.x12(s,p);else if(u.mode===H.LINE_LOOP)d=new i.blk(s,p);else{if(u.mode!==H.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);d=new i.woe(s,p)}Object.keys(d.geometry.morphAttributes).length>0&&J(d,r),d.name=t.createUniqueName(r.name||"mesh_"+e),q(d,r),u.extensions&&X(n,d,u),t.assignFinalMaterial(d),l.push(d)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const u=new i.ZAu;t.associations.set(u,{meshes:e});for(let e=0,t=l.length;e<t;e++)u.add(l[e]);return u}))}loadCamera(e){let t;const s=this.json.cameras[e],n=s[s.type];if(n)return"perspective"===s.type?t=new i.cPb(i.M8C.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===s.type&&(t=new i.iKG(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),q(t,s),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],s={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(s):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return s.inverseBindMatrices=e,s}))}loadAnimation(e){const t=this.json,s=t.animations[e],n=[],r=[],o=[],a=[],c=[];for(let i=0,l=s.channels.length;i<l;i++){const e=s.channels[i],t=s.samplers[e.sampler],l=e.target,u=l.node,h=void 0!==s.parameters?s.parameters[t.input]:t.input,d=void 0!==s.parameters?s.parameters[t.output]:t.output;n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",h)),o.push(this.getDependency("accessor",d)),a.push(t),c.push(l)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(o),Promise.all(a),Promise.all(c)]).then((function(t){const n=t[0],r=t[1],o=t[2],a=t[3],c=t[4],l=[];for(let e=0,s=n.length;e<s;e++){const t=n[e],s=r[e],u=o[e],h=a[e],d=c[e];if(void 0===t)continue;let p;switch(t.updateMatrix(),B[d.path]){case B.weights:p=i.dUE;break;case B.rotation:p=i.iLg;break;case B.position:case B.scale:default:p=i.yC1;break}const m=t.name?t.name:t.uuid,f=void 0!==h.interpolation?K[h.interpolation]:i.NMF,g=[];B[d.path]===B.weights?t.traverse((function(e){e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)})):g.push(m);let T=u.array;if(u.normalized){const e=Q(T.constructor),t=new Float32Array(T.length);for(let s=0,n=T.length;s<n;s++)t[s]=T[s]*e;T=t}for(let e=0,n=g.length;e<n;e++){const t=new p(g[e]+"."+B[d.path],s.array,T,f);"CUBICSPLINE"===h.interpolation&&(t.createInterpolant=function(e){const t=this instanceof i.iLg?k:C;return new t(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const u=s.name?s.name:"animation_"+e;return new i.m7l(u,void 0,l)}))}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return void 0===n.mesh?null:s.getDependency("mesh",n.mesh).then((function(e){const t=s._getNodeRef(s.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,s=n.weights.length;t<s;t++)e.morphTargetInfluences[t]=n.weights[t]})),t}))}loadNode(e){const t=this.json,s=this.extensions,n=this,r=t.nodes[e],o=r.name?n.createUniqueName(r.name):"";return function(){const t=[],s=n._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return s&&t.push(s),void 0!==r.camera&&t.push(n.getDependency("camera",r.camera).then((function(e){return n._getNodeRef(n.cameraCache,r.camera,e)}))),n._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let a;if(a=!0===r.isBone?new i.N$j:t.length>1?new i.ZAu:1===t.length?t[0]:new i.Tme,a!==t[0])for(let e=0,s=t.length;e<s;e++)a.add(t[e]);if(r.name&&(a.userData.name=r.name,a.name=o),q(a,r),r.extensions&&X(s,a,r),void 0!==r.matrix){const e=new i.yGw;e.fromArray(r.matrix),a.applyMatrix4(e)}else void 0!==r.translation&&a.position.fromArray(r.translation),void 0!==r.rotation&&a.quaternion.fromArray(r.rotation),void 0!==r.scale&&a.scale.fromArray(r.scale);return n.associations.has(a)||n.associations.set(a,{}),n.associations.get(a).nodes=e,a}))}loadScene(e){const t=this.json,s=this.extensions,n=this.json.scenes[e],r=this,o=new i.ZAu;n.name&&(o.name=r.createUniqueName(n.name)),q(o,n),n.extensions&&X(s,o,n);const a=n.nodes||[],c=[];for(let i=0,l=a.length;i<l;i++)c.push(te(a[i],o,t,r));return Promise.all(c).then((function(){const e=e=>{const t=new Map;for(const[s,n]of r.associations)(s instanceof i.F5T||s instanceof i.xEZ)&&t.set(s,n);return e.traverse((e=>{const s=r.associations.get(e);null!=s&&t.set(e,s)})),t};return r.associations=e(o),o}))}}function te(e,t,s,n){const r=s.nodes[e];return n.getDependency("node",e).then((function(e){if(void 0===r.skin)return e;let t;return n.getDependency("skin",r.skin).then((function(e){t=e;const s=[];for(let r=0,o=t.joints.length;r<o;r++)s.push(n.getDependency("node",t.joints[r]));return Promise.all(s)})).then((function(s){return e.traverse((function(e){if(!e.isMesh)return;const n=[],r=[];for(let o=0,a=s.length;o<a;o++){const e=s[o];if(e){n.push(e);const s=new i.yGw;void 0!==t.inverseBindMatrices&&s.fromArray(t.inverseBindMatrices.array,16*o),r.push(s)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[o])}e.bind(new i.OdW(n,r),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const o=[];if(r.children){const t=r.children;for(let r=0,i=t.length;r<i;r++){const i=t[r];o.push(te(i,e,s,n))}}return Promise.all(o)}))}function se(e,t,s){const n=t.attributes,r=new i.ZzF;if(void 0===n.POSITION)return;{const e=s.json.accessors[n.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(r.set(new i.Pa4(t[0],t[1],t[2]),new i.Pa4(o[0],o[1],o[2])),e.normalized){const t=Q(F[e.componentType]);r.min.multiplyScalar(t),r.max.multiplyScalar(t)}}const o=t.targets;if(void 0!==o){const e=new i.Pa4,t=new i.Pa4;for(let n=0,r=o.length;n<r;n++){const r=o[n];if(void 0!==r.POSITION){const n=s.json.accessors[r.POSITION],o=n.min,i=n.max;if(void 0!==o&&void 0!==i){if(t.setX(Math.max(Math.abs(o[0]),Math.abs(i[0]))),t.setY(Math.max(Math.abs(o[1]),Math.abs(i[1]))),t.setZ(Math.max(Math.abs(o[2]),Math.abs(i[2]))),n.normalized){const e=Q(F[n.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(e)}e.boundingBox=r;const a=new i.aLr;r.getCenter(a.center),a.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=a}function ne(e,t,s){const n=t.attributes,r=[];function o(t,n){return s.getDependency("accessor",t).then((function(t){e.setAttribute(n,t)}))}for(const i in n){const t=j[i]||i.toLowerCase();t in e.attributes||r.push(o(n[i],t))}if(void 0!==t.indices&&!e.index){const n=s.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));r.push(n)}return q(e,t),se(e,t,s),Promise.all(r).then((function(){return void 0!==t.targets?W(e,t.targets,s):e}))}function re(e,t){let s=e.getIndex();if(null===s){const t=[],n=e.getAttribute("position");if(void 0===n)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),s=e.getIndex()}const n=s.count-2,r=[];if(t===i.z$h)for(let i=1;i<=n;i++)r.push(s.getX(0)),r.push(s.getX(i)),r.push(s.getX(i+1));else for(let i=0;i<n;i++)i%2===0?(r.push(s.getX(i)),r.push(s.getX(i+1)),r.push(s.getX(i+2))):(r.push(s.getX(i+2)),r.push(s.getX(i+1)),r.push(s.getX(i)));r.length/3!==n&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=e.clone();return o.setIndex(r),o}const oe=new WeakMap;class ie extends i.aNw{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,n){const r=new i.hH6(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(e=>{this.decodeDracoFile(e,t).catch(n)}),s,n)}decodeDracoFile(e,t,s,n){const r={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!s};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){const s=JSON.stringify(t);if(oe.has(e)){const t=oe.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const r=this.workerNextTaskID++,o=e.byteLength,i=this._getWorker(r,o).then((s=>(n=s,new Promise(((s,o)=>{n._callbacks[r]={resolve:s,reject:o},n.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return i.catch((()=>!0)).then((()=>{n&&r&&this._releaseTask(n,r)})),oe.set(e,{key:s,promise:i}),i}_createGeometry(e){const t=new i.u9r;e.index&&t.setIndex(new i.TlE(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const n=e.attributes[s],r=n.name,o=n.array,a=n.itemSize;t.setAttribute(r,new i.TlE(o,a))}return t}_loadLibrary(e,t){const s=new i.hH6(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise(((t,n)=>{s.load(e,t,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!==typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const s=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const n=ae.toString(),r=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const s=t.data;switch(s.type){case"decode":e._callbacks[s.id].resolve(s);break;case"error":e._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function ae(){let e,t;function s(e,t,s,o){const i=o.attributeIDs,a=o.attributeTypes;let c,l;const u=t.GetEncodedGeometryType(s);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeBufferToMesh(s,c);else{if(u!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");c=new e.PointCloud,l=t.DecodeBufferToPointCloud(s,c)}if(!l.ok()||0===c.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const n in i){const s=self[a[n]];let l,u;if(o.useUniqueIDs)u=i[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[i[n]]),-1===u)continue;l=t.GetAttribute(c,u)}h.attributes.push(r(e,t,c,n,s,l))}return u===e.TRIANGULAR_MESH&&(h.index=n(e,t,c)),e.destroy(c),h}function n(e,t,s){const n=s.num_faces(),r=3*n,o=4*r,i=e._malloc(o);t.GetTrianglesUInt32Array(s,o,i);const a=new Uint32Array(e.HEAPF32.buffer,i,r).slice();return e._free(i),{array:a,itemSize:1}}function r(e,t,s,n,r,i){const a=i.num_components(),c=s.num_points(),l=c*a,u=l*r.BYTES_PER_ELEMENT,h=o(e,r),d=e._malloc(u);t.GetAttributeDataArrayForAllPoints(s,i,h,u,d);const p=new r(e.HEAPF32.buffer,d,l).slice();return e._free(d),{name:n,array:p,itemSize:a}}function o(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}onmessage=function(n){const r=n.data;switch(r.type){case"init":e=r.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const n=r.buffer,o=r.taskConfig;t.then((e=>{const t=e.draco,i=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{const e=s(t,i,a,o),n=e.attributes.map((e=>e.array.buffer));e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:e},n)}catch(c){console.error(c),self.postMessage({type:"error",id:r.id,error:c.message})}finally{t.destroy(a),t.destroy(i)}}));break}}}var ce=s(35209);const{hasLayer:le}=o.LY,{addLayerModel:ue,addLayerWater:he}=o.Gx,{getLayerAll:de}=o.LY;var pe={components:{mapRain:o.V_,mapLoad:o.jH},data(){return{config:{accessToken:"pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",container:"map",zoom:17.54,center:[130.99382878516292,45.786372454679935],pitch:80,bearing:96.8,terrain:1,projection:!1},customLayer:"",lng:130.995,lat:45.7858,height:190,scale:1,rotate:[0,-.4,0],translate:[-295,-1.8,-49.5],model:null,isRain:!1,loading:!0}},mounted(){this.init()},methods:{init(){o.xt.initMap(this.config).then((e=>{this.map=e,this.addModel()}))},getCamera(){o.xt.getCamera()},addModel(){ue({id:"3dModel",position:[this.lng,this.lat],height:this.height,directionalLight:[{color:16776398,intensity:1,position:[-4700,4700,-2200]}],ambientLight:{color:16777215,intensity:.4},shadow:!1,edit:!1}).then((e=>{console.log(e),this.addGLTF(e,"/model/taoshan/taoshan.gltf")}))},addWater(e){let t=new i.DvJ(4e3,4e3,10),s=new i.YBo({color:2698526}),n=new i.Kj0(t,s);n.material.transparent=!0,n.material.opacity=.8;let r={x:2217,y:0,z:-1662};n.position.x=r.x,n.position.y=r.y,n.position.z=r.z,n.rotation.x=-Math.PI/2,e.add(n)},addGLTF(e,t){const s=new a,n=new ie;n.setDecoderPath("/draco/"),n.preload(),s.setDRACOLoader(n),s.load(t,(t=>{let s=this,n=t.scene,r={x:s.translate[0],y:s.translate[1],z:s.translate[2]},o={x:s.rotate[0],y:s.rotate[1],z:s.rotate[2]};n.scale.set(s.scale,s.scale,s.scale),n.position.set(r.x,r.y,r.z),n.rotation.set(o.x,o.y,o.z);let i=[];function a(){i.forEach((e=>{e.material.uniforms["time"].value+=1/60})),requestAnimationFrame(a)}n.traverse((t=>{if(t.isMesh){if(t.material.metalness=0,t.material.roughness=0,-1!==t.name.indexOf("water")){t.material.roughness=1,t.material.transparent=!0,t.material.opacity=.9;let s=document.createElement("div");s.className="model-label "+t.name,s.setAttribute("data-model",t.name),s.textContent="11111",s.onclick=()=>{};let n=new ce.j(s);n.position.set(r.x,r.y+10,r.z),n.rotation.set(o.x,o.y,o.z),e.add(n)}t.castShadow=!0,t.receiveShadow=!0}})),e.add(n),a(),console.log(n),this.loading=!1}))}}},me=pe,fe=(s(56250),s(43736)),ge=(0,fe.Z)(me,n,r,!1,null,"5ea9d6fd",null),Te=ge.exports},80245:function(e,t,s){"use strict";s.r(t);var n=s(52389),r=s.n(n),o=s(57125),i=s.n(o),a=i()(r());a.push([e.id,".form[data-v-5ea9d6fd]{background:#fff;padding:20px;left:0;margin:20px;width:400px;border-radius:5px;z-index:2}.form[data-v-5ea9d6fd],.model-label[data-v-5ea9d6fd]{position:absolute;top:0}.model-label[data-v-5ea9d6fd]{padding:5px;color:#fff;font-size:12px;border-radius:3px;cursor:pointer;background:rgba(0,0,0,.5)}.model-label[data-v-5ea9d6fd]:hover{background:rgba(60,170,255,.7);color:#fff}",""]),t["default"]=a},56250:function(e,t,s){var n=s(80245);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.id,n,""]]),n.locals&&(e.exports=n.locals);var r=s(57037).Z;r("68c28456",n,!0,{sourceMap:!1,shadowMode:!1})}}]);
|