Commit 625086b0 authored by p x's avatar p x
Browse files

init

parent 5e9d2300
Pipeline #3100 failed with stages
in 0 seconds
.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0}
\ No newline at end of file
import defined from"../../Core/defined.js";import destroyObject from"../../Core/destroyObject.js";import DeveloperError from"../../Core/DeveloperError.js";import knockout from"../../ThirdParty/knockout.js";import getElement from"../getElement.js";import VRButtonViewModel from"./VRButtonViewModel.js";const enterVRPath="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",exitVRPath="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function VRButton(e,t,o){if(!defined(e))throw new DeveloperError("container is required.");if(!defined(t))throw new DeveloperError("scene is required.");e=getElement(e);const r=new VRButtonViewModel(t,o);r._exitVRPath=exitVRPath,r._enterVRPath=enterVRPath;const n=document.createElement("button");n.type="button",n.className="cesium-button cesium-vrButton",n.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(n),knockout.applyBindings(r,n),this._container=e,this._viewModel=r,this._element=n}Object.defineProperties(VRButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),VRButton.prototype.isDestroyed=function(){return!1},VRButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};export default VRButton;
\ No newline at end of file
import defaultValue from"../../Core/defaultValue.js";import defined from"../../Core/defined.js";import destroyObject from"../../Core/destroyObject.js";import DeveloperError from"../../Core/DeveloperError.js";import EventHelper from"../../Core/EventHelper.js";import Fullscreen from"../../Core/Fullscreen.js";import OrthographicFrustum from"../../Core/OrthographicFrustum.js";import knockout from"../../ThirdParty/knockout.js";import NoSleep from"../../ThirdParty/nosleep.js";import createCommand from"../createCommand.js";import getElement from"../getElement.js";function lockScreen(e){let t=!1;const o=window.screen;return defined(o)&&(defined(o.lockOrientation)?t=o.lockOrientation(e):defined(o.mozLockOrientation)?t=o.mozLockOrientation(e):defined(o.msLockOrientation)?t=o.msLockOrientation(e):defined(o.orientation&&o.orientation.lock)&&(t=o.orientation.lock(e))),t}function unlockScreen(){const e=window.screen;defined(e)&&(defined(e.unlockOrientation)?e.unlockOrientation():defined(e.mozUnlockOrientation)?e.mozUnlockOrientation():defined(e.msUnlockOrientation)?e.msUnlockOrientation():defined(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function toggleVR(e,t,o,n){n()||(o()?(t.useWebVR=!1,e._locked&&(unlockScreen(),e._locked=!1),e._noSleep.disable(),Fullscreen.exitFullscreen(),o(!1)):(Fullscreen.fullscreen||Fullscreen.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=lockScreen("landscape")),t.useWebVR=!0,o(!0)))}function VRButtonViewModel(e,t){if(!defined(e))throw new DeveloperError("scene is required.");const o=this,n=knockout.observable(Fullscreen.enabled),r=knockout.observable(!1);this.isVRMode=void 0,knockout.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,knockout.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",(function(){return n()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}));const i=knockout.observable(!1);this._isOrthographic=void 0,knockout.defineProperty(this,"_isOrthographic",{get:function(){return i()}}),this._eventHelper=new EventHelper,this._eventHelper.add(e.preRender,(function(){i(e.camera.frustum instanceof OrthographicFrustum)})),this._locked=!1,this._noSleep=new NoSleep,this._command=createCommand((function(){toggleVR(o,e,r,i)}),knockout.getObservable(this,"isVREnabled")),this._vrElement=defaultValue(getElement(t),document.body),this._callback=function(){!Fullscreen.fullscreen&&r()&&(e.useWebVR=!1,o._locked&&(unlockScreen(),o._locked=!1),o._noSleep.disable(),r(!1))},document.addEventListener(Fullscreen.changeEventName,this._callback)}Object.defineProperties(VRButtonViewModel.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new DeveloperError("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}}),VRButtonViewModel.prototype.isDestroyed=function(){return!1},VRButtonViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};export default VRButtonViewModel;
\ No newline at end of file
.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0}.cesium-viewer,.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;padding-right:5px}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px}.cesium-viewer-fullscreenContainer,.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px}.cesium-viewer-cesium3DTilesInspectorContainer{display:block;position:absolute;top:50px;right:10px;max-height:calc(100% - 120px);box-sizing:border-box;overflow-y:auto;overflow-x:hidden}
\ No newline at end of file
import BoundingSphere from"../../Core/BoundingSphere.js";import Cartesian3 from"../../Core/Cartesian3.js";import Cartographic from"../../Core/Cartographic.js";import Clock from"../../Core/Clock.js";import defaultValue from"../../Core/defaultValue.js";import defer from"../../Core/defer.js";import defined from"../../Core/defined.js";import destroyObject from"../../Core/destroyObject.js";import DeveloperError from"../../Core/DeveloperError.js";import Event from"../../Core/Event.js";import EventHelper from"../../Core/EventHelper.js";import HeadingPitchRange from"../../Core/HeadingPitchRange.js";import Matrix4 from"../../Core/Matrix4.js";import ScreenSpaceEventType from"../../Core/ScreenSpaceEventType.js";import BoundingSphereState from"../../DataSources/BoundingSphereState.js";import ConstantPositionProperty from"../../DataSources/ConstantPositionProperty.js";import DataSourceCollection from"../../DataSources/DataSourceCollection.js";import DataSourceDisplay from"../../DataSources/DataSourceDisplay.js";import Entity from"../../DataSources/Entity.js";import EntityView from"../../DataSources/EntityView.js";import Property from"../../DataSources/Property.js";import Cesium3DTileset from"../../Scene/Cesium3DTileset.js";import computeFlyToLocationForRectangle from"../../Scene/computeFlyToLocationForRectangle.js";import ImageryLayer from"../../Scene/ImageryLayer.js";import SceneMode from"../../Scene/SceneMode.js";import TimeDynamicPointCloud from"../../Scene/TimeDynamicPointCloud.js";import knockout from"../../ThirdParty/knockout.js";import Animation from"../Animation/Animation.js";import AnimationViewModel from"../Animation/AnimationViewModel.js";import BaseLayerPicker from"../BaseLayerPicker/BaseLayerPicker.js";import createDefaultImageryProviderViewModels from"../BaseLayerPicker/createDefaultImageryProviderViewModels.js";import createDefaultTerrainProviderViewModels from"../BaseLayerPicker/createDefaultTerrainProviderViewModels.js";import CesiumWidget from"../CesiumWidget/CesiumWidget.js";import ClockViewModel from"../ClockViewModel.js";import FullscreenButton from"../FullscreenButton/FullscreenButton.js";import Geocoder from"../Geocoder/Geocoder.js";import getElement from"../getElement.js";import HomeButton from"../HomeButton/HomeButton.js";import InfoBox from"../InfoBox/InfoBox.js";import NavigationHelpButton from"../NavigationHelpButton/NavigationHelpButton.js";import ProjectionPicker from"../ProjectionPicker/ProjectionPicker.js";import SceneModePicker from"../SceneModePicker/SceneModePicker.js";import SelectionIndicator from"../SelectionIndicator/SelectionIndicator.js";import subscribeAndEvaluate from"../subscribeAndEvaluate.js";import Timeline from"../Timeline/Timeline.js";import VRButton from"../VRButton/VRButton.js";import Cesium3DTileFeature from"../../Scene/Cesium3DTileFeature.js";import JulianDate from"../../Core/JulianDate.js";import CesiumMath from"../../Core/Math.js";const boundingSphereScratch=new BoundingSphere;function onTimelineScrubfunction(e){const t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function getCesium3DTileFeatureDescription(e){const t=e.getPropertyIds();let i="";return t.forEach((function(t){const o=e.getProperty(t);defined(o)&&(i+=`<tr><th>${t}</th><td>${o}</td></tr>`)})),i.length>0&&(i=`<table class="cesium-infoBox-defaultTable"><tbody>${i}</tbody></table>`),i}function getCesium3DTileFeatureName(e){let t;const i=[],o=e.getPropertyIds();for(t=0;t<o.length;t++){const n=o[t];/^name$/i.test(n)?i[0]=e.getProperty(n):/name/i.test(n)?i[1]=e.getProperty(n):/^title$/i.test(n)?i[2]=e.getProperty(n):/^(id|identifier)$/i.test(n)?i[3]=e.getProperty(n):/element/i.test(n)?i[4]=e.getProperty(n):/(id|identifier)$/i.test(n)&&(i[5]=e.getProperty(n))}const n=i.length;for(t=0;t<n;t++){const e=i[t];if(defined(e)&&""!==e)return e}return"Unnamed Feature"}function pickEntity(e,t){const i=e.scene.pick(t.position);if(defined(i)){const e=defaultValue(i.id,i.primitive.id);if(e instanceof Entity)return e;if(i instanceof Cesium3DTileFeature)return new Entity({name:getCesium3DTileFeatureName(i),description:getCesium3DTileFeatureDescription(i),feature:i})}if(defined(e.scene.globe))return pickImageryLayerFeature(e,t.position)}const scratchStopTime=new JulianDate;function trackDataSourceClock(e,t,i){if(defined(i)){const o=i.clock;if(defined(o)&&(o.getValue(t),defined(e))){const t=o.startTime;let i=o.stopTime;JulianDate.equals(t,i)&&(i=JulianDate.addSeconds(t,CesiumMath.EPSILON2,scratchStopTime)),e.updateFromClock(),e.zoomTo(t,i)}}}const cartesian3Scratch=new Cartesian3;function pickImageryLayerFeature(e,t){const i=e.scene,o=i.camera.getPickRay(t),n=i.imageryLayers.pickImageryLayerFeatures(o,i);if(!defined(n))return;const r=new Entity({id:"Loading...",description:"Loading feature information..."});return n.then((function(t){if(e.selectedEntity!==r)return;if(!defined(t)||0===t.length)return void(e.selectedEntity=createNoFeaturesEntity());const i=t[0],o=new Entity({id:i.name,description:i.description});if(defined(i.position)){const t=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,cartesian3Scratch);o.position=new ConstantPositionProperty(t)}e.selectedEntity=o}),(function(){e.selectedEntity===r&&(e.selectedEntity=createNoFeaturesEntity())})),r}function createNoFeaturesEntity(){return new Entity({id:"None",description:"No features found."})}function enableVRUI(e,t){const i=e._geocoder,o=e._homeButton,n=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,l=e._infoBox,u=e._selectionIndicator,m=t?"hidden":"visible";if(defined(i)&&(i.container.style.visibility=m),defined(o)&&(o.container.style.visibility=m),defined(n)&&(n.container.style.visibility=m),defined(r)&&(r.container.style.visibility=m),defined(s)&&(s.container.style.visibility=m),defined(a)&&(a.container.style.visibility=m),defined(c)&&(c.container.style.visibility=m),defined(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=m),defined(l)&&(l.container.style.visibility=m),defined(u)&&(u.container.style.visibility=m),e._container){const i=t||!defined(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${i}px`,e.forceResize()}}function Viewer(e,t){if(!defined(e))throw new DeveloperError("container is required.");e=getElement(e),t=defaultValue(t,defaultValue.EMPTY_OBJECT);const i=(!defined(t.globe)||!1!==t.globe)&&(!defined(t.baseLayerPicker)||!1!==t.baseLayerPicker);if(!i&&defined(t.selectedImageryProviderViewModel))throw new DeveloperError("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");if(!i&&defined(t.selectedTerrainProviderViewModel))throw new DeveloperError("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");const o=this,n=document.createElement("div");n.className="cesium-viewer",e.appendChild(n);const r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",n.appendChild(r);const s=document.createElement("div");s.className="cesium-viewer-bottom",n.appendChild(s);const a=defaultValue(t.scene3DOnly,!1);let c,d,l=!1;defined(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new Clock,d=new ClockViewModel(c),l=!0),defined(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);const u=new CesiumWidget(r,{imageryProvider:!i&&!defined(t.imageryProvider)&&void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:defined(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});let m=t.dataSources,h=!1;defined(m)||(m=new DataSourceCollection,h=!0);const f=u.scene,p=new DataSourceDisplay({scene:f,dataSourceCollection:m}),y=new EventHelper;let g,_;if(y.add(c.onTick,Viewer.prototype._onTick,this),y.add(f.morphStart,Viewer.prototype._clearTrackedObject,this),!defined(t.selectionIndicator)||!1!==t.selectionIndicator){const e=document.createElement("div");e.className="cesium-viewer-selectionIndicatorContainer",n.appendChild(e),g=new SelectionIndicator(e,f)}if(!defined(t.infoBox)||!1!==t.infoBox){const e=document.createElement("div");e.className="cesium-viewer-infoBoxContainer",n.appendChild(e),_=new InfoBox(e);const t=_.viewModel;y.add(t.cameraClicked,Viewer.prototype._onInfoBoxCameraClicked,this),y.add(t.closeClicked,Viewer.prototype._onInfoBoxClockClicked,this)}const v=document.createElement("div");let S,w,k,E,C,T,P,D,B,b,V,M,I,j,L;if(v.className="cesium-viewer-toolbar",n.appendChild(v),!defined(t.geocoder)||!1!==t.geocoder){const e=document.createElement("div");let i;e.className="cesium-viewer-geocoderContainer",v.appendChild(e),defined(t.geocoder)&&"boolean"!==typeof t.geocoder&&(i=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new Geocoder({container:e,geocoderServices:i,scene:f}),y.add(S.viewModel.search.beforeExecute,Viewer.prototype._clearObjects,this)}if(defined(t.homeButton)&&!1===t.homeButton||(w=new HomeButton(v,f),defined(S)&&y.add(w.viewModel.command.afterExecute,(function(){const e=S.viewModel;e.searchText="",e.isSearchInProgress&&e.search()})),y.add(w.viewModel.command.beforeExecute,Viewer.prototype._clearTrackedObject,this)),!0===t.sceneModePicker&&a)throw new DeveloperError("options.sceneModePicker is not available when options.scene3DOnly is set to true.");if(a||defined(t.sceneModePicker)&&!1===t.sceneModePicker||(k=new SceneModePicker(v,f)),t.projectionPicker&&(E=new ProjectionPicker(v,f)),i){const e=defaultValue(t.imageryProviderViewModels,createDefaultImageryProviderViewModels()),i=defaultValue(t.terrainProviderViewModels,createDefaultTerrainProviderViewModels());C=new BaseLayerPicker(v,{globe:f.globe,imageryProviderViewModels:e,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:i,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});const o=v.getElementsByClassName("cesium-baseLayerPicker-dropDown");T=o[0]}if(defined(t.imageryProvider)&&!1!==t.imageryProvider&&(i&&(C.viewModel.selectedImagery=void 0),f.imageryLayers.removeAll(),f.imageryLayers.addImageryProvider(t.imageryProvider)),defined(t.terrainProvider)&&(i&&(C.viewModel.selectedTerrain=void 0),f.terrainProvider=t.terrainProvider),!defined(t.navigationHelpButton)||!1!==t.navigationHelpButton){let e=!0;try{if(defined(window.localStorage)){const t=window.localStorage.getItem("cesium-hasSeenNavHelp");defined(t)&&Boolean(t)?e=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(z){}P=new NavigationHelpButton({container:v,instructionsInitiallyVisible:defaultValue(t.navigationInstructionsInitiallyVisible,e)})}if(!defined(t.animation)||!1!==t.animation){const e=document.createElement("div");e.className="cesium-viewer-animationContainer",n.appendChild(e),D=new Animation(e,new AnimationViewModel(d))}if(!defined(t.timeline)||!1!==t.timeline){const e=document.createElement("div");e.className="cesium-viewer-timelineContainer",n.appendChild(e),B=new Timeline(e,c),B.addEventListener("settime",onTimelineScrubfunction,!1),B.zoomTo(c.startTime,c.stopTime)}if(defined(t.fullscreenButton)&&!1===t.fullscreenButton||(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",n.appendChild(M),b=new FullscreenButton(M,t.fullscreenElement),V=subscribeAndEvaluate(b.viewModel,"isFullscreenEnabled",(function(e){M.style.display=e?"block":"none",defined(B)&&(B.container.style.right=`${M.clientWidth}px`,B.resize())}))),t.vrButton){const e=document.createElement("div");e.className="cesium-viewer-vrContainer",n.appendChild(e),I=new VRButton(e,f,t.fullScreenElement),j=subscribeAndEvaluate(I.viewModel,"isVREnabled",(function(t){e.style.display=t?"block":"none",defined(b)&&(e.style.right=`${M.clientWidth}px`),defined(B)&&(B.container.style.right=`${e.clientWidth}px`,B.resize())})),L=subscribeAndEvaluate(I.viewModel,"isVRMode",(function(e){enableVRUI(o,e)}))}this._baseLayerPickerDropDown=T,this._fullscreenSubscription=V,this._vrSubscription=j,this._vrModeSubscription=L,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=defaultValue(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=n,this._cesiumWidget=u,this._selectionIndicator=g,this._infoBox=_,this._dataSourceCollection=m,this._destroyDataSourceCollection=h,this._dataSourceDisplay=p,this._clockViewModel=d,this._destroyClockViewModel=l,this._toolbar=v,this._homeButton=w,this._sceneModePicker=k,this._projectionPicker=E,this._baseLayerPicker=C,this._navigationHelpButton=P,this._animation=D,this._timeline=B,this._fullscreenButton=b,this._vrButton=I,this._geocoder=S,this._eventHelper=y,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=defined(_)||defined(g),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Event,this._trackedEntityChanged=new Event,knockout.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),y.add(m.dataSourceAdded,Viewer.prototype._onDataSourceAdded,this),y.add(m.dataSourceRemoved,Viewer.prototype._onDataSourceRemoved,this),y.add(f.postUpdate,Viewer.prototype.resize,this),y.add(f.postRender,Viewer.prototype._postRender,this);const x=m.length;for(let F=0;F<x;F++)this._dataSourceAdded(m,m.get(F));function R(e){const t=pickEntity(o,e);defined(t)?Property.getValueOrUndefined(t.position,o.clock.currentTime)?o.trackedEntity=t:o.zoomTo(t):defined(o.trackedEntity)&&(o.trackedEntity=void 0)}function A(e){o.selectedEntity=pickEntity(o,e)}this._dataSourceAdded(void 0,p.defaultDataSource),y.add(m.dataSourceAdded,Viewer.prototype._dataSourceAdded,this),y.add(m.dataSourceRemoved,Viewer.prototype._dataSourceRemoved,this),u.screenSpaceEventHandler.setInputAction(A,ScreenSpaceEventType.LEFT_CLICK),u.screenSpaceEventHandler.setInputAction(R,ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}function zoomToOrFly(e,t,i,o){if(!defined(t))throw new DeveloperError("zoomTarget is required.");cancelZoom(e);const n=defer();return e._zoomPromise=n,e._zoomIsFlight=o,e._zoomOptions=i,Promise.resolve(t).then((function(t){if(e._zoomPromise===n)if(t instanceof ImageryLayer)t.getViewableRectangle().then((function(t){return computeFlyToLocationForRectangle(t,e.scene)})).then((function(t){e._zoomPromise===n&&(e._zoomTarget=t)}));else if(t instanceof Cesium3DTileset)e._zoomTarget=t;else if(t instanceof TimeDynamicPointCloud)e._zoomTarget=t;else if(t.isLoading&&defined(t.loadingEvent)){const i=t.loadingEvent.addEventListener((function(){i(),e._zoomPromise===n&&(e._zoomTarget=t.entities.values.slice(0))}))}else Array.isArray(t)?e._zoomTarget=t.slice(0):(t=defaultValue(t.values,t),defined(t.entities)&&(t=t.entities.values),Array.isArray(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t])})),e.scene.requestRender(),n.promise}function clearZoom(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom(e){const t=e._zoomPromise;defined(t)&&(clearZoom(e),t.resolve(!1))}function updateZoomTarget(e){const t=e._zoomTarget;if(!defined(t)||e.scene.mode===SceneMode.MORPHING)return;const i=e.scene,o=i.camera,n=e._zoomPromise,r=defaultValue(e._zoomOptions,{});let s;if(t instanceof Cesium3DTileset)return t.readyPromise.then((function(){const i=t.boundingSphere;defined(r.offset)||(r.offset=new HeadingPitchRange(0,-.5,i.radius)),s={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?o.flyToBoundingSphere(t.boundingSphere,s):(o.viewBoundingSphere(i,r.offset),o.lookAtTransform(Matrix4.IDENTITY),n.resolve(!0)),clearZoom(e)}));if(t instanceof TimeDynamicPointCloud)return t.readyPromise.then((function(){const i=t.boundingSphere;defined(r.offset)||(r.offset=new HeadingPitchRange(0,-.5,i.radius)),s={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?o.flyToBoundingSphere(i,s):(o.viewBoundingSphere(i,r.offset),o.lookAtTransform(Matrix4.IDENTITY),n.resolve(!0)),clearZoom(e)}));if(t instanceof Cartographic)return s={destination:i.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?o.flyTo(s):(o.setView(s),n.resolve(!0)),void clearZoom(e);const a=t,c=[];for(let l=0,u=a.length;l<u;l++){const t=e._dataSourceDisplay.getBoundingSphere(a[l],!1,boundingSphereScratch);if(t===BoundingSphereState.PENDING)return;t!==BoundingSphereState.FAILED&&c.push(BoundingSphere.clone(boundingSphereScratch))}if(0===c.length)return void cancelZoom(e);e.trackedEntity=void 0;const d=BoundingSphere.fromBoundingSpheres(c);e._zoomIsFlight?(clearZoom(e),o.flyToBoundingSphere(d,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)},offset:r.offset})):(o.viewBoundingSphere(d,r.offset),o.lookAtTransform(Matrix4.IDENTITY),clearZoom(e),n.resolve(!0))}function updateTrackedEntity(e){if(!e._needTrackedEntityUpdate)return;const t=e._trackedEntity,i=e.clock.currentTime,o=Property.getValueOrUndefined(t.position,i);if(!defined(o))return;const n=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,boundingSphereScratch);if(r===BoundingSphereState.PENDING)return;const s=n.mode;s!==SceneMode.COLUMBUS_VIEW&&s!==SceneMode.SCENE2D||(n.screenSpaceCameraController.enableTranslate=!1),s!==SceneMode.COLUMBUS_VIEW&&s!==SceneMode.SCENE3D||(n.screenSpaceCameraController.enableTilt=!1);const a=r!==BoundingSphereState.FAILED?boundingSphereScratch:void 0;e._entityView=new EntityView(t,n,n.mapProjection.ellipsoid),e._entityView.update(i,a),e._needTrackedEntityUpdate=!1}Object.defineProperties(Viewer.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,cancelZoom(this);const t=this.scene,i=t.mode;defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode.COLUMBUS_VIEW&&i!==SceneMode.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode.COLUMBUS_VIEW&&i!==SceneMode.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;const t=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(e)?defined(t)&&t.animateAppear():defined(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,trackDataSourceClock(this._timeline,this.clock,e))}}}),Viewer.prototype.extend=function(e,t){if(!defined(e))throw new DeveloperError("mixin is required.");e(this,t)},Viewer.prototype.resize=function(){const e=this._cesiumWidget,t=this._container,i=t.clientWidth,o=t.clientHeight,n=defined(this._animation),r=defined(this._timeline);if(e.resize(),i===this._lastWidth&&o===this._lastHeight)return;const s=o-125,a=this._baseLayerPickerDropDown;if(defined(a)&&(a.style.maxHeight=`${s}px`),defined(this._geocoder)){const e=this._geocoder.searchSuggestionsContainer;e.style.maxHeight=`${s}px`}defined(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);const c=this._timeline;let d,l=0,u=0,m=0;if(n&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){const e=this._lastWidth;d=this._animation.container,i>900?(l=169,e<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):i>=600?(l=136,(e<600||e>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(l=106,(e>600||0===e)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),u=l+5}if(r&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){const e=this._fullscreenButton,t=this._vrButton,i=c.container,o=i.style;m=i.clientHeight+3,o.left=`${l}px`;let n=0;defined(e)&&(n+=e.container.clientWidth),defined(t)&&(n+=t.container.clientWidth),o.right=`${n}px`,c.resize()}this._bottomContainer.style.left=`${u}px`,this._bottomContainer.style.bottom=`${m}px`,this._lastWidth=i,this._lastHeight=o},Viewer.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Viewer.prototype.render=function(){this._cesiumWidget.render()},Viewer.prototype.isDestroyed=function(){return!1},Viewer.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_DOUBLE_CLICK);const t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),defined(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),defined(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),defined(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),defined(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),defined(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),defined(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),defined(this._timeline)&&(this._timeline.removeEventListener("settime",onTimelineScrubfunction,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),defined(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),defined(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),defined(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),defined(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),destroyObject(this)},Viewer.prototype._dataSourceAdded=function(e,t){const i=t.entities;i.collectionChanged.addEventListener(Viewer.prototype._onEntityCollectionChanged,this)},Viewer.prototype._dataSourceRemoved=function(e,t){const i=t.entities;i.collectionChanged.removeEventListener(Viewer.prototype._onEntityCollectionChanged,this),defined(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),defined(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Viewer.prototype._onTick=function(e){const t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);const o=this._entityView;if(defined(o)){const e=this._trackedEntity,i=this._dataSourceDisplay.getBoundingSphere(e,!1,boundingSphereScratch);i===BoundingSphereState.DONE&&o.update(t,boundingSphereScratch)}let n,r=!1;const s=this.selectedEntity,a=defined(s)&&this._enableInfoOrSelection;if(a&&s.isShowing&&s.isAvailable(t)){const e=this._dataSourceDisplay.getBoundingSphere(s,!0,boundingSphereScratch);e!==BoundingSphereState.FAILED?n=boundingSphereScratch.center:defined(s.position)&&(n=s.position.getValue(t,n)),r=defined(n)}const c=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(c)&&(c.position=Cartesian3.clone(n,c.position),c.showSelection=a&&r,c.update());const d=defined(this._infoBox)?this._infoBox.viewModel:void 0;defined(d)&&(d.showInfo=a,d.enableCamera=r,d.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(d.titleText=defaultValue(s.name,s.id),d.description=Property.getValueOrDefault(s.description,t,"")):(d.titleText="",d.description=""))},Viewer.prototype._onEntityCollectionChanged=function(e,t,i){const o=i.length;for(let n=0;n<o;n++){const e=i[n];this.trackedEntity===e&&(this.trackedEntity=void 0),this.selectedEntity===e&&(this.selectedEntity=void 0)}},Viewer.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{const e=this.selectedEntity,t=e.position;defined(t)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Viewer.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Viewer.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Viewer.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Viewer.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&trackDataSourceClock(this.timeline,this.clock,e)},Viewer.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);const i=t.entities.id,o=this._eventHelper.add(t.changedEvent,Viewer.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=o},Viewer.prototype._onDataSourceRemoved=function(e,t){const i=this.clockTrackedDataSource===t,o=t.entities.id;if(this._dataSourceChangedListeners[o](),this._dataSourceChangedListeners[o]=void 0,i){const t=e.length;this._automaticallyTrackDataSourceClocks&&t>0?this.clockTrackedDataSource=e.get(t-1):this.clockTrackedDataSource=void 0}},Viewer.prototype.zoomTo=function(e,t){const i={offset:t};return zoomToOrFly(this,e,i,!1)},Viewer.prototype.flyTo=function(e,t){return zoomToOrFly(this,e,t,!0)},Viewer.prototype._postRender=function(){updateZoomTarget(this),updateTrackedEntity(this)};export default Viewer;
\ No newline at end of file
import Check from"../../Core/Check.js";import Cesium3DTilesInspector from"../Cesium3DTilesInspector/Cesium3DTilesInspector.js";function viewerCesium3DTilesInspectorMixin(e){Check.typeOf.object("viewer",e);const i=document.createElement("div");i.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(i);const s=new Cesium3DTilesInspector(i,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return s}}})}export default viewerCesium3DTilesInspectorMixin;
\ No newline at end of file
import defined from"../../Core/defined.js";import DeveloperError from"../../Core/DeveloperError.js";import CesiumInspector from"../CesiumInspector/CesiumInspector.js";function viewerCesiumInspectorMixin(e){if(!defined(e))throw new DeveloperError("viewer is required.");const r=document.createElement("div");r.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(r);const i=new CesiumInspector(r,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}export default viewerCesiumInspectorMixin;
\ No newline at end of file
import defaultValue from"../../Core/defaultValue.js";import defined from"../../Core/defined.js";import DeveloperError from"../../Core/DeveloperError.js";import Event from"../../Core/Event.js";import wrapFunction from"../../Core/wrapFunction.js";import CzmlDataSource from"../../DataSources/CzmlDataSource.js";import GeoJsonDataSource from"../../DataSources/GeoJsonDataSource.js";import KmlDataSource from"../../DataSources/KmlDataSource.js";import GpxDataSource from"../../DataSources/GpxDataSource.js";import getElement from"../getElement.js";function viewerDragDropMixin(e,r){if(!defined(e))throw new DeveloperError("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new DeveloperError("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new DeveloperError("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new DeveloperError("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new DeveloperError("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new DeveloperError("flyToOnDrop is already defined by another mixin.");r=defaultValue(r,defaultValue.EMPTY_OBJECT);let o=!0,t=defaultValue(r.flyToOnDrop,!0);const n=new Event;let a=defaultValue(r.clearOnDrop,!0),i=defaultValue(r.dropTarget,e.container),s=defaultValue(r.clampToGround,!0),d=r.proxy;function u(r){stop(r),a&&(e.entities.removeAll(),e.dataSources.removeAll());const o=r.dataTransfer.files,t=o.length;for(let n=0;n<t;n++){const r=o[n],t=new FileReader;t.onload=createOnLoadCallback(e,r,d,s),t.onerror=createDropErrorCallback(e,r),t.readAsText(r)}}i=getElement(i),Object.defineProperties(e,{dropTarget:{get:function(){return i},set:function(e){if(!defined(e))throw new DeveloperError("value is required.");unsubscribe(i,u),i=e,subscribe(i,u)}},dropEnabled:{get:function(){return o},set:function(e){e!==o&&(e?subscribe(i,u):unsubscribe(i,u),o=e)}},dropError:{get:function(){return n}},clearOnDrop:{get:function(){return a},set:function(e){a=e}},flyToOnDrop:{get:function(){return t},set:function(e){t=e}},proxy:{get:function(){return d},set:function(e){d=e}},clampToGround:{get:function(){return s},set:function(e){s=e}}}),subscribe(i,u),e.destroy=wrapFunction(e,e.destroy,(function(){e.dropEnabled=!1})),e._handleDrop=u}function stop(e){e.stopPropagation(),e.preventDefault()}function unsubscribe(e,r){const o=e;defined(o)&&(o.removeEventListener("drop",r,!1),o.removeEventListener("dragenter",stop,!1),o.removeEventListener("dragover",stop,!1),o.removeEventListener("dragexit",stop,!1))}function subscribe(e,r){e.addEventListener("drop",r,!1),e.addEventListener("dragenter",stop,!1),e.addEventListener("dragover",stop,!1),e.addEventListener("dragexit",stop,!1)}function createOnLoadCallback(e,r,o,t){const n=e.scene;return function(a){const i=r.name;try{let s;if(/\.czml$/i.test(i))s=CzmlDataSource.load(JSON.parse(a.target.result),{sourceUri:i});else if(/\.geojson$/i.test(i)||/\.json$/i.test(i)||/\.topojson$/i.test(i))s=GeoJsonDataSource.load(JSON.parse(a.target.result),{sourceUri:i,clampToGround:t});else if(/\.(kml|kmz)$/i.test(i))s=KmlDataSource.load(r,{sourceUri:i,proxy:o,camera:n.camera,canvas:n.canvas,clampToGround:t,screenOverlayContainer:e.container});else{if(!/\.gpx$/i.test(i))return void e.dropError.raiseEvent(e,i,`Unrecognized file: ${i}`);s=GpxDataSource.load(r,{sourceUri:i,proxy:o})}defined(s)&&e.dataSources.add(s).then((function(r){e.flyToOnDrop&&e.flyTo(r)})).catch((function(r){e.dropError.raiseEvent(e,i,r)}))}catch(s){e.dropError.raiseEvent(e,i,s)}}}function createDropErrorCallback(e,r){return function(o){e.dropError.raiseEvent(e,r.name,o.target.error)}}export default viewerDragDropMixin;
\ No newline at end of file
import defaultValue from"../../Core/defaultValue.js";import defined from"../../Core/defined.js";import DeveloperError from"../../Core/DeveloperError.js";import PerformanceWatchdog from"../PerformanceWatchdog/PerformanceWatchdog.js";function viewerPerformanceWatchdogMixin(e,r){if(!defined(e))throw new DeveloperError("viewer is required.");r=defaultValue(r,defaultValue.EMPTY_OBJECT);const o=new PerformanceWatchdog({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return o}}})}export default viewerPerformanceWatchdogMixin;
\ No newline at end of file
import defaultValue from"../Core/defaultValue.js";import defined from"../Core/defined.js";import DeveloperError from"../Core/DeveloperError.js";import Event from"../Core/Event.js";import knockout from"../ThirdParty/knockout.js";function createCommand(e,r){if(!defined(e))throw new DeveloperError("func is required.");r=defaultValue(r,!0);const t=new Event,o=new Event;function n(){if(!n.canExecute)throw new DeveloperError("Cannot execute command, canExecute is false.");const r={args:arguments,cancel:!1};let a;return t.raiseEvent(r),r.cancel||(a=e.apply(null,arguments),o.raiseEvent(a)),a}return n.canExecute=r,knockout.track(n,["canExecute"]),Object.defineProperties(n,{beforeExecute:{value:t},afterExecute:{value:o}}),n}export default createCommand;
\ No newline at end of file
import DeveloperError from"../Core/DeveloperError.js";function getElement(e){if("string"===typeof e){const t=document.getElementById(e);if(null===t)throw new DeveloperError(`Element with id "${e}" does not exist in the document.`);e=t}return e}export default getElement;
\ No newline at end of file
@import url(./lighterShared.css);@import url(./Animation/lighter.css);@import url(./BaseLayerPicker/lighter.css);@import url(./CesiumWidget/lighter.css);@import url(./Geocoder/lighter.css);@import url(./Timeline/lighter.css);@import url(./NavigationHelpButton/lighter.css);
\ No newline at end of file
.cesium-lighter .cesium-button{color:#111;fill:#111;background:#e2f0ff;border:1px solid #759dc0}.cesium-lighter .cesium-button:focus{color:#000;fill:#000;border-color:#ea4}.cesium-lighter .cesium-button:hover{color:#000;fill:#000;background:#a6d2ff;border-color:#aef;box-shadow:0 0 8px #777}.cesium-lighter .cesium-button:active{color:#fff;fill:#fff;background:#48b;border-color:#ea0}.cesium-lighter .cesium-button-disabled,.cesium-lighter .cesium-button-disabled:active,.cesium-lighter .cesium-button-disabled:focus,.cesium-lighter .cesium-button-disabled:hover,.cesium-lighter .cesium-button:disabled{background:#ccc;border-color:#999;color:#999;fill:#999;box-shadow:none}.cesium-lighter .cesium-performanceDisplay{background-color:#e2f0ff;border-color:#759dc0}.cesium-lighter .cesium-performanceDisplay-fps{color:#e52}.cesium-lighter .cesium-performanceDisplay-ms{color:#ea4}
\ No newline at end of file
.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-button-disabled,.cesium-button-disabled:active,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button:disabled{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default}.cesium-button option{background-color:#000;color:#eee}.cesium-button option:disabled{color:#777}.cesium-button input,.cesium-button label{cursor:pointer}.cesium-button input{vertical-align:sub}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right}.cesium-performanceDisplay{background-color:rgba(40,40,40,.7);padding:7px;border-radius:5px;border:1px solid #444;font:700 12px sans-serif}.cesium-performanceDisplay-fps{color:#e52}.cesium-performanceDisplay-throttled{color:#a42}.cesium-performanceDisplay-ms{color:#de3}
\ No newline at end of file
import knockout from"../ThirdParty/knockout.js";function subscribeAndEvaluate(t,e,r,u,o){return r.call(u,t[e]),knockout.getObservable(t,e).subscribe(r,u,o)}export default subscribeAndEvaluate;
\ No newline at end of file
@import url(./shared.css);@import url(./Animation/Animation.css);@import url(./BaseLayerPicker/BaseLayerPicker.css);@import url(./CesiumWidget/CesiumWidget.css);@import url(./CesiumInspector/CesiumInspector.css);@import url(./Cesium3DTilesInspector/Cesium3DTilesInspector.css);@import url(./FullscreenButton/FullscreenButton.css);@import url(./VRButton/VRButton.css);@import url(./Geocoder/Geocoder.css);@import url(./InfoBox/InfoBox.css);@import url(./SceneModePicker/SceneModePicker.css);@import url(./ProjectionPicker/ProjectionPicker.css);@import url(./PerformanceWatchdog/PerformanceWatchdog.css);@import url(./NavigationHelpButton/NavigationHelpButton.css);@import url(./SelectionIndicator/SelectionIndicator.css);@import url(./Timeline/Timeline.css);@import url(./Viewer/Viewer.css);
\ No newline at end of file
define(["exports"],(function(e){"use strict";const t={NONE:0,GEODESIC:1,RHUMB:2};var c=Object.freeze(t);e.ArcType=c}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./defaultValue-94c3e563"],(function(e,t,n,r,o){"use strict";const a={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",getMathType:function(e){switch(e){case a.SCALAR:return Number;case a.VEC2:return t.Cartesian2;case a.VEC3:return t.Cartesian3;case a.VEC4:return t.Cartesian4;case a.MAT2:return t.Matrix2;case a.MAT3:return t.Matrix3;case a.MAT4:return t.Matrix4;default:throw new r.DeveloperError("attributeType is not a valid value.")}},getNumberOfComponents:function(e){switch(e){case a.SCALAR:return 1;case a.VEC2:return 2;case a.VEC3:return 3;case a.VEC4:case a.MAT2:return 4;case a.MAT3:return 9;case a.MAT4:return 16;default:throw new r.DeveloperError("attributeType is not a valid value.")}},getAttributeLocationCount:function(e){switch(e){case a.SCALAR:case a.VEC2:case a.VEC3:case a.VEC4:return 1;case a.MAT2:return 2;case a.MAT3:return 3;case a.MAT4:return 4;default:throw new r.DeveloperError("attributeType is not a valid value.")}},getGlslType:function(e){switch(r.Check.typeOf.string("attributeType",e),e){case a.SCALAR:return"float";case a.VEC2:return"vec2";case a.VEC3:return"vec3";case a.VEC4:return"vec4";case a.MAT2:return"mat2";case a.MAT3:return"mat3";case a.MAT4:return"mat4";default:throw new r.DeveloperError("attributeType is not a valid value.")}}};var c=Object.freeze(a);const s=1/256,u=256,i={octEncodeInRange:function(e,o,a){r.Check.defined("vector",e),r.Check.defined("result",a);const c=t.Cartesian3.magnitudeSquared(e);if(Math.abs(c-1)>n.CesiumMath.EPSILON6)throw new r.DeveloperError("vector must be normalized.");if(a.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),a.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){const e=a.x,t=a.y;a.x=(1-Math.abs(t))*n.CesiumMath.signNotZero(e),a.y=(1-Math.abs(e))*n.CesiumMath.signNotZero(t)}return a.x=n.CesiumMath.toSNorm(a.x,o),a.y=n.CesiumMath.toSNorm(a.y,o),a},octEncode:function(e,t){return i.octEncodeInRange(e,255,t)}},d=new t.Cartesian2,f=new Uint8Array(1);function h(e){return f[0]=e,f[0]}i.octEncodeToCartesian4=function(e,t){return i.octEncodeInRange(e,65535,d),t.x=h(d.x*s),t.y=h(d.x),t.z=h(d.y*s),t.w=h(d.y),t},i.octDecodeInRange=function(e,o,a,c){if(r.Check.defined("result",c),e<0||e>a||o<0||o>a)throw new r.DeveloperError(`x and y must be unsigned normalized integers between 0 and ${a}`);if(c.x=n.CesiumMath.fromSNorm(e,a),c.y=n.CesiumMath.fromSNorm(o,a),c.z=1-(Math.abs(c.x)+Math.abs(c.y)),c.z<0){const e=c.x;c.x=(1-Math.abs(c.y))*n.CesiumMath.signNotZero(e),c.y=(1-Math.abs(e))*n.CesiumMath.signNotZero(c.y)}return t.Cartesian3.normalize(c,c)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octDecodeFromCartesian4=function(e,t){r.Check.typeOf.object("encoded",e),r.Check.typeOf.object("result",t);const n=e.x,o=e.y,a=e.z,c=e.w;if(n<0||n>255||o<0||o>255||a<0||a>255||c<0||c>255)throw new r.DeveloperError("x, y, z, and w must be unsigned normalized integers between 0 and 255");const s=n*u+o,d=a*u+c;return i.octDecodeInRange(s,d,65535,t)},i.octPackFloat=function(e){return r.Check.defined("encoded",e),256*e.x+e.y};const C=new t.Cartesian2;function l(e){return e>>1^-(1&e)}i.octEncodeFloat=function(e){return i.octEncode(e,C),i.octPackFloat(C)},i.octDecodeFloat=function(e,t){r.Check.defined("value",e);const n=e/256,o=Math.floor(n),a=256*(n-o);return i.octDecode(o,a,t)},i.octPack=function(e,t,n,o){r.Check.defined("v1",e),r.Check.defined("v2",t),r.Check.defined("v3",n),r.Check.defined("result",o);const a=i.octEncodeFloat(e),c=i.octEncodeFloat(t),s=i.octEncode(n,C);return o.x=65536*s.x+a,o.y=65536*s.y+c,o},i.octUnpack=function(e,t,n,o){r.Check.defined("packed",e),r.Check.defined("v1",t),r.Check.defined("v2",n),r.Check.defined("v3",o);let a=e.x/65536;const c=Math.floor(a),s=65536*(a-c);a=e.y/65536;const u=Math.floor(a),d=65536*(a-u);i.octDecodeFloat(s,t),i.octDecodeFloat(d,n),i.octDecode(c,u,o)},i.compressTextureCoordinates=function(e){r.Check.defined("textureCoordinates",e);const t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){r.Check.defined("compressed",e),r.Check.defined("result",t);const n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-4096*o)/4095,t},i.zigZagDeltaDecode=function(e,t,n){r.Check.defined("uBuffer",e),r.Check.defined("vBuffer",t),r.Check.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),o.defined(n)&&r.Check.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const a=e.length;let c=0,s=0,u=0;for(let r=0;r<a;++r)c+=l(e[r]),s+=l(t[r]),e[r]=c,t[r]=s,o.defined(n)&&(u+=l(n[r]),n[r]=u)},i.dequantize=function(e,t,o,a){r.Check.defined("typedArray",e),r.Check.defined("componentDatatype",t),r.Check.defined("type",o),r.Check.defined("count",a);const s=c.getNumberOfComponents(o);let u;switch(t){case n.ComponentDatatype.BYTE:u=127;break;case n.ComponentDatatype.UNSIGNED_BYTE:u=255;break;case n.ComponentDatatype.SHORT:u=32767;break;case n.ComponentDatatype.UNSIGNED_SHORT:u=65535;break;case n.ComponentDatatype.INT:u=2147483647;break;case n.ComponentDatatype.UNSIGNED_INT:u=4294967295;break;default:throw new r.DeveloperError(`Cannot dequantize component datatype: ${t}`)}const i=new Float32Array(a*s);for(let n=0;n<a;n++)for(let t=0;t<s;t++){const r=n*s+t;i[r]=Math.max(e[r]/u,-1)}return i},i.decodeRGB565=function(e,t){r.Check.defined("typedArray",e);const n=3*e.length;o.defined(t)&&r.Check.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const a=e.length;o.defined(t)||(t=new Float32Array(3*a));const c=31,s=63,u=1/31,i=1/63;for(let r=0;r<a;r++){const n=e[r],o=n>>11,a=n>>5&s,d=n&c,f=3*r;t[f]=o*u,t[f+1]=a*i,t[f+2]=d*u}return t},e.AttributeCompression=i}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./Transforms-3ac41eb6"],(function(e,n,i,t,a){"use strict";function m(e,i,a){this.minimum=n.Cartesian3.clone(t.defaultValue(e,n.Cartesian3.ZERO)),this.maximum=n.Cartesian3.clone(t.defaultValue(i,n.Cartesian3.ZERO)),a=t.defined(a)?n.Cartesian3.clone(a):n.Cartesian3.midpoint(this.minimum,this.maximum,new n.Cartesian3),this.center=a}m.fromCorners=function(e,a,r){return i.Check.defined("minimum",e),i.Check.defined("maximum",a),t.defined(r)||(r=new m),r.minimum=n.Cartesian3.clone(e,r.minimum),r.maximum=n.Cartesian3.clone(a,r.maximum),r.center=n.Cartesian3.midpoint(e,a,r.center),r},m.fromPoints=function(e,i){if(t.defined(i)||(i=new m),!t.defined(e)||0===e.length)return i.minimum=n.Cartesian3.clone(n.Cartesian3.ZERO,i.minimum),i.maximum=n.Cartesian3.clone(n.Cartesian3.ZERO,i.maximum),i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i;let a=e[0].x,r=e[0].y,u=e[0].z,s=e[0].x,c=e[0].y,o=e[0].z;const l=e.length;for(let n=1;n<l;n++){const i=e[n],t=i.x,m=i.y,l=i.z;a=Math.min(t,a),s=Math.max(t,s),r=Math.min(m,r),c=Math.max(m,c),u=Math.min(l,u),o=Math.max(l,o)}const d=i.minimum;d.x=a,d.y=r,d.z=u;const f=i.maximum;return f.x=s,f.y=c,f.z=o,i.center=n.Cartesian3.midpoint(d,f,i.center),i},m.clone=function(e,i){if(t.defined(e))return t.defined(i)?(i.minimum=n.Cartesian3.clone(e.minimum,i.minimum),i.maximum=n.Cartesian3.clone(e.maximum,i.maximum),i.center=n.Cartesian3.clone(e.center,i.center),i):new m(e.minimum,e.maximum,e.center)},m.equals=function(e,i){return e===i||t.defined(e)&&t.defined(i)&&n.Cartesian3.equals(e.center,i.center)&&n.Cartesian3.equals(e.minimum,i.minimum)&&n.Cartesian3.equals(e.maximum,i.maximum)};let r=new n.Cartesian3;m.intersectPlane=function(e,t){i.Check.defined("box",e),i.Check.defined("plane",t),r=n.Cartesian3.subtract(e.maximum,e.minimum,r);const m=n.Cartesian3.multiplyByScalar(r,.5,r),u=t.normal,s=m.x*Math.abs(u.x)+m.y*Math.abs(u.y)+m.z*Math.abs(u.z),c=n.Cartesian3.dot(e.center,u)+t.distance;return c-s>0?a.Intersect.INSIDE:c+s<0?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},e.AxisAlignedBoundingBox=m}));
\ No newline at end of file
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./Transforms-3ac41eb6"],(function(t,e,n,i,h){"use strict";function c(t,e,n,h){this.x=i.defaultValue(t,0),this.y=i.defaultValue(e,0),this.width=i.defaultValue(n,0),this.height=i.defaultValue(h,0)}c.packedLength=4,c.pack=function(t,e,h){return n.Check.typeOf.object("value",t),n.Check.defined("array",e),h=i.defaultValue(h,0),e[h++]=t.x,e[h++]=t.y,e[h++]=t.width,e[h]=t.height,e},c.unpack=function(t,e,h){return n.Check.defined("array",t),e=i.defaultValue(e,0),i.defined(h)||(h=new c),h.x=t[e++],h.y=t[e++],h.width=t[e++],h.height=t[e],h},c.fromPoints=function(t,e){if(i.defined(e)||(e=new c),!i.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;const n=t.length;let h=t[0].x,r=t[0].y,a=t[0].x,o=t[0].y;for(let i=1;i<n;i++){const e=t[i],n=e.x,c=e.y;h=Math.min(n,h),a=Math.max(n,a),r=Math.min(c,r),o=Math.max(c,o)}return e.x=h,e.y=r,e.width=a-h,e.height=o-r,e};const r=new h.GeographicProjection,a=new e.Cartographic,o=new e.Cartographic;c.fromRectangle=function(t,n,h){if(i.defined(h)||(h=new c),!i.defined(t))return h.x=0,h.y=0,h.width=0,h.height=0,h;n=i.defaultValue(n,r);const d=n.project(e.Rectangle.southwest(t,a)),u=n.project(e.Rectangle.northeast(t,o));return e.Cartesian2.subtract(u,d,u),h.x=d.x,h.y=d.y,h.width=u.x,h.height=u.y,h},c.clone=function(t,e){if(i.defined(t))return i.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new c(t.x,t.y,t.width,t.height)},c.union=function(t,e,h){n.Check.typeOf.object("left",t),n.Check.typeOf.object("right",e),i.defined(h)||(h=new c);const r=Math.min(t.x,e.x),a=Math.min(t.y,e.y),o=Math.max(t.x+t.width,e.x+e.width),d=Math.max(t.y+t.height,e.y+e.height);return h.x=r,h.y=a,h.width=o-r,h.height=d-a,h},c.expand=function(t,e,i){n.Check.typeOf.object("rectangle",t),n.Check.typeOf.object("point",e),i=c.clone(t,i);const h=e.x-i.x,r=e.y-i.y;return h>i.width?i.width=h:h<0&&(i.width-=h,i.x=e.x),r>i.height?i.height=r:r<0&&(i.height-=r,i.y=e.y),i},c.intersect=function(t,e){n.Check.typeOf.object("left",t),n.Check.typeOf.object("right",e);const i=t.x,c=t.y,r=e.x,a=e.y;return i>r+e.width||i+t.width<r||c+t.height<a||c>a+e.height?h.Intersect.OUTSIDE:h.Intersect.INTERSECTING},c.equals=function(t,e){return t===e||i.defined(t)&&i.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.intersect=function(t){return c.intersect(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},t.BoundingRectangle=c}));
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment