From 85c78edf31c80eb6d2ce1107ef8e81f1c77e6894 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Tue, 26 May 2020 22:40:05 -0400 Subject: [PATCH 01/36] Generate official TypeScript type definitions It's been a long requested feature for us to have official TypeScript type definitions. While the community has done a yeoman's job of manually supporting various efforts, the most recent incarnation of which is `@types/cesium`, the sheer scale and ever-evolving nature of Cesium's code base makes manual maintenance a Sisyphean task. Thankfully, our decision to maintain meticulous JSDoc API documentation continues to pay dividends and is what makes automatically generating TypeScript definitions possible. Using the excellent https://github.com/englercj/tsd-jsdoc project we can now automatically generate and even partially validate official definitions as part of the build process. (Thanks to @bampakoa who contributed some early PRs to both CesiumJS and tsd-jsdoc over a year ago and is how I learned about tsd-jsdoc) While tsd-jsdoc output is mostly where we need it to be, we do post-processing on it as well. This lets us clean up the output and also make sure these definitions work whether users include cesium via module, i.e. `import { Cartesian3 } from 'cesium'`, or individual files, i.e. `'import Cartesian3 from 'cesium/Source/Core/Cartesian3'`. There were also some quirks of tsd-jsdoc output we fixed that may eventually turn into a PR into that project from us. The post-processing is part typescript compiler API, part string manipulation. It works and is straightforward but we might want to go full TS api in the future if we decide we need to do more complicated tasks. The output of tsd-jsdoc is currently a little noisy because of some incorrect error reporting, but I'm talking with the maintainer in https://github.com/englercj/tsd-jsdoc/issues/133 to get them fixed. No need to hold up this PR for it though. The definition is generated as a single `Cesium.d.ts` file in Source, so it lives alongside Cesium.js. It is ignored by git but generated by a separate `build-ts` task as part of CI and makeZipFile. This task also validates the file by compiling it with TypeScript, so if a developer does anything too egregious, the build will fail. Definitions are automatically included in our npm packages and release zips and will be automatically used by IDEs thanks to the `types` setting in package.json. This means that IDEs such as VS Code will prefer these types over the existing `@types/cesium` version by default. I didn't want to slow the `build` step down, so I made this a separate step, but in the future we could consider running it by default and we could also unignore this file in Git so that PR reviewers can see the impact, if any, our code changes have on the generated definitions. This might be a good idea as an additional sanity check and should only actually change when the public API itself changes. But the issue would be remembering to run it before submitting the code (or we could use git hooks I suppose?) I just don't want to slow down devs so I'm hesitant to do anything like this out of the gate. We can definitely revisit in the future. A particular exciting thing about this approach is that it exposed a ton of badness in our current JSDoc markup, which is now fixed. Previously, our only concern was "does the doc look right" and we didn't pay attention to whether the meta information generated by JSDoc correctly captured type information (because up until it didn't matter). We leaned particular hard on `@exports` which acted as a catch-all but has now been completely removed from the codebase. All this means is that our documentation as a whole has now improved greatly and will continue to be maintained at this new higher level thanks to incorporating TS definition creation into our pipeline! One minor caveat here is that obviously we changed our JSDoc usage to both make it correct and also accommodate TypeScript. The main drawback to these fixes is that enums are now generated as globals in the doc, rather than modules. This means they no longer have their own dedicated page and are instead on the globals page, but I changed the code to ensure they are still in the table of contents that we generate. I think this trade-off is perfectly fine, but I wanted to mention it since it does change the doc some. We can certainly look into whether we can generate enums on their own page if we think that makes sense. (I actually like this approach a little better personally). Last major piece, the actual code. 99% of the changes in this PR only affect the JSDoc. There are two exceptions: A few of our enums also have private functions tacked onto them. I had to move these functions to be outside the initializer but otherwise they are unchanged. This ensures that a valid TS enum is generated from our code, since you can't have functions globbed onto enums in the TS world. If we were writing TS code by hand, we could use declaration merging with a namespace, but the toolchain we are using doesn't have a way to express that right now. There were two cases where these extra functions weren't private, `ComponentDataType` and `IndexDataType`. That means that as far as the TS definitions goes, the helper methods don't exist. I consder this an edge case and we can write up issues to investigate later. I'm actually not even sure if these functions are public on purposes, @lilleyse can you confirm? We had a few places where we had method signatures with optional parameters that came _before_ required parameters, which is silly. This is invalid TypeScript (and not good API design no matter the language). In 99% of cases this was `equalsEpsilon` style functions where the lhs/rhs were optional but the epsilon was not. I remember the discussion around this when we first did it because we were paranoid about defaulting to 0, but it's an edge case and it's silly so I just changed the epsilon functions to default to zero now, problem solved. Here's a high level summary of the JS changes: * Use proper `@enum` notation instead of `@exports` for enums. * Use proper `@namespace` instead of `@exports` for static classes. * Use proper `@function` instead of `@exports` for standalone functions. * Fix `Promise` markup to actually include the type in all cases, i.e. `Promise` => `Promise` or `Promise`. * Fix bad markup that referenced types that do not exist (or no longer exist) at the spec level, `Image` => `HTMLImageElement`, `Canvas` => `HTMLCanvasElement`, etc.. `TypedArray` in particular does not exist and much be expressed as a lsit of all applicable types, `Int8Array|Uint8Array|Int16Array|Uint16Array...`. * Use dot notation instead of tilde in callbacks, to better support TypeScript, i.e. `EasingFunction~Callback` becomes `EasingFunction.Callback`. The only exception is when we had a callback type that was i.e. `exportKml~ModelCallback` becomes `exportKmlModelCallback` (a module global type rather than a type on exportKml). This is because it's not possible to have exportKml be both a function and a namespace in this current toolchain. Not a big deal either way since these are meta-types used for defining callbacks but I wanted to mention it. * There were some edge cases where private types that were referenced in the public API but don't exist in the JSDoc. These were trivial to fix by either tweaking the JSDoc to avoid leaking the type or in some cases, just as `PixelDataType`, simply exposing the private type as public. I also found a few cases where things were accidentally public, I marked these as private (these were extreme edge cases so I'm not concerned about breaking changes). Appearances took an optional `RenderState` in their options, I just changed the type to `Object` which we can clean up further later if we need to. * Lots of other little misc JSDoc issues that became obvious once we started to generate definitions (duplicate parameters for example). Thanks again to the community for helping generate ideas and discussions around TS definitions over the last few years and a big thanks to @javagl for helping behind the scenes on this specific effort by evaluating a few different approaches and workaround before we settled on this one (I'm working on a blog with all of the gory details for those interested). Finally, while I'm thrilled with how this turned out (all ~41000 lines and 1.9MB of it), I can guarantee we will uncover some issues with the type definitions as more people use it. The good news is that improving it is now just a matter of fixing the JSDoc, which will benefit the community as a whole and not just TS users. Fixes #2730 Fixes #5717 --- .gitignore | 1 + .travis.yml | 1 + Apps/Sandcastle/gallery/Custom Geocoder.html | 2 +- .../Contributors/DocumentationGuide/README.md | 21 +- Source/Core/ApproximateTerrainHeights.js | 2 +- .../ArcGISTiledElevationTerrainProvider.js | 2 +- Source/Core/ArcType.js | 2 +- Source/Core/AttributeCompression.js | 2 +- Source/Core/BingMapsApi.js | 2 +- Source/Core/BingMapsGeocoderService.js | 2 +- Source/Core/Cartesian2.js | 4 +- Source/Core/Cartesian3.js | 4 +- Source/Core/Cartesian4.js | 4 +- Source/Core/Cartographic.js | 8 +- Source/Core/CartographicGeocoderService.js | 2 +- Source/Core/CesiumTerrainProvider.js | 4 +- Source/Core/ClockRange.js | 2 +- Source/Core/ClockStep.js | 2 +- Source/Core/ComponentDatatype.js | 4 +- Source/Core/CornerType.js | 2 +- Source/Core/CubicRealPolynomial.js | 2 +- Source/Core/EarthOrientationParameters.js | 2 +- Source/Core/EasingFunction.js | 66 +-- Source/Core/EllipsoidTerrainProvider.js | 2 +- Source/Core/Event.js | 4 +- Source/Core/EventHelper.js | 4 +- Source/Core/ExtrapolationType.js | 2 +- Source/Core/FeatureDetection.js | 7 +- Source/Core/Fullscreen.js | 5 +- Source/Core/GeocodeType.js | 2 +- Source/Core/GeocoderService.js | 4 +- Source/Core/GeometryAttribute.js | 4 +- Source/Core/GeometryPipeline.js | 2 +- Source/Core/GoogleEarthEnterpriseMetadata.js | 2 +- .../Core/GoogleEarthEnterpriseTerrainData.js | 2 +- .../GoogleEarthEnterpriseTerrainProvider.js | 4 +- Source/Core/GroundPolylineGeometry.js | 4 +- Source/Core/HeadingPitchRoll.js | 4 +- Source/Core/Heap.js | 6 +- Source/Core/HeightmapEncoding.js | 2 +- Source/Core/HeightmapTerrainData.js | 4 +- Source/Core/HeightmapTessellator.js | 4 +- Source/Core/HermitePolynomialApproximation.js | 2 +- Source/Core/Iau2000Orientation.js | 3 +- Source/Core/Iau2006XysData.js | 2 +- Source/Core/IauOrientationAxes.js | 5 +- Source/Core/IauOrientationParameters.js | 2 +- Source/Core/IndexDatatype.js | 2 +- Source/Core/InterpolationAlgorithm.js | 2 +- Source/Core/Intersect.js | 2 +- Source/Core/IntersectionTests.js | 3 +- Source/Core/Intersections2D.js | 2 +- Source/Core/Ion.js | 2 +- Source/Core/IonGeocoderService.js | 3 +- Source/Core/Iso8601.js | 2 +- Source/Core/JulianDate.js | 10 +- Source/Core/KeyboardEventModifier.js | 2 +- .../Core/LagrangePolynomialApproximation.js | 2 +- Source/Core/LinearApproximation.js | 2 +- Source/Core/MapboxApi.js | 2 +- Source/Core/Math.js | 9 +- Source/Core/Matrix2.js | 9 +- Source/Core/Matrix3.js | 8 +- Source/Core/Matrix4.js | 22 +- Source/Core/OpenCageGeocoderService.js | 6 +- Source/Core/Packable.js | 2 +- Source/Core/PackableForInterpolation.js | 4 +- Source/Core/PeliasGeocoderService.js | 2 +- Source/Core/PinBuilder.js | 8 +- Source/Core/PixelFormat.js | 426 +++++++++--------- Source/Core/PrimitiveType.js | 31 +- Source/Core/QuadraticRealPolynomial.js | 2 +- Source/Core/QuantizedMeshTerrainData.js | 2 +- Source/Core/QuarticRealPolynomial.js | 2 +- Source/Core/Quaternion.js | 13 +- Source/Core/Queue.js | 4 +- Source/Core/Rectangle.js | 12 +- Source/Core/ReferenceFrame.js | 2 +- Source/Core/Request.js | 23 +- Source/Core/RequestScheduler.js | 3 +- Source/Core/RequestState.js | 2 +- Source/Core/RequestType.js | 2 +- Source/Core/Resource.js | 38 +- Source/Core/ScreenSpaceEventHandler.js | 2 +- Source/Core/ScreenSpaceEventType.js | 2 +- Source/Core/Simon1994PlanetaryPositions.js | 2 +- Source/Core/TerrainData.js | 2 +- Source/Core/TerrainProvider.js | 2 +- Source/Core/TerrainQuantization.js | 2 +- Source/Core/TileProviderError.js | 4 +- Source/Core/TimeConstants.js | 2 +- Source/Core/TimeInterval.js | 29 +- Source/Core/TimeIntervalCollection.js | 8 +- Source/Core/TimeStandard.js | 2 +- Source/Core/Tipsify.js | 2 +- Source/Core/Transforms.js | 15 +- Source/Core/TridiagonalSystemSolver.js | 2 +- Source/Core/TrustedServers.js | 2 +- Source/Core/VRTheWorldTerrainProvider.js | 2 +- Source/Core/Visibility.js | 2 +- Source/Core/WebGLConstants.js | 2 +- Source/Core/WindingOrder.js | 21 +- Source/Core/barycentricCoordinates.js | 2 +- Source/Core/binarySearch.js | 6 +- Source/Core/cancelAnimationFrame.js | 2 +- Source/Core/clone.js | 2 +- Source/Core/combine.js | 2 +- Source/Core/createGuid.js | 2 +- Source/Core/createWorldTerrain.js | 2 +- Source/Core/defaultValue.js | 4 +- Source/Core/defined.js | 2 +- Source/Core/deprecationWarning.js | 2 +- Source/Core/destroyObject.js | 2 +- Source/Core/formatError.js | 2 +- Source/Core/getAbsoluteUri.js | 2 +- Source/Core/getBaseUri.js | 2 +- Source/Core/getExtensionFromUri.js | 2 +- Source/Core/getFilenameFromUri.js | 2 +- Source/Core/getImagePixels.js | 6 +- Source/Core/getTimestamp.js | 2 +- Source/Core/isBlobUri.js | 2 +- Source/Core/isDataUri.js | 2 +- Source/Core/isLeapYear.js | 2 +- Source/Core/loadCRN.js | 2 +- Source/Core/loadKTX.js | 2 +- Source/Core/mergeSort.js | 6 +- Source/Core/objectToQuery.js | 2 +- Source/Core/oneTimeWarning.js | 2 +- Source/Core/parseResponseHeaders.js | 2 +- Source/Core/pointInsideTriangle.js | 2 +- Source/Core/queryToObject.js | 2 +- Source/Core/requestAnimationFrame.js | 6 +- Source/Core/sampleTerrain.js | 2 +- Source/Core/sampleTerrainMostDetailed.js | 2 +- Source/Core/scaleToGeodeticSurface.js | 2 +- Source/Core/subdivideArray.js | 2 +- Source/Core/writeTextToCanvas.js | 4 +- Source/DataSources/BoundingSphereState.js | 2 +- Source/DataSources/BoxGeometryUpdater.js | 1 + Source/DataSources/CallbackProperty.js | 6 +- Source/DataSources/CylinderGeometryUpdater.js | 1 + Source/DataSources/DataSourceDisplay.js | 6 +- .../DataSources/EllipsoidGeometryUpdater.js | 1 + Source/DataSources/EntityCluster.js | 4 +- Source/DataSources/GeoJsonDataSource.js | 4 +- Source/DataSources/GeometryUpdater.js | 1 + Source/DataSources/GroundGeometryUpdater.js | 1 + Source/DataSources/KmlDataSource.js | 98 ++-- Source/DataSources/KmlTourFlyTo.js | 4 +- Source/DataSources/KmlTourWait.js | 4 +- Source/DataSources/PolylineGeometryUpdater.js | 1 + Source/DataSources/Rotation.js | 8 +- Source/DataSources/StripeOrientation.js | 2 +- Source/DataSources/TerrainOffsetProperty.js | 2 +- Source/DataSources/exportKml.js | 6 +- Source/Renderer/AutomaticUniforms.js | 294 ------------ Source/Renderer/PixelDatatype.js | 89 ++-- Source/Renderer/Texture.js | 4 +- Source/Renderer/TextureMagnificationFilter.js | 30 +- Source/Renderer/TextureMinificationFilter.js | 46 +- Source/Renderer/UniformState.js | 2 +- Source/Renderer/loadCubeMap.js | 2 +- Source/Scene/Appearance.js | 2 +- .../Scene/ArcGisMapServerImageryProvider.js | 4 +- Source/Scene/AttributeType.js | 2 +- Source/Scene/Axis.js | 2 +- Source/Scene/BatchTable.js | 8 +- Source/Scene/Billboard.js | 6 +- Source/Scene/BingMapsImageryProvider.js | 4 +- Source/Scene/BingMapsStyle.js | 2 +- Source/Scene/BlendEquation.js | 2 +- Source/Scene/BlendFunction.js | 2 +- Source/Scene/BlendOption.js | 2 +- Source/Scene/BlendingState.js | 2 +- Source/Scene/Camera.js | 18 +- Source/Scene/CameraEventAggregator.js | 2 +- Source/Scene/CameraEventType.js | 2 +- Source/Scene/Cesium3DTileColorBlendMode.js | 2 +- Source/Scene/Cesium3DTileOptimizationHint.js | 2 +- Source/Scene/Cesium3DTileOptimizations.js | 2 +- Source/Scene/Cesium3DTileRefine.js | 2 +- Source/Scene/Cesium3DTileset.js | 11 +- Source/Scene/ClassificationType.js | 12 +- Source/Scene/ColorBlendMode.js | 2 +- Source/Scene/CullFace.js | 2 +- Source/Scene/DebugAppearance.js | 2 +- Source/Scene/DepthFunction.js | 2 +- Source/Scene/DiscardEmptyTileImagePolicy.js | 4 +- Source/Scene/DiscardMissingTileImagePolicy.js | 2 +- Source/Scene/EllipsoidSurfaceAppearance.js | 2 +- Source/Scene/FrameState.js | 122 +++-- .../GoogleEarthEnterpriseImageryProvider.js | 9 +- .../GoogleEarthEnterpriseMapsProvider.js | 4 +- Source/Scene/GridImageryProvider.js | 4 +- Source/Scene/GroundPolylinePrimitive.js | 2 +- Source/Scene/GroundPrimitive.js | 2 +- Source/Scene/HeightReference.js | 2 +- Source/Scene/HorizontalOrigin.js | 2 +- Source/Scene/ImageryProvider.js | 6 +- Source/Scene/ImagerySplitDirection.js | 2 +- Source/Scene/IonImageryProvider.js | 2 +- Source/Scene/IonWorldImageryStyle.js | 2 +- Source/Scene/LabelStyle.js | 2 +- Source/Scene/MapMode2D.js | 2 +- Source/Scene/MapboxImageryProvider.js | 4 +- Source/Scene/MapboxStyleImageryProvider.js | 4 +- Source/Scene/MaterialAppearance.js | 19 +- Source/Scene/ModelAnimationLoop.js | 2 +- Source/Scene/NeverTileDiscardPolicy.js | 2 +- Source/Scene/OctahedralProjectedCubeMap.js | 2 +- Source/Scene/ParticleSystem.js | 6 +- Source/Scene/PerInstanceColorAppearance.js | 2 +- Source/Scene/PointCloud3DTileContent.js | 4 - Source/Scene/Polyline.js | 2 +- Source/Scene/PolylineColorAppearance.js | 2 +- Source/Scene/PolylineMaterialAppearance.js | 2 +- Source/Scene/PostProcessStageLibrary.js | 2 +- Source/Scene/PostProcessStageSampleMode.js | 2 +- Source/Scene/QuadtreeTileLoadState.js | 2 +- Source/Scene/Scene.js | 4 +- Source/Scene/SceneMode.js | 3 +- Source/Scene/SceneTransforms.js | 2 +- Source/Scene/ShadowMode.js | 13 +- Source/Scene/SingleTileImageryProvider.js | 4 +- Source/Scene/StencilFunction.js | 2 +- Source/Scene/StencilOperation.js | 2 +- Source/Scene/TextureAtlas.js | 6 +- Source/Scene/TileBoundingVolume.js | 7 +- .../Scene/TileCoordinatesImageryProvider.js | 4 +- Source/Scene/TileDiscardPolicy.js | 2 +- Source/Scene/TimeDynamicImagery.js | 2 +- Source/Scene/Tonemapper.js | 2 +- Source/Scene/TweenCollection.js | 34 +- Source/Scene/UrlTemplateImageryProvider.js | 4 +- Source/Scene/Vector3DTileGeometry.js | 2 +- Source/Scene/Vector3DTilePoints.js | 2 +- Source/Scene/Vector3DTilePolygons.js | 2 +- Source/Scene/Vector3DTilePolylines.js | 2 +- Source/Scene/VerticalOrigin.js | 2 +- Source/Scene/WebMapServiceImageryProvider.js | 4 +- .../Scene/WebMapTileServiceImageryProvider.js | 4 +- Source/Scene/createBillboardPointCallback.js | 6 +- Source/Scene/createOsmBuildings.js | 2 +- .../Scene/createTangentSpaceDebugPrimitive.js | 2 +- Source/Scene/createWorldImagery.js | 2 +- .../Widgets/Animation/AnimationViewModel.js | 12 +- .../BaseLayerPicker/ProviderViewModel.js | 4 +- .../CesiumInspectorViewModel.js | 2 +- Source/Widgets/CesiumWidget/CesiumWidget.js | 2 +- Source/Widgets/Geocoder/Geocoder.js | 4 +- Source/Widgets/Geocoder/GeocoderViewModel.js | 6 +- .../SelectionIndicatorViewModel.js | 4 +- Source/Widgets/SvgPathBindingHandler.js | 5 +- Source/Widgets/Viewer/Viewer.js | 6 +- .../viewerCesium3DTilesInspectorMixin.js | 2 +- .../Viewer/viewerCesiumInspectorMixin.js | 2 +- Source/Widgets/Viewer/viewerDragDropMixin.js | 4 +- .../Viewer/viewerPerformanceWatchdogMixin.js | 2 +- Source/Widgets/createCommand.js | 2 +- Source/Widgets/subscribeAndEvaluate.js | 2 +- .../WorkersES6/createTaskProcessorWorker.js | 10 +- Specs/Core/Cartesian2Spec.js | 6 - Specs/Core/Cartesian3Spec.js | 6 - Specs/Core/Cartesian4Spec.js | 6 - Specs/Core/CartographicSpec.js | 6 - Specs/Core/MathSpec.js | 6 - Specs/Core/Matrix2Spec.js | 6 - Specs/Core/Matrix3Spec.js | 6 - Specs/Core/Matrix4Spec.js | 21 - Specs/Core/QuaternionSpec.js | 6 - Specs/Core/RectangleSpec.js | 8 - Specs/Core/TimeIntervalSpec.js | 16 - Tools/jsdoc/cesium_template/publish.js | 6 + Tools/jsdoc/conf.json | 15 +- Tools/jsdoc/ts-conf.json | 32 ++ gulpfile.cjs | 139 +++++- package.json | 4 + 277 files changed, 1150 insertions(+), 1363 deletions(-) create mode 100644 Tools/jsdoc/ts-conf.json diff --git a/.gitignore b/.gitignore index c4ef272a1e2c..240b38f501bf 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Thumbs.db /Apps/Sandcastle/templates/bucket.css /Source/Cesium.js +/Source/Cesium.d.ts /Specs/SpecList.js /Source/Shaders/**/*.js diff --git a/.travis.yml b/.travis.yml index 2460cac0b634..0011687bc9b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ script: - npm --silent run prettier-check - npm --silent run build + - npm --silent run build-ts - npm --silent run coverage -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed - travis_wait 20 npm --silent run makeZipFile -- --concurrency 1 diff --git a/Apps/Sandcastle/gallery/Custom Geocoder.html b/Apps/Sandcastle/gallery/Custom Geocoder.html index eaec37884faf..f145f240a408 100644 --- a/Apps/Sandcastle/gallery/Custom Geocoder.html +++ b/Apps/Sandcastle/gallery/Custom Geocoder.html @@ -56,7 +56,7 @@ * The function called to geocode using this geocoder service. * * @param {String} input The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ OpenStreetMapNominatimGeocoder.prototype.geocode = function (input) { var endpoint = "https://nominatim.openstreetmap.org/search"; diff --git a/Documentation/Contributors/DocumentationGuide/README.md b/Documentation/Contributors/DocumentationGuide/README.md index d20b1884d9e3..788700a900d7 100644 --- a/Documentation/Contributors/DocumentationGuide/README.md +++ b/Documentation/Contributors/DocumentationGuide/README.md @@ -25,6 +25,7 @@ Generally, just follow the patterns that are already in comparable parts of the - [Property](#property) - [Property Getter/Setter](#property-gettersetter) - [Standalone Function](#standalone-function) +- [TypeScript type definitions](#typescript) ## Building the Doc @@ -52,7 +53,7 @@ Consider one of the simplest functions in CesiumJS, `defined`: ```javascript /** - * @exports defined + * @function * * @param {*} value The object. * @returns {Boolean} Returns true if the object is defined, returns false otherwise. @@ -70,7 +71,7 @@ function defined(value) { ``` - The doc for `defined` is in the comment starting with `/**`. JSDoc tags begin with `@`. -- `@exports` describes the name of the function that is exported from the module. +- `@function` tells JSDoc that this is a function. - `@param` describes the function's parameters, and `@returns` describes the function's return value. - `@example` describes a code sample. @@ -379,7 +380,7 @@ Cartesian4.fromArray = Cartesian4.unpack; /** * Sort the items in the queue in-place. * - * @param {Queue~Comparator} compareFunction A function that defines the sort order. + * @param {Queue.Comparator} compareFunction A function that defines the sort order. */ Queue.prototype.sort = function (compareFunction) { if (this._offset > 0) { @@ -393,7 +394,7 @@ Queue.prototype.sort = function (compareFunction) { /** * A function used to compare two items while sorting a queue. - * @callback Queue~Comparator + * @callback Queue.Comparator * * @param {*} a An item in the array. * @param {*} b An item in the array. @@ -535,7 +536,7 @@ DESCRIPTION. ``` DESCRIPTION. -@exports NAME +@function @param {TYPE} NAME DESCRIPTION. @param {TYPE|OTHER_TYPE} NAME DESCRIPTION WITH LONG @@ -552,3 +553,13 @@ DESCRIPTION. [@private] ``` + +# TypeScript + +We also use JSDoc to build official TypeScript type definitions. Normally this behavior is transparent to the developer and happens as part of CI, however incorrect or non-standard JSDoc can lead to failures. If CI is failing because of the `build-ts` step, you can debug it locally by running: + +``` +npm run build-ts +``` + +In most cases, the TypeScript compiler will provide a very obvious error and line number which will help you track down the offending, most likely incorrect, JSDoc. diff --git a/Source/Core/ApproximateTerrainHeights.js b/Source/Core/ApproximateTerrainHeights.js index 76138aa5a333..c571d4dadf09 100644 --- a/Source/Core/ApproximateTerrainHeights.js +++ b/Source/Core/ApproximateTerrainHeights.js @@ -36,7 +36,7 @@ var ApproximateTerrainHeights = {}; /** * Initializes the minimum and maximum terrain heights - * @return {Promise} + * @return {Promise} */ ApproximateTerrainHeights.initialize = function () { var initPromise = ApproximateTerrainHeights._initPromise; diff --git a/Source/Core/ArcGISTiledElevationTerrainProvider.js b/Source/Core/ArcGISTiledElevationTerrainProvider.js index f60d5d4d6e6b..5284fa54226d 100644 --- a/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -459,7 +459,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function ( * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/ArcType.js b/Source/Core/ArcType.js index be4685caba9f..2c53d3b539cd 100644 --- a/Source/Core/ArcType.js +++ b/Source/Core/ArcType.js @@ -1,7 +1,7 @@ /** * ArcType defines the path that should be taken connecting vertices. * - * @exports ArcType + * @enum {Number} */ var ArcType = { /** diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js index e50ee42734f1..dcabcdcb617d 100644 --- a/Source/Core/AttributeCompression.js +++ b/Source/Core/AttributeCompression.js @@ -11,7 +11,7 @@ var LEFT_SHIFT = 256.0; /** * Attribute compression and decompression functions. * - * @exports AttributeCompression + * @namespace AttributeCompression * * @private */ diff --git a/Source/Core/BingMapsApi.js b/Source/Core/BingMapsApi.js index aa98a5c11a07..6b2cbad640b2 100644 --- a/Source/Core/BingMapsApi.js +++ b/Source/Core/BingMapsApi.js @@ -7,7 +7,7 @@ import defined from "./defined.js"; * or {@link BingMapsGeocoderService}. You can create your own key at * {@link https://www.bingmapsportal.com/}. * - * @exports BingMapsApi + * @namespace BingMapsApi */ var BingMapsApi = {}; diff --git a/Source/Core/BingMapsGeocoderService.js b/Source/Core/BingMapsGeocoderService.js index 9c612328ed7d..82ba8af08a2c 100644 --- a/Source/Core/BingMapsGeocoderService.js +++ b/Source/Core/BingMapsGeocoderService.js @@ -58,7 +58,7 @@ Object.defineProperties(BingMapsGeocoderService.prototype, { * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ BingMapsGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/Cartesian2.js b/Source/Core/Cartesian2.js index 012eed00c8ad..64a5ca0422bf 100644 --- a/Source/Core/Cartesian2.js +++ b/Source/Core/Cartesian2.js @@ -665,7 +665,7 @@ Cartesian2.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian2} [left] The first Cartesian. * @param {Cartesian2} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -745,7 +745,7 @@ Cartesian2.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian2} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartesian3.js b/Source/Core/Cartesian3.js index ea2b96056caf..fa224fbf6490 100644 --- a/Source/Core/Cartesian3.js +++ b/Source/Core/Cartesian3.js @@ -742,7 +742,7 @@ Cartesian3.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian3} [left] The first Cartesian. * @param {Cartesian3} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -1152,7 +1152,7 @@ Cartesian3.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian3} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js index 82087c3bcd9b..3309b0749536 100644 --- a/Source/Core/Cartesian4.js +++ b/Source/Core/Cartesian4.js @@ -735,7 +735,7 @@ Cartesian4.equalsArray = function (cartesian, array, offset) { * * @param {Cartesian4} [left] The first Cartesian. * @param {Cartesian4} [right] The second Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -843,7 +843,7 @@ Cartesian4.prototype.equals = function (right) { * false otherwise. * * @param {Cartesian4} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Cartographic.js b/Source/Core/Cartographic.js index 42cb40cf9c5b..d0b7b144c463 100644 --- a/Source/Core/Cartographic.js +++ b/Source/Core/Cartographic.js @@ -233,13 +233,11 @@ Cartographic.equals = function (left, right) { * * @param {Cartographic} [left] The first cartographic. * @param {Cartographic} [right] The second cartographic. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Cartographic.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -286,7 +284,7 @@ Cartographic.prototype.equals = function (right) { * false otherwise. * * @param {Cartographic} [right] The second cartographic. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Cartographic.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/CartographicGeocoderService.js b/Source/Core/CartographicGeocoderService.js index 68b090f8ede6..dabaa326886b 100644 --- a/Source/Core/CartographicGeocoderService.js +++ b/Source/Core/CartographicGeocoderService.js @@ -15,7 +15,7 @@ function CartographicGeocoderService() {} * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ CartographicGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/CesiumTerrainProvider.js b/Source/Core/CesiumTerrainProvider.js index d7dfee685e15..587611b98e29 100644 --- a/Source/Core/CesiumTerrainProvider.js +++ b/Source/Core/CesiumTerrainProvider.js @@ -485,7 +485,7 @@ function CesiumTerrainProvider(options) { * When using the Quantized-Mesh format, a tile may be returned that includes additional extensions, such as PerVertexNormals, watermask, etc. * This enumeration defines the unique identifiers for each type of extension data that has been appended to the standard mesh data. * - * @exports QuantizedMeshExtensionIds + * @namespace QuantizedMeshExtensionIds * @see CesiumTerrainProvider * @private */ @@ -1201,7 +1201,7 @@ CesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) { * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ CesiumTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/ClockRange.js b/Source/Core/ClockRange.js index c4aeb2255b39..adc12d477499 100644 --- a/Source/Core/ClockRange.js +++ b/Source/Core/ClockRange.js @@ -2,7 +2,7 @@ * Constants used by {@link Clock#tick} to determine behavior * when {@link Clock#startTime} or {@link Clock#stopTime} is reached. * - * @exports ClockRange + * @enum {Number} * * @see Clock * @see ClockStep diff --git a/Source/Core/ClockStep.js b/Source/Core/ClockStep.js index 4675cf7f4551..269fbddaf8bf 100644 --- a/Source/Core/ClockStep.js +++ b/Source/Core/ClockStep.js @@ -2,7 +2,7 @@ * Constants to determine how much time advances with each call * to {@link Clock#tick}. * - * @exports ClockStep + * @enum {Number} * * @see Clock * @see ClockRange diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js index b4cdf116f70d..56c73c4099a8 100644 --- a/Source/Core/ComponentDatatype.js +++ b/Source/Core/ComponentDatatype.js @@ -7,7 +7,7 @@ import WebGLConstants from "./WebGLConstants.js"; * WebGL component datatypes. Components are intrinsics, * which form attributes, which form vertices. * - * @exports ComponentDatatype + * @enum {Number} */ var ComponentDatatype = { /** @@ -137,7 +137,7 @@ ComponentDatatype.getSizeInBytes = function (componentDatatype) { /** * Gets the {@link ComponentDatatype} for the provided TypedArray instance. * - * @param {TypedArray} array The typed array. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array. * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray. */ ComponentDatatype.fromTypedArray = function (array) { diff --git a/Source/Core/CornerType.js b/Source/Core/CornerType.js index 0260a53fe8a0..202d36dac32a 100644 --- a/Source/Core/CornerType.js +++ b/Source/Core/CornerType.js @@ -4,7 +4,7 @@ * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo} * demonstrates the three corner types, as used by {@link CorridorGraphics}. * - * @exports CornerType + * @enum {Number} */ var CornerType = { /** diff --git a/Source/Core/CubicRealPolynomial.js b/Source/Core/CubicRealPolynomial.js index c4b3390444f7..c87a43497238 100644 --- a/Source/Core/CubicRealPolynomial.js +++ b/Source/Core/CubicRealPolynomial.js @@ -4,7 +4,7 @@ import QuadraticRealPolynomial from "./QuadraticRealPolynomial.js"; /** * Defines functions for 3rd order polynomial functions of one variable with only real coefficients. * - * @exports CubicRealPolynomial + * @namespace CubicRealPolynomial */ var CubicRealPolynomial = {}; diff --git a/Source/Core/EarthOrientationParameters.js b/Source/Core/EarthOrientationParameters.js index 27ddc9eeefa7..11b697533d42 100644 --- a/Source/Core/EarthOrientationParameters.js +++ b/Source/Core/EarthOrientationParameters.js @@ -136,7 +136,7 @@ EarthOrientationParameters.NONE = Object.freeze({ * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is * ready to use. * - * @returns {Promise} The promise. + * @returns {Promise} The promise. */ EarthOrientationParameters.prototype.getPromiseToLoad = function () { return when(this._downloadPromise); diff --git a/Source/Core/EasingFunction.js b/Source/Core/EasingFunction.js index d3573cf158e9..c38aeddabad7 100644 --- a/Source/Core/EasingFunction.js +++ b/Source/Core/EasingFunction.js @@ -5,13 +5,13 @@ import Tween from "../ThirdParty/Tween.js"; * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. * - * @exports EasingFunction + * @namespace */ var EasingFunction = { /** * Linear easing. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ LINEAR_NONE: Tween.Easing.Linear.None, @@ -19,21 +19,21 @@ var EasingFunction = { /** * Quadratic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_IN: Tween.Easing.Quadratic.In, /** * Quadratic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_OUT: Tween.Easing.Quadratic.Out, /** * Quadratic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUADRACTIC_IN_OUT: Tween.Easing.Quadratic.InOut, @@ -41,21 +41,21 @@ var EasingFunction = { /** * Cubic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_IN: Tween.Easing.Cubic.In, /** * Cubic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_OUT: Tween.Easing.Cubic.Out, /** * Cubic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CUBIC_IN_OUT: Tween.Easing.Cubic.InOut, @@ -63,21 +63,21 @@ var EasingFunction = { /** * Quartic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_IN: Tween.Easing.Quartic.In, /** * Quartic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_OUT: Tween.Easing.Quartic.Out, /** * Quartic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUARTIC_IN_OUT: Tween.Easing.Quartic.InOut, @@ -85,21 +85,21 @@ var EasingFunction = { /** * Quintic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_IN: Tween.Easing.Quintic.In, /** * Quintic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_OUT: Tween.Easing.Quintic.Out, /** * Quintic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ QUINTIC_IN_OUT: Tween.Easing.Quintic.InOut, @@ -107,21 +107,21 @@ var EasingFunction = { /** * Sinusoidal in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_IN: Tween.Easing.Sinusoidal.In, /** * Sinusoidal out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_OUT: Tween.Easing.Sinusoidal.Out, /** * Sinusoidal in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ SINUSOIDAL_IN_OUT: Tween.Easing.Sinusoidal.InOut, @@ -129,21 +129,21 @@ var EasingFunction = { /** * Exponential in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_IN: Tween.Easing.Exponential.In, /** * Exponential out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_OUT: Tween.Easing.Exponential.Out, /** * Exponential in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ EXPONENTIAL_IN_OUT: Tween.Easing.Exponential.InOut, @@ -151,21 +151,21 @@ var EasingFunction = { /** * Circular in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_IN: Tween.Easing.Circular.In, /** * Circular out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_OUT: Tween.Easing.Circular.Out, /** * Circular in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ CIRCULAR_IN_OUT: Tween.Easing.Circular.InOut, @@ -173,21 +173,21 @@ var EasingFunction = { /** * Elastic in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_IN: Tween.Easing.Elastic.In, /** * Elastic out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_OUT: Tween.Easing.Elastic.Out, /** * Elastic in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ ELASTIC_IN_OUT: Tween.Easing.Elastic.InOut, @@ -195,21 +195,21 @@ var EasingFunction = { /** * Back in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_IN: Tween.Easing.Back.In, /** * Back out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_OUT: Tween.Easing.Back.Out, /** * Back in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BACK_IN_OUT: Tween.Easing.Back.InOut, @@ -217,21 +217,21 @@ var EasingFunction = { /** * Bounce in. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_IN: Tween.Easing.Bounce.In, /** * Bounce out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_OUT: Tween.Easing.Bounce.Out, /** * Bounce in then out. * - * @type {EasingFunction~Callback} + * @type {EasingFunction.Callback} * @constant */ BOUNCE_IN_OUT: Tween.Easing.Bounce.InOut, @@ -239,7 +239,7 @@ var EasingFunction = { /** * Function interface for implementing a custom easing function. - * @callback EasingFunction~Callback + * @callback EasingFunction.Callback * @param {Number} time The time in the range [0, 1]. * @returns {Number} The value of the function at the given time. * diff --git a/Source/Core/EllipsoidTerrainProvider.js b/Source/Core/EllipsoidTerrainProvider.js index 4f35102553d1..d22b4f58f63d 100644 --- a/Source/Core/EllipsoidTerrainProvider.js +++ b/Source/Core/EllipsoidTerrainProvider.js @@ -199,7 +199,7 @@ EllipsoidTerrainProvider.prototype.getTileDataAvailable = function ( * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ EllipsoidTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 8f952750c521..32d0919cc9b4 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -49,7 +49,7 @@ Object.defineProperties(Event.prototype, { * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. - * @returns {Event~RemoveCallback} A function that will remove this event listener when invoked. + * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#raiseEvent * @see Event#removeEventListener @@ -157,6 +157,6 @@ Event.prototype.raiseEvent = function () { /** * A function that removes a listener. - * @callback Event~RemoveCallback + * @callback Event.RemoveCallback */ export default Event; diff --git a/Source/Core/EventHelper.js b/Source/Core/EventHelper.js index ed9e73fe184b..bf928ae5f335 100644 --- a/Source/Core/EventHelper.js +++ b/Source/Core/EventHelper.js @@ -32,7 +32,7 @@ function EventHelper() { * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. - * @returns {EventHelper~RemoveCallback} A function that will remove this event listener when invoked. + * @returns {EventHelper.RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#addEventListener */ @@ -69,6 +69,6 @@ EventHelper.prototype.removeAll = function () { /** * A function that removes a listener. - * @callback EventHelper~RemoveCallback + * @callback EventHelper.RemoveCallback */ export default EventHelper; diff --git a/Source/Core/ExtrapolationType.js b/Source/Core/ExtrapolationType.js index 43d01df39e27..58d1e2db16f1 100644 --- a/Source/Core/ExtrapolationType.js +++ b/Source/Core/ExtrapolationType.js @@ -2,7 +2,7 @@ * Constants to determine how an interpolated value is extrapolated * when querying outside the bounds of available data. * - * @exports ExtrapolationType + * @enum {Number} * * @see SampledProperty */ diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index d5265a72330e..7cc66fa3f561 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -3,7 +3,6 @@ import defaultValue from "./defaultValue.js"; import defined from "./defined.js"; import DeveloperError from "./DeveloperError.js"; import Fullscreen from "./Fullscreen.js"; -/*global CanvasPixelArray*/ var theNavigator; if (typeof navigator !== "undefined") { @@ -276,8 +275,8 @@ if (typeof ArrayBuffer !== "undefined") { typedArrayTypes.push(Uint8ClampedArray); } - if (typeof CanvasPixelArray !== "undefined") { - typedArrayTypes.push(CanvasPixelArray); + if (typeof Uint8ClampedArray !== "undefined") { + typedArrayTypes.push(Uint8ClampedArray); } } @@ -285,7 +284,7 @@ if (typeof ArrayBuffer !== "undefined") { * A set of functions to detect whether the current browser supports * various features. * - * @exports FeatureDetection + * @namespace FeatureDetection */ var FeatureDetection = { isChrome: isChrome, diff --git a/Source/Core/Fullscreen.js b/Source/Core/Fullscreen.js index 85574b3c7d66..15426970af2a 100644 --- a/Source/Core/Fullscreen.js +++ b/Source/Core/Fullscreen.js @@ -13,8 +13,7 @@ var _names = { /** * Browser-independent functions for working with the standard fullscreen API. * - * @exports Fullscreen - * @namespace + * @namespace Fullscreen * * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification} */ @@ -216,7 +215,7 @@ Fullscreen.supportsFullscreen = function () { * If fullscreen mode is not supported by the browser, does nothing. * * @param {Object} element The HTML element which will be placed into fullscreen mode. - * @param {HMDVRDevice} [vrDevice] The VR device. + * @param {Object} [vrDevice] The HMDVRDevice device. * * @example * // Put the entire page into fullscreen. diff --git a/Source/Core/GeocodeType.js b/Source/Core/GeocodeType.js index c38d80365a44..956a2047665f 100644 --- a/Source/Core/GeocodeType.js +++ b/Source/Core/GeocodeType.js @@ -1,6 +1,6 @@ /** * The type of geocoding to be performed by a {@link GeocoderService}. - * @exports GeocodeType + * @enum {Number} * @see Geocoder */ var GeocodeType = { diff --git a/Source/Core/GeocoderService.js b/Source/Core/GeocoderService.js index 4576de2fa3d7..5162da37835a 100644 --- a/Source/Core/GeocoderService.js +++ b/Source/Core/GeocoderService.js @@ -1,7 +1,7 @@ import DeveloperError from "./DeveloperError.js"; /** - * @typedef {Object} GeocoderService~Result + * @typedef {Object} GeocoderService.Result * @property {String} displayName The display name for a location * @property {Rectangle|Cartesian3} destination The bounding box for a location */ @@ -23,7 +23,7 @@ function GeocoderService() {} * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError; export default GeocoderService; diff --git a/Source/Core/GeometryAttribute.js b/Source/Core/GeometryAttribute.js index 96e293303d46..05a244a4498b 100644 --- a/Source/Core/GeometryAttribute.js +++ b/Source/Core/GeometryAttribute.js @@ -14,7 +14,7 @@ import DeveloperError from "./DeveloperError.js"; * @param {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values. * @param {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes. * @param {Boolean} [options.normalize=false] When true and componentDatatype is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering. - * @param {TypedArray} [options.values] The values for the attributes stored in a typed array. + * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array. * * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4. * @@ -120,7 +120,7 @@ function GeometryAttribute(options) { * every three elements in values defines one attributes since * componentsPerAttribute is 3. * - * @type TypedArray + * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} * * @default undefined * diff --git a/Source/Core/GeometryPipeline.js b/Source/Core/GeometryPipeline.js index b711aea73f1d..32a080a9aea9 100644 --- a/Source/Core/GeometryPipeline.js +++ b/Source/Core/GeometryPipeline.js @@ -27,7 +27,7 @@ import Tipsify from "./Tipsify.js"; /** * Content pipeline functions for geometries. * - * @exports GeometryPipeline + * @namespace GeometryPipeline * * @see Geometry */ diff --git a/Source/Core/GoogleEarthEnterpriseMetadata.js b/Source/Core/GoogleEarthEnterpriseMetadata.js index da939555ae1c..2bd39d9d8efa 100644 --- a/Source/Core/GoogleEarthEnterpriseMetadata.js +++ b/Source/Core/GoogleEarthEnterpriseMetadata.js @@ -148,7 +148,7 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, { /** * Gets the proxy used for metadata requests. * @memberof GoogleEarthEnterpriseMetadata.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { diff --git a/Source/Core/GoogleEarthEnterpriseTerrainData.js b/Source/Core/GoogleEarthEnterpriseTerrainData.js index ac8fd12a35d7..f8137464e24f 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainData.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainData.js @@ -107,7 +107,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof GoogleEarthEnterpriseTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js index c952dff0eae5..4402c159f28b 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js @@ -192,7 +192,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseTerrainProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -619,7 +619,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function ( * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js index d51b1a7b5d16..b2e1fcb823c8 100644 --- a/Source/Core/GroundPolylineGeometry.js +++ b/Source/Core/GroundPolylineGeometry.js @@ -1310,7 +1310,7 @@ function generateGeometryAttributes( * - encoded texture coordinate offsets ****************************************/ - /** 3D **/ + /* 3D */ var segmentLength3D = Cartesian3.distance(startTop, endTop); var encodedStart = EncodedCartesian3.fromCartesian( @@ -1348,7 +1348,7 @@ function generateGeometryAttributes( var texcoordNormalization3DX = segmentLength3D / length3D; var texcoordNormalization3DY = lengthSoFar3D / length3D; - /** 2D **/ + /* 2D */ var segmentLength2D = 0.0; var encodedStart2D; var forwardOffset2D; diff --git a/Source/Core/HeadingPitchRoll.js b/Source/Core/HeadingPitchRoll.js index b3b193833eba..cb037c3c41ce 100644 --- a/Source/Core/HeadingPitchRoll.js +++ b/Source/Core/HeadingPitchRoll.js @@ -131,7 +131,7 @@ HeadingPitchRoll.equals = function (left, right) { * * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll. * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ @@ -193,7 +193,7 @@ HeadingPitchRoll.prototype.equals = function (right) { * false otherwise. * * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing. * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ diff --git a/Source/Core/Heap.js b/Source/Core/Heap.js index 02d5fb1106b0..8d7d6ebece75 100644 --- a/Source/Core/Heap.js +++ b/Source/Core/Heap.js @@ -10,7 +10,7 @@ import defined from "./defined.js"; * @private * * @param {Object} options Object with the following properties: - * @param {Heap~ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index. + * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index. */ function Heap(options) { //>>includeStart('debug', pragmas.debug); @@ -78,7 +78,7 @@ Object.defineProperties(Heap.prototype, { * * @memberof Heap.prototype * - * @type {Heap~ComparatorCallback} + * @type {Heap.ComparatorCallback} */ comparator: { get: function () { @@ -216,7 +216,7 @@ Heap.prototype.pop = function (index) { /** * The comparator to use for the heap. - * @callback Heap~ComparatorCallback + * @callback Heap.ComparatorCallback * @param {*} a An element in the heap. * @param {*} b An element in the heap. * @returns {Number} If the result of the comparison is less than 0, sort a to a lower index than b, otherwise sort to a higher index. diff --git a/Source/Core/HeightmapEncoding.js b/Source/Core/HeightmapEncoding.js index d09a62705b93..56f56a1b6305 100644 --- a/Source/Core/HeightmapEncoding.js +++ b/Source/Core/HeightmapEncoding.js @@ -1,7 +1,7 @@ /** * The encoding that is used for a heightmap * - * @exports HeightmapEncoding + * @enum {Number} */ var HeightmapEncoding = { /** diff --git a/Source/Core/HeightmapTerrainData.js b/Source/Core/HeightmapTerrainData.js index ee6031b2b8fe..949ce5c1b6d7 100644 --- a/Source/Core/HeightmapTerrainData.js +++ b/Source/Core/HeightmapTerrainData.js @@ -23,7 +23,7 @@ import TerrainProvider from "./TerrainProvider.js"; * @constructor * * @param {Object} options Object with the following properties: - * @param {TypedArray} options.buffer The buffer containing height data. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.buffer The buffer containing height data. * @param {Number} options.width The width (longitude direction) of the heightmap, in samples. * @param {Number} options.height The height (latitude direction) of the heightmap, in samples. * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist. @@ -167,7 +167,7 @@ Object.defineProperties(HeightmapTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof HeightmapTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js index 00e2c6f50b22..729443340b34 100644 --- a/Source/Core/HeightmapTessellator.js +++ b/Source/Core/HeightmapTessellator.js @@ -18,7 +18,7 @@ import WebMercatorProjection from "./WebMercatorProjection.js"; /** * Contains functions to create a mesh from a heightmap image. * - * @exports HeightmapTessellator + * @namespace HeightmapTessellator * * @private */ @@ -47,7 +47,7 @@ var maximumScratch = new Cartesian3(); * Fills an array of vertices from a heightmap image. * * @param {Object} options Object with the following properties: - * @param {TypedArray} options.heightmap The heightmap to tessellate. + * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate. * @param {Number} options.width The width of the heightmap, in height samples. * @param {Number} options.height The height of the heightmap, in height samples. * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap. diff --git a/Source/Core/HermitePolynomialApproximation.js b/Source/Core/HermitePolynomialApproximation.js index 032327e8d096..33c8f4baf38c 100644 --- a/Source/Core/HermitePolynomialApproximation.js +++ b/Source/Core/HermitePolynomialApproximation.js @@ -64,7 +64,7 @@ function calculateCoefficientTerm( /** * An {@link InterpolationAlgorithm} for performing Hermite interpolation. * - * @exports HermitePolynomialApproximation + * @namespace HermitePolynomialApproximation */ var HermitePolynomialApproximation = { type: "Hermite", diff --git a/Source/Core/Iau2000Orientation.js b/Source/Core/Iau2000Orientation.js index b43690f8e723..07f7bc8aa18a 100644 --- a/Source/Core/Iau2000Orientation.js +++ b/Source/Core/Iau2000Orientation.js @@ -9,7 +9,7 @@ import TimeConstants from "./TimeConstants.js"; * The data comes from the Report of the IAU/IAG Working Group on Cartographic * Coordinates and Rotational Elements: 2000. * - * @exports Iau2000Orientation + * @namespace Iau2000Orientation * * @private */ @@ -39,6 +39,7 @@ var dateTT = new JulianDate(); * @param {JulianDate} [date=JulianDate.now()] The date to evaluate the parameters. * @param {IauOrientationParameters} [result] The object onto which to store the result. * @returns {IauOrientationParameters} The modified result parameter or a new instance representing the orientation of the Earth's Moon. + * @private */ Iau2000Orientation.ComputeMoon = function (date, result) { if (!defined(date)) { diff --git a/Source/Core/Iau2006XysData.js b/Source/Core/Iau2006XysData.js index a7810c6e424b..325f7a164195 100644 --- a/Source/Core/Iau2006XysData.js +++ b/Source/Core/Iau2006XysData.js @@ -94,7 +94,7 @@ function getDaysSinceEpoch(xys, dayTT, secondTT) { * the Terrestrial Time (TT) time standard. * @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in * the Terrestrial Time (TT) time standard. - * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been + * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been * preloaded. */ Iau2006XysData.prototype.preload = function ( diff --git a/Source/Core/IauOrientationAxes.js b/Source/Core/IauOrientationAxes.js index 88a710d25384..1d24fbd4eb33 100644 --- a/Source/Core/IauOrientationAxes.js +++ b/Source/Core/IauOrientationAxes.js @@ -12,7 +12,7 @@ import Quaternion from "./Quaternion.js"; * @alias IauOrientationAxes * @constructor * - * @param {IauOrientationAxes~ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. + * @param {IauOrientationAxes.ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. * * @see Iau2000Orientation * @@ -97,8 +97,9 @@ IauOrientationAxes.prototype.evaluate = function (date, result) { /** * A function that computes the {@link IauOrientationParameters} for a {@link JulianDate}. - * @callback IauOrientationAxes~ComputeFunction + * @callback IauOrientationAxes.ComputeFunction * @param {JulianDate} date The date to evaluate the parameters. * @returns {IauOrientationParameters} The orientation parameters. + * @private */ export default IauOrientationAxes; diff --git a/Source/Core/IauOrientationParameters.js b/Source/Core/IauOrientationParameters.js index 5fd99747659f..361aa7725fd8 100644 --- a/Source/Core/IauOrientationParameters.js +++ b/Source/Core/IauOrientationParameters.js @@ -6,7 +6,7 @@ * except that they are expressed in radians. *

* - * @exports IauOrientationParameters + * @namespace IauOrientationParameters * * @private */ diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js index 114e580f9771..3fa2c587262a 100644 --- a/Source/Core/IndexDatatype.js +++ b/Source/Core/IndexDatatype.js @@ -7,7 +7,7 @@ import WebGLConstants from "./WebGLConstants.js"; * Constants for WebGL index datatypes. These corresponds to the * type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. * - * @exports IndexDatatype + * @enum {Number} */ var IndexDatatype = { /** diff --git a/Source/Core/InterpolationAlgorithm.js b/Source/Core/InterpolationAlgorithm.js index 10e5a954e665..f512c94c73a4 100644 --- a/Source/Core/InterpolationAlgorithm.js +++ b/Source/Core/InterpolationAlgorithm.js @@ -3,7 +3,7 @@ import DeveloperError from "./DeveloperError.js"; /** * The interface for interpolation algorithms. * - * @exports InterpolationAlgorithm + * @interface InterpolationAlgorithm * * @see LagrangePolynomialApproximation * @see LinearApproximation diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js index 28722d5f1765..96effac7107f 100644 --- a/Source/Core/Intersect.js +++ b/Source/Core/Intersect.js @@ -4,7 +4,7 @@ * partially inside the frustum and partially outside (INTERSECTING), or somwhere entirely * outside of the frustum's 6 planes (OUTSIDE). * - * @exports Intersect + * @enum {Number} */ var Intersect = { /** diff --git a/Source/Core/IntersectionTests.js b/Source/Core/IntersectionTests.js index f5ce668b4af5..dba56cf8a3e7 100644 --- a/Source/Core/IntersectionTests.js +++ b/Source/Core/IntersectionTests.js @@ -13,8 +13,7 @@ import Ray from "./Ray.js"; /** * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. * - * @exports IntersectionTests - * @namespace + * @namespace IntersectionTests */ var IntersectionTests = {}; diff --git a/Source/Core/Intersections2D.js b/Source/Core/Intersections2D.js index 0153ba04fa6e..08c62fc4641c 100644 --- a/Source/Core/Intersections2D.js +++ b/Source/Core/Intersections2D.js @@ -7,7 +7,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Contains functions for operating on 2D triangles. * - * @exports Intersections2D + * @namespace Intersections2D */ var Intersections2D = {}; diff --git a/Source/Core/Ion.js b/Source/Core/Ion.js index 3745f1fe0f10..c85f325cc7d8 100644 --- a/Source/Core/Ion.js +++ b/Source/Core/Ion.js @@ -7,7 +7,6 @@ var defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNWMwZmFjMy04ZmRmLTRhMjktYjUzYi00YWQ4N2ZiNmIwNjUiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTg4MzQxMTA4fQ.scXa4kn5vzNVSgsEYKNYP0szYXPq1Djx1SH0KcAOrrk"; /** * Default settings for accessing the Cesium ion API. - * @exports Ion * * An ion access token is only required if you are using any ion related APIs. * A default access token is provided for evaluation purposes only. @@ -18,6 +17,7 @@ var defaultAccessToken = * @see IonGeocoderService * @see createWorldImagery * @see createWorldTerrain + * @namespace Ion */ var Ion = {}; diff --git a/Source/Core/IonGeocoderService.js b/Source/Core/IonGeocoderService.js index 8ae06d2c92ea..daf44dc432e0 100644 --- a/Source/Core/IonGeocoderService.js +++ b/Source/Core/IonGeocoderService.js @@ -14,7 +14,6 @@ import Resource from "./Resource.js"; * @param {Object} options Object with the following properties: * @param {Scene} options.scene The scene * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use. - * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use. * @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server. * * @see Ion @@ -57,7 +56,7 @@ function IonGeocoderService(options) { * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ IonGeocoderService.prototype.geocode = function (query, geocodeType) { return this._pelias.geocode(query, geocodeType); diff --git a/Source/Core/Iso8601.js b/Source/Core/Iso8601.js index 74757520f428..97738cf93470 100644 --- a/Source/Core/Iso8601.js +++ b/Source/Core/Iso8601.js @@ -17,7 +17,7 @@ var MAXIMUM_INTERVAL = Object.freeze( /** * Constants related to ISO8601 support. * - * @exports Iso8601 + * @namespace * * @see {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601 on Wikipedia} * @see JulianDate diff --git a/Source/Core/JulianDate.js b/Source/Core/JulianDate.js index e3b77af8ab09..42388d916217 100644 --- a/Source/Core/JulianDate.js +++ b/Source/Core/JulianDate.js @@ -901,15 +901,11 @@ JulianDate.equals = function (left, right) { * * @param {JulianDate} [left] The first instance. * @param {JulianDate} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ JulianDate.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - if (!defined(epsilon)) { - throw new DeveloperError("epsilon is required."); - } - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1182,7 +1178,7 @@ JulianDate.prototype.equals = function (right) { * seconds, must be less than epsilon. * * @param {JulianDate} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ JulianDate.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/KeyboardEventModifier.js b/Source/Core/KeyboardEventModifier.js index 8d347200957f..0ff50f243cfe 100644 --- a/Source/Core/KeyboardEventModifier.js +++ b/Source/Core/KeyboardEventModifier.js @@ -2,7 +2,7 @@ * This enumerated type is for representing keyboard modifiers. These are keys * that are held down in addition to other event types. * - * @exports KeyboardEventModifier + * @enum {Number} */ var KeyboardEventModifier = { /** diff --git a/Source/Core/LagrangePolynomialApproximation.js b/Source/Core/LagrangePolynomialApproximation.js index 4bc59175b5b9..f43816a698c5 100644 --- a/Source/Core/LagrangePolynomialApproximation.js +++ b/Source/Core/LagrangePolynomialApproximation.js @@ -3,7 +3,7 @@ import defined from "./defined.js"; /** * An {@link InterpolationAlgorithm} for performing Lagrange interpolation. * - * @exports LagrangePolynomialApproximation + * @namespace LagrangePolynomialApproximation */ var LagrangePolynomialApproximation = { type: "Lagrange", diff --git a/Source/Core/LinearApproximation.js b/Source/Core/LinearApproximation.js index ffca6c48fec5..5665e9f34168 100644 --- a/Source/Core/LinearApproximation.js +++ b/Source/Core/LinearApproximation.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * An {@link InterpolationAlgorithm} for performing linear interpolation. * - * @exports LinearApproximation + * @namespace LinearApproximation */ var LinearApproximation = { type: "Linear", diff --git a/Source/Core/MapboxApi.js b/Source/Core/MapboxApi.js index 1460fc3d8601..e808890e7d33 100644 --- a/Source/Core/MapboxApi.js +++ b/Source/Core/MapboxApi.js @@ -2,7 +2,7 @@ import Credit from "./Credit.js"; import defined from "./defined.js"; /** - * @exports MapboxApi + * @namespace MapboxApi */ var MapboxApi = {}; diff --git a/Source/Core/Math.js b/Source/Core/Math.js index ea3e31635ece..83fa3d985703 100644 --- a/Source/Core/Math.js +++ b/Source/Core/Math.js @@ -7,7 +7,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Math functions. * - * @exports CesiumMath + * @namespace CesiumMath * @alias Math */ var CesiumMath = {}; @@ -580,7 +580,7 @@ CesiumMath.mod = function (m, n) { * * @param {Number} left The first value to compare. * @param {Number} right The other value to compare. - * @param {Number} relativeEpsilon The maximum inclusive delta between left and right for the relative tolerance test. + * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between left and right for the relative tolerance test. * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between left and right for the absolute tolerance test. * @returns {Boolean} true if the values are equal within the epsilon; otherwise, false. * @@ -603,10 +603,9 @@ CesiumMath.equalsEpsilon = function ( if (!defined(right)) { throw new DeveloperError("right is required."); } - if (!defined(relativeEpsilon)) { - throw new DeveloperError("relativeEpsilon is required."); - } //>>includeEnd('debug'); + + relativeEpsilon = defaultValue(relativeEpsilon, 0.0); absoluteEpsilon = defaultValue(absoluteEpsilon, relativeEpsilon); var absDiff = Math.abs(left - right); return ( diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js index a51bac194da8..1e617774f9e6 100644 --- a/Source/Core/Matrix2.js +++ b/Source/Core/Matrix2.js @@ -725,14 +725,11 @@ Matrix2.equalsArray = function (matrix, array, offset) { * * @param {Matrix2} [left] The first matrix. * @param {Matrix2} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Matrix2.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); - + epsilon = defaultValue(epsilon, 0); return ( left === right || (defined(left) && @@ -849,7 +846,7 @@ Matrix2.prototype.equals = function (right) { * false otherwise. * * @param {Matrix2} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix2.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index bee35156cacb..e6b21a51dd61 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -1394,13 +1394,11 @@ Matrix3.equals = function (left, right) { * * @param {Matrix3} [left] The first matrix. * @param {Matrix3} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Matrix3.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1568,7 +1566,7 @@ Matrix3.equalsArray = function (matrix, array, offset) { * false otherwise. * * @param {Matrix3} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix3.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js index 6802b45f874f..16b264197116 100644 --- a/Source/Core/Matrix4.js +++ b/Source/Core/Matrix4.js @@ -943,10 +943,10 @@ Matrix4.computeInfinitePerspectiveOffCenter = function ( /** * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates. * - * @param {Object}[viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1. - * @param {Number}[nearDepthRange=0.0] The near plane distance in window coordinates. - * @param {Number}[farDepthRange=1.0] The far plane distance in window coordinates. - * @param {Matrix4} result The object in which the result will be stored. + * @param {Object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1. + * @param {Number} [nearDepthRange=0.0] The near plane distance in window coordinates. + * @param {Number} [farDepthRange=1.0] The far plane distance in window coordinates. + * @param {Matrix4} [result] The object in which the result will be stored. * @returns {Matrix4} The modified result parameter. * * @example @@ -964,9 +964,9 @@ Matrix4.computeViewportTransformation = function ( farDepthRange, result ) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.object("result", result); - //>>includeEnd('debug'); + if (!defined(result)) { + result = new Matrix4(); + } viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -2257,7 +2257,7 @@ Matrix4.equals = function (left, right) { * * @param {Matrix4} [left] The first matrix. * @param {Matrix4} [right] The second matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. * * @example @@ -2282,9 +2282,7 @@ Matrix4.equals = function (left, right) { * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -2895,7 +2893,7 @@ Matrix4.equalsArray = function (matrix, array, offset) { * false otherwise. * * @param {Matrix4} [right] The right hand side matrix. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ Matrix4.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/OpenCageGeocoderService.js b/Source/Core/OpenCageGeocoderService.js index aab2515a09be..1a743c4dc259 100644 --- a/Source/Core/OpenCageGeocoderService.js +++ b/Source/Core/OpenCageGeocoderService.js @@ -54,7 +54,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { /** * The Resource used to access the OpenCage endpoint. * @type {Resource} - * @memberof {OpenCageGeocoderService.prototype} + * @memberof OpenCageGeocoderService.prototype * @readonly */ url: { @@ -65,7 +65,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { /** * Optional params passed to OpenCage in order to customize geocoding * @type {Object} - * @memberof {OpenCageGeocoderService.prototype} + * @memberof OpenCageGeocoderService.prototype * @readonly */ params: { @@ -79,7 +79,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, { * @function * * @param {String} query The query to be sent to the geocoder service - * @returns {Promise} + * @returns {Promise} */ OpenCageGeocoderService.prototype.geocode = function (query) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/Packable.js b/Source/Core/Packable.js index cda6966f5235..479c91ae64a7 100644 --- a/Source/Core/Packable.js +++ b/Source/Core/Packable.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * elements in an array. These methods and properties are expected to be * defined on a constructor function. * - * @exports Packable + * @interface Packable * * @see PackableForInterpolation */ diff --git a/Source/Core/PackableForInterpolation.js b/Source/Core/PackableForInterpolation.js index 6f3cc9099e2c..c3a0f603162f 100644 --- a/Source/Core/PackableForInterpolation.js +++ b/Source/Core/PackableForInterpolation.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * different representation than their packed value. These methods and * properties are expected to be defined on a constructor function. * - * @exports PackableForInterpolation + * @namespace PackableForInterpolation * * @see Packable */ @@ -23,7 +23,7 @@ var PackableForInterpolation = { * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ convertPackedArrayForInterpolation: DeveloperError.throwInstantiationError, diff --git a/Source/Core/PeliasGeocoderService.js b/Source/Core/PeliasGeocoderService.js index daf2f211bc12..7377186bae27 100644 --- a/Source/Core/PeliasGeocoderService.js +++ b/Source/Core/PeliasGeocoderService.js @@ -51,7 +51,7 @@ Object.defineProperties(PeliasGeocoderService.prototype, { * * @param {String} query The query to be sent to the geocoder service * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform. - * @returns {Promise} + * @returns {Promise} */ PeliasGeocoderService.prototype.geocode = function (query, type) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/PinBuilder.js b/Source/Core/PinBuilder.js index 3248d0d1bdfc..e0ea7dc05a9d 100644 --- a/Source/Core/PinBuilder.js +++ b/Source/Core/PinBuilder.js @@ -27,7 +27,7 @@ function PinBuilder() { * * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas} The canvas element that represents the generated pin. + * @returns {HTMLCanvasElement} The canvas element that represents the generated pin. */ PinBuilder.prototype.fromColor = function (color, size) { //>>includeStart('debug', pragmas.debug); @@ -47,7 +47,7 @@ PinBuilder.prototype.fromColor = function (color, size) { * @param {Resource|String} url The url of the image to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. + * @returns {HTMLCanvasElement|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. */ PinBuilder.prototype.fromUrl = function (url, color, size) { //>>includeStart('debug', pragmas.debug); @@ -70,7 +70,7 @@ PinBuilder.prototype.fromUrl = function (url, color, size) { * @param {String} id The id of the maki icon to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. + * @returns {HTMLCanvasElement|Promise.} The canvas element or a Promise to the canvas element that represents the generated pin. */ PinBuilder.prototype.fromMakiIconId = function (id, color, size) { //>>includeStart('debug', pragmas.debug); @@ -100,7 +100,7 @@ PinBuilder.prototype.fromMakiIconId = function (id, color, size) { * @param {String} text The text to be stamped onto the pin. * @param {Color} color The color of the pin. * @param {Number} size The size of the pin, in pixels. - * @returns {Canvas} The canvas element that represents the generated pin. + * @returns {HTMLCanvasElement} The canvas element that represents the generated pin. */ PinBuilder.prototype.fromText = function (text, color, size) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Core/PixelFormat.js b/Source/Core/PixelFormat.js index 0b3115fbff21..241dbd2569da 100644 --- a/Source/Core/PixelFormat.js +++ b/Source/Core/PixelFormat.js @@ -4,7 +4,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * The format of a pixel, i.e., the number of components it has and what they represent. * - * @exports PixelFormat + * @enum {Number} */ var PixelFormat = { /** @@ -134,223 +134,239 @@ var PixelFormat = { * @constant */ RGB_ETC1: WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL, +}; - /** - * @private - */ - componentsLength: function (pixelFormat) { - switch (pixelFormat) { - case PixelFormat.RGB: - return 3; - case PixelFormat.RGBA: - return 4; - case PixelFormat.LUMINANCE_ALPHA: - return 2; - case PixelFormat.ALPHA: - case PixelFormat.LUMINANCE: - return 1; - default: - return 1; - } - }, - - /** - * @private - */ - validate: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.DEPTH_COMPONENT || - pixelFormat === PixelFormat.DEPTH_STENCIL || - pixelFormat === PixelFormat.ALPHA || - pixelFormat === PixelFormat.RGB || - pixelFormat === PixelFormat.RGBA || - pixelFormat === PixelFormat.LUMINANCE || - pixelFormat === PixelFormat.LUMINANCE_ALPHA || - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 || - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGB_ETC1 - ); - }, +/** + * @private + */ +PixelFormat.componentsLength = function (pixelFormat) { + switch (pixelFormat) { + case PixelFormat.RGB: + return 3; + case PixelFormat.RGBA: + return 4; + case PixelFormat.LUMINANCE_ALPHA: + return 2; + case PixelFormat.ALPHA: + case PixelFormat.LUMINANCE: + return 1; + default: + return 1; + } +}; - /** - * @private - */ - isColorFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.ALPHA || - pixelFormat === PixelFormat.RGB || - pixelFormat === PixelFormat.RGBA || - pixelFormat === PixelFormat.LUMINANCE || - pixelFormat === PixelFormat.LUMINANCE_ALPHA - ); - }, +/** + * @private + */ +PixelFormat.validate = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL || + pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA || + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 || + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGB_ETC1 + ); +}; - /** - * @private - */ - isDepthFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.DEPTH_COMPONENT || - pixelFormat === PixelFormat.DEPTH_STENCIL - ); - }, +/** + * @private + */ +PixelFormat.isColorFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA + ); +}; - /** - * @private - */ - isCompressedFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 || - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGB_ETC1 - ); - }, +/** + * @private + */ +PixelFormat.isDepthFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL + ); +}; - /** - * @private - */ - isDXTFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT1 || - pixelFormat === PixelFormat.RGBA_DXT3 || - pixelFormat === PixelFormat.RGBA_DXT5 - ); - }, +/** + * @private + */ +PixelFormat.isCompressedFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 || + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGB_ETC1 + ); +}; - /** - * @private - */ - isPVRTCFormat: function (pixelFormat) { - return ( - pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || - pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 - ); - }, +/** + * @private + */ +PixelFormat.isDXTFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT1 || + pixelFormat === PixelFormat.RGBA_DXT3 || + pixelFormat === PixelFormat.RGBA_DXT5 + ); +}; - /** - * @private - */ - isETC1Format: function (pixelFormat) { - return pixelFormat === PixelFormat.RGB_ETC1; - }, +/** + * @private + */ +PixelFormat.isPVRTCFormat = function (pixelFormat) { + return ( + pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || + pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 + ); +}; - /** - * @private - */ - compressedTextureSizeInBytes: function (pixelFormat, width, height) { - switch (pixelFormat) { - case PixelFormat.RGB_DXT1: - case PixelFormat.RGBA_DXT1: - case PixelFormat.RGB_ETC1: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; - - case PixelFormat.RGBA_DXT3: - case PixelFormat.RGBA_DXT5: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; - - case PixelFormat.RGB_PVRTC_4BPPV1: - case PixelFormat.RGBA_PVRTC_4BPPV1: - return Math.floor( - (Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8 - ); - - case PixelFormat.RGB_PVRTC_2BPPV1: - case PixelFormat.RGBA_PVRTC_2BPPV1: - return Math.floor( - (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8 - ); - - default: - return 0; - } - }, +/** + * @private + */ +PixelFormat.isETC1Format = function (pixelFormat) { + return pixelFormat === PixelFormat.RGB_ETC1; +}; - /** - * @private - */ - textureSizeInBytes: function (pixelFormat, pixelDatatype, width, height) { - var componentsLength = PixelFormat.componentsLength(pixelFormat); - if (PixelDatatype.isPacked(pixelDatatype)) { - componentsLength = 1; - } - return ( - componentsLength * - PixelDatatype.sizeInBytes(pixelDatatype) * - width * - height - ); - }, +/** + * @private + */ +PixelFormat.compressedTextureSizeInBytes = function ( + pixelFormat, + width, + height +) { + switch (pixelFormat) { + case PixelFormat.RGB_DXT1: + case PixelFormat.RGBA_DXT1: + case PixelFormat.RGB_ETC1: + return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; + + case PixelFormat.RGBA_DXT3: + case PixelFormat.RGBA_DXT5: + return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; + + case PixelFormat.RGB_PVRTC_4BPPV1: + case PixelFormat.RGBA_PVRTC_4BPPV1: + return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8); + + case PixelFormat.RGB_PVRTC_2BPPV1: + case PixelFormat.RGBA_PVRTC_2BPPV1: + return Math.floor( + (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8 + ); + + default: + return 0; + } +}; - /** - * @private - */ - alignmentInBytes: function (pixelFormat, pixelDatatype, width) { - var mod = - PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4; - return mod === 0 ? 4 : mod === 2 ? 2 : 1; - }, +/** + * @private + */ +PixelFormat.textureSizeInBytes = function ( + pixelFormat, + pixelDatatype, + width, + height +) { + var componentsLength = PixelFormat.componentsLength(pixelFormat); + if (PixelDatatype.isPacked(pixelDatatype)) { + componentsLength = 1; + } + return ( + componentsLength * PixelDatatype.sizeInBytes(pixelDatatype) * width * height + ); +}; - /** - * @private - */ - createTypedArray: function (pixelFormat, pixelDatatype, width, height) { - var constructor; - var sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype); - if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) { - constructor = Uint8Array; - } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) { - constructor = Uint16Array; - } else if ( - sizeInBytes === Float32Array.BYTES_PER_ELEMENT && - pixelDatatype === PixelDatatype.FLOAT - ) { - constructor = Float32Array; - } else { - constructor = Uint32Array; - } +/** + * @private + */ +PixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) { + var mod = + PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4; + return mod === 0 ? 4 : mod === 2 ? 2 : 1; +}; - var size = PixelFormat.componentsLength(pixelFormat) * width * height; - return new constructor(size); - }, +/** + * @private + */ +PixelFormat.createTypedArray = function ( + pixelFormat, + pixelDatatype, + width, + height +) { + var constructor; + var sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype); + if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) { + constructor = Uint8Array; + } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) { + constructor = Uint16Array; + } else if ( + sizeInBytes === Float32Array.BYTES_PER_ELEMENT && + pixelDatatype === PixelDatatype.FLOAT + ) { + constructor = Float32Array; + } else { + constructor = Uint32Array; + } + + var size = PixelFormat.componentsLength(pixelFormat) * width * height; + return new constructor(size); +}; - /** - * @private - */ - flipY: function (bufferView, pixelFormat, pixelDatatype, width, height) { - if (height === 1) { - return bufferView; - } - var flipped = PixelFormat.createTypedArray( - pixelFormat, - pixelDatatype, - width, - height - ); - var numberOfComponents = PixelFormat.componentsLength(pixelFormat); - var textureWidth = width * numberOfComponents; - for (var i = 0; i < height; ++i) { - var row = i * height * numberOfComponents; - var flippedRow = (height - i - 1) * height * numberOfComponents; - for (var j = 0; j < textureWidth; ++j) { - flipped[flippedRow + j] = bufferView[row + j]; - } +/** + * @private + */ +PixelFormat.flipY = function ( + bufferView, + pixelFormat, + pixelDatatype, + width, + height +) { + if (height === 1) { + return bufferView; + } + var flipped = PixelFormat.createTypedArray( + pixelFormat, + pixelDatatype, + width, + height + ); + var numberOfComponents = PixelFormat.componentsLength(pixelFormat); + var textureWidth = width * numberOfComponents; + for (var i = 0; i < height; ++i) { + var row = i * height * numberOfComponents; + var flippedRow = (height - i - 1) * height * numberOfComponents; + for (var j = 0; j < textureWidth; ++j) { + flipped[flippedRow + j] = bufferView[row + j]; } - return flipped; - }, + } + return flipped; }; + export default Object.freeze(PixelFormat); diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js index ae090d547ef5..87ee47b4f52d 100644 --- a/Source/Core/PrimitiveType.js +++ b/Source/Core/PrimitiveType.js @@ -3,7 +3,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * The type of a geometric primitive, i.e., points, lines, and triangles. * - * @exports PrimitiveType + * @enum {Number} */ var PrimitiveType = { /** @@ -65,20 +65,21 @@ var PrimitiveType = { * @constant */ TRIANGLE_FAN: WebGLConstants.TRIANGLE_FAN, +}; - /** - * @private - */ - validate: function (primitiveType) { - return ( - primitiveType === PrimitiveType.POINTS || - primitiveType === PrimitiveType.LINES || - primitiveType === PrimitiveType.LINE_LOOP || - primitiveType === PrimitiveType.LINE_STRIP || - primitiveType === PrimitiveType.TRIANGLES || - primitiveType === PrimitiveType.TRIANGLE_STRIP || - primitiveType === PrimitiveType.TRIANGLE_FAN - ); - }, +/** + * @private + */ +PrimitiveType.validate = function (primitiveType) { + return ( + primitiveType === PrimitiveType.POINTS || + primitiveType === PrimitiveType.LINES || + primitiveType === PrimitiveType.LINE_LOOP || + primitiveType === PrimitiveType.LINE_STRIP || + primitiveType === PrimitiveType.TRIANGLES || + primitiveType === PrimitiveType.TRIANGLE_STRIP || + primitiveType === PrimitiveType.TRIANGLE_FAN + ); }; + export default Object.freeze(PrimitiveType); diff --git a/Source/Core/QuadraticRealPolynomial.js b/Source/Core/QuadraticRealPolynomial.js index 57daad889e36..1922d2cec077 100644 --- a/Source/Core/QuadraticRealPolynomial.js +++ b/Source/Core/QuadraticRealPolynomial.js @@ -4,7 +4,7 @@ import CesiumMath from "./Math.js"; /** * Defines functions for 2nd order polynomial functions of one variable with only real coefficients. * - * @exports QuadraticRealPolynomial + * @namespace QuadraticRealPolynomial */ var QuadraticRealPolynomial = {}; diff --git a/Source/Core/QuantizedMeshTerrainData.js b/Source/Core/QuantizedMeshTerrainData.js index 0e3949cf5a2b..8bd031b9174b 100644 --- a/Source/Core/QuantizedMeshTerrainData.js +++ b/Source/Core/QuantizedMeshTerrainData.js @@ -222,7 +222,7 @@ Object.defineProperties(QuantizedMeshTerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof QuantizedMeshTerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: function () { diff --git a/Source/Core/QuarticRealPolynomial.js b/Source/Core/QuarticRealPolynomial.js index 61eda3a90c00..ae91fac52a25 100644 --- a/Source/Core/QuarticRealPolynomial.js +++ b/Source/Core/QuarticRealPolynomial.js @@ -6,7 +6,7 @@ import QuadraticRealPolynomial from "./QuadraticRealPolynomial.js"; /** * Defines functions for 4th order polynomial functions of one variable with only real coefficients. * - * @exports QuarticRealPolynomial + * @namespace QuarticRealPolynomial */ var QuarticRealPolynomial = {}; diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js index eb2c7bcb9e1b..b35bab7812eb 100644 --- a/Source/Core/Quaternion.js +++ b/Source/Core/Quaternion.js @@ -286,7 +286,7 @@ Quaternion.packedInterpolationLength = 3; * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ Quaternion.convertPackedArrayForInterpolation = function ( packedArray, @@ -330,6 +330,9 @@ Quaternion.convertPackedArrayForInterpolation = function ( sampledQuaternionAxis ); var angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion); + if (!defined(result)) { + result = []; + } result[offset] = sampledQuaternionAxis.x * angle; result[offset + 1] = sampledQuaternionAxis.y * angle; result[offset + 2] = sampledQuaternionAxis.z * angle; @@ -1056,13 +1059,11 @@ Quaternion.equals = function (left, right) { * * @param {Quaternion} [left] The first quaternion. * @param {Quaternion} [right] The second quaternion. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Quaternion.equalsEpsilon = function (left, right, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -1118,7 +1119,7 @@ Quaternion.prototype.equals = function (right) { * false otherwise. * * @param {Quaternion} [right] The right hand side quaternion. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Quaternion.prototype.equalsEpsilon = function (right, epsilon) { diff --git a/Source/Core/Queue.js b/Source/Core/Queue.js index 49488468e146..b3186f6af222 100644 --- a/Source/Core/Queue.js +++ b/Source/Core/Queue.js @@ -96,7 +96,7 @@ Queue.prototype.clear = function () { /** * Sort the items in the queue in-place. * - * @param {Queue~Comparator} compareFunction A function that defines the sort order. + * @param {Queue.Comparator} compareFunction A function that defines the sort order. */ Queue.prototype.sort = function (compareFunction) { if (this._offset > 0) { @@ -110,7 +110,7 @@ Queue.prototype.sort = function (compareFunction) { /** * A function used to compare two items while sorting a queue. - * @callback Queue~Comparator + * @callback Queue.Comparator * * @param {*} a An item in the array. * @param {*} b An item in the array. diff --git a/Source/Core/Rectangle.js b/Source/Core/Rectangle.js index 9da1d61235ad..8e10cfaadaaf 100644 --- a/Source/Core/Rectangle.js +++ b/Source/Core/Rectangle.js @@ -370,13 +370,11 @@ Rectangle.clone = function (rectangle, result) { * * @param {Rectangle} [left] The first Rectangle. * @param {Rectangle} [right] The second Rectangle. - * @param {Number} absoluteEpsilon The absolute epsilon tolerance to use for equality testing. + * @param {Number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing. * @returns {Boolean} true if left and right are within the provided epsilon, false otherwise. */ Rectangle.equalsEpsilon = function (left, right, absoluteEpsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("absoluteEpsilon", absoluteEpsilon); - //>>includeEnd('debug'); + absoluteEpsilon = defaultValue(absoluteEpsilon, 0); return ( left === right || @@ -436,14 +434,10 @@ Rectangle.equals = function (left, right) { * false otherwise. * * @param {Rectangle} [other] The Rectangle to compare. - * @param {Number} epsilon The epsilon to use for equality testing. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. * @returns {Boolean} true if the Rectangles are within the provided epsilon, false otherwise. */ Rectangle.prototype.equalsEpsilon = function (other, epsilon) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); - return Rectangle.equalsEpsilon(this, other, epsilon); }; diff --git a/Source/Core/ReferenceFrame.js b/Source/Core/ReferenceFrame.js index a4fd843c52f6..e043a530789f 100644 --- a/Source/Core/ReferenceFrame.js +++ b/Source/Core/ReferenceFrame.js @@ -1,7 +1,7 @@ /** * Constants for identifying well-known reference frames. * - * @exports ReferenceFrame + * @enum {Number} */ var ReferenceFrame = { /** diff --git a/Source/Core/Request.js b/Source/Core/Request.js index 79c0a9563032..d9f219561ea3 100644 --- a/Source/Core/Request.js +++ b/Source/Core/Request.js @@ -8,13 +8,12 @@ import RequestType from "./RequestType.js"; * * @alias Request * @constructor - * @namespace - * @exports Request + * @param {Object} [options] An object with the following properties: * @param {String} [options.url] The url to request. - * @param {Request~RequestCallback} [options.requestFunction] The function that makes the actual data request. - * @param {Request~CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled. - * @param {Request~PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame. + * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request. + * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled. + * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame. * @param {Number} [options.priority=0.0] The initial priority of the request. * @param {Boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority. * @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server. @@ -36,21 +35,21 @@ function Request(options) { /** * The function that makes the actual data request. * - * @type {Request~RequestCallback} + * @type {Request.RequestCallback} */ this.requestFunction = options.requestFunction; /** * The function that is called when the request is cancelled. * - * @type {Request~CancelCallback} + * @type {Request.CancelCallback} */ this.cancelFunction = options.cancelFunction; /** * The function that is called to update the request's priority, which occurs once per frame. * - * @type {Request~PriorityCallback} + * @type {Request.PriorityCallback} */ this.priorityFunction = options.priorityFunction; @@ -176,18 +175,18 @@ Request.prototype.clone = function (result) { /** * The function that makes the actual data request. - * @callback Request~RequestCallback - * @returns {Promise} A promise for the requested data. + * @callback Request.RequestCallback + * @returns {Promise} A promise for the requested data. */ /** * The function that is called when the request is cancelled. - * @callback Request~CancelCallback + * @callback Request.CancelCallback */ /** * The function that is called to update the request's priority, which occurs once per frame. - * @callback Request~PriorityCallback + * @callback Request.PriorityCallback * @returns {Number} The updated priority value. */ export default Request; diff --git a/Source/Core/RequestScheduler.js b/Source/Core/RequestScheduler.js index 12ff73f767b3..3b48bde3020d 100644 --- a/Source/Core/RequestScheduler.js +++ b/Source/Core/RequestScheduler.js @@ -44,7 +44,7 @@ var requestCompletedEvent = new Event(); * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. * - * @exports RequestScheduler + * @namespace RequestScheduler * */ function RequestScheduler() {} @@ -66,6 +66,7 @@ RequestScheduler.maximumRequestsPerServer = 6; /** * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer + * @type {Object} * * @example * RequestScheduler.requestsByServer = { diff --git a/Source/Core/RequestState.js b/Source/Core/RequestState.js index 19e2cd1029bd..7dde7663867a 100644 --- a/Source/Core/RequestState.js +++ b/Source/Core/RequestState.js @@ -1,7 +1,7 @@ /** * State of the request. * - * @exports RequestState + * @enum {Number} */ var RequestState = { /** diff --git a/Source/Core/RequestType.js b/Source/Core/RequestType.js index c5f99a70b164..2dc54e96e8bf 100644 --- a/Source/Core/RequestType.js +++ b/Source/Core/RequestType.js @@ -1,7 +1,7 @@ /** * An enum identifying the type of request. Used for finer grained logging and priority sorting. * - * @exports RequestType + * @enum {Number} */ var RequestType = { /** diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index a95c8746d243..85616a1fd52f 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -224,7 +224,7 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @@ -621,7 +621,7 @@ Resource.prototype.setTemplateValues = function (template, useAsDefault) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance. * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The function to call when loading the resource fails. + * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails. * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {Boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource. @@ -783,7 +783,7 @@ Resource.prototype.fetchArrayBuffer = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -827,7 +827,7 @@ Resource.prototype.fetchBlob = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -846,7 +846,7 @@ Resource.fetchBlob = function (options) { * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob. * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap is returned. * @param {Boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap. - * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1035,12 +1035,12 @@ function fetchImage(options) { * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob. * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap is returned. - * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.|Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.fetchImage = function (options) { var resource = new Resource(options); @@ -1092,7 +1092,7 @@ Resource.prototype.fetchText = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1153,7 +1153,7 @@ Resource.prototype.fetchJson = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1202,7 +1202,7 @@ Resource.prototype.fetchXML = function () { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. @@ -1305,7 +1305,7 @@ function fetchJsonp(resource, callbackParameterName, functionName) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects. @@ -1471,7 +1471,7 @@ Resource.prototype.fetch = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1528,7 +1528,7 @@ Resource.prototype.delete = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1585,7 +1585,7 @@ Resource.prototype.head = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1641,7 +1641,7 @@ Resource.prototype.options = function (options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1703,7 +1703,7 @@ Resource.prototype.post = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1764,7 +1764,7 @@ Resource.prototype.put = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -1825,7 +1825,7 @@ Resource.prototype.patch = function (data, options) { * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource~RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. @@ -2202,7 +2202,7 @@ Resource.DEFAULT = Object.freeze( /** * A function that returns the value of the property. - * @callback Resource~RetryCallback + * @callback Resource.RetryCallback * * @param {Resource} [resource] The resource that failed to load. * @param {Error} [error] The error that occurred during the loading of the resource. diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js index 050e7edd72c7..db52177dc029 100644 --- a/Source/Core/ScreenSpaceEventHandler.js +++ b/Source/Core/ScreenSpaceEventHandler.js @@ -897,7 +897,7 @@ function handlePointerMove(screenSpaceEventHandler, event) { * * @alias ScreenSpaceEventHandler * - * @param {Canvas} [element=document] The element to add events to. + * @param {HTMLCanvasElement} [element=document] The element to add events to. * * @constructor */ diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js index 842988855518..406533eb769b 100644 --- a/Source/Core/ScreenSpaceEventType.js +++ b/Source/Core/ScreenSpaceEventType.js @@ -1,7 +1,7 @@ /** * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. * - * @exports ScreenSpaceEventType + * @enum {Number} */ var ScreenSpaceEventType = { /** diff --git a/Source/Core/Simon1994PlanetaryPositions.js b/Source/Core/Simon1994PlanetaryPositions.js index 91f9f61ba03c..1517ad39aea6 100644 --- a/Source/Core/Simon1994PlanetaryPositions.js +++ b/Source/Core/Simon1994PlanetaryPositions.js @@ -11,7 +11,7 @@ import TimeStandard from "./TimeStandard.js"; * Contains functions for finding the Cartesian coordinates of the sun and the moon in the * Earth-centered inertial frame. * - * @exports Simon1994PlanetaryPositions + * @namespace Simon1994PlanetaryPositions */ var Simon1994PlanetaryPositions = {}; diff --git a/Source/Core/TerrainData.js b/Source/Core/TerrainData.js index 570418275b0b..a76e95e998f4 100644 --- a/Source/Core/TerrainData.js +++ b/Source/Core/TerrainData.js @@ -29,7 +29,7 @@ Object.defineProperties(TerrainData.prototype, { * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @memberof TerrainData.prototype - * @type {Uint8Array|Image|Canvas} + * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement} */ waterMask: { get: DeveloperError.throwInstantiationError, diff --git a/Source/Core/TerrainProvider.js b/Source/Core/TerrainProvider.js index 21b44393f51d..d733d202e89a 100644 --- a/Source/Core/TerrainProvider.js +++ b/Source/Core/TerrainProvider.js @@ -439,7 +439,7 @@ TerrainProvider.prototype.getTileDataAvailable = * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ TerrainProvider.prototype.loadTileDataAvailability = DeveloperError.throwInstantiationError; diff --git a/Source/Core/TerrainQuantization.js b/Source/Core/TerrainQuantization.js index 594b59da6672..7e3153f803d7 100644 --- a/Source/Core/TerrainQuantization.js +++ b/Source/Core/TerrainQuantization.js @@ -1,7 +1,7 @@ /** * This enumerated type is used to determine how the vertices of the terrain mesh are compressed. * - * @exports TerrainQuantization + * @enum {Number} * * @private */ diff --git a/Source/Core/TileProviderError.js b/Source/Core/TileProviderError.js index d8c36b2aeb61..a7465cbd711b 100644 --- a/Source/Core/TileProviderError.js +++ b/Source/Core/TileProviderError.js @@ -102,7 +102,7 @@ function TileProviderError( * error is not specific to a particular tile. * @param {Number} level The level-of-detail of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. - * @param {TileProviderError~RetryFunction} retryFunction The function to call to retry the operation. If undefined, the + * @param {TileProviderError.RetryFunction} retryFunction The function to call to retry the operation. If undefined, the * operation will not be retried. * @param {Error} [errorDetails] The error or exception that occurred, if any. * @returns {TileProviderError} The error instance that was passed to the event listeners and that @@ -175,6 +175,6 @@ TileProviderError.handleSuccess = function (previousError) { /** * A function that will be called to retry the operation. - * @callback TileProviderError~RetryFunction + * @callback TileProviderError.RetryFunction */ export default TileProviderError; diff --git a/Source/Core/TimeConstants.js b/Source/Core/TimeConstants.js index caf182f080e1..d6a805af65d9 100644 --- a/Source/Core/TimeConstants.js +++ b/Source/Core/TimeConstants.js @@ -1,7 +1,7 @@ /** * Constants for time conversions like those done by {@link JulianDate}. * - * @exports TimeConstants + * @namespace TimeConstants * * @see JulianDate * diff --git a/Source/Core/TimeInterval.js b/Source/Core/TimeInterval.js index e694e0079a82..679245751d50 100644 --- a/Source/Core/TimeInterval.js +++ b/Source/Core/TimeInterval.js @@ -217,7 +217,7 @@ TimeInterval.clone = function (timeInterval, result) { * * @param {TimeInterval} [left] The first instance. * @param {TimeInterval} [right] The second instance. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if the dates are equal; otherwise, false. */ TimeInterval.equals = function (left, right, dataComparer) { @@ -243,14 +243,12 @@ TimeInterval.equals = function (left, right, dataComparer) { * * @param {TimeInterval} [left] The first instance. * @param {TimeInterval} [right] The second instance. - * @param {Number} epsilon The maximum number of seconds that should separate the two instances. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if the two dates are within epsilon seconds of each other; otherwise false. */ TimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.number("epsilon", epsilon); - //>>includeEnd('debug'); + epsilon = defaultValue(epsilon, 0); return ( left === right || @@ -271,14 +269,13 @@ TimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) { * * @param {TimeInterval} left The first interval. * @param {TimeInterval} [right] The second interval. - * @param {TimeInterval} result An existing instance to use for the result. - * @param {TimeInterval~MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @param {TimeInterval} [result] An existing instance to use for the result. + * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. * @returns {TimeInterval} The modified result parameter. */ TimeInterval.intersect = function (left, right, result, mergeCallback) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("left", left); - Check.typeOf.object("result", result); //>>includeEnd('debug'); if (!defined(right)) { @@ -309,6 +306,10 @@ TimeInterval.intersect = function (left, right, result, mergeCallback) { var rightIsStopIncluded = right.isStopIncluded; var leftLessThanRight = JulianDate.lessThan(leftStop, rightStop); + if (!defined(result)) { + result = new TimeInterval(); + } + result.start = intersectsStartRight ? rightStart : leftStart; result.isStartIncluded = (leftIsStartIncluded && rightIsStartIncluded) || @@ -371,7 +372,7 @@ TimeInterval.prototype.clone = function (result) { * true if they are equal, false otherwise. * * @param {TimeInterval} [right] The right hand side interval. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are equal, false otherwise. */ TimeInterval.prototype.equals = function (right, dataComparer) { @@ -384,8 +385,8 @@ TimeInterval.prototype.equals = function (right, dataComparer) { * false otherwise. * * @param {TimeInterval} [right] The right hand side interval. - * @param {Number} epsilon The epsilon to use for equality testing. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {Number} [epsilon=0] The epsilon to use for equality testing. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are within the provided epsilon, false otherwise. */ TimeInterval.prototype.equalsEpsilon = function (right, epsilon, dataComparer) { @@ -418,7 +419,7 @@ TimeInterval.EMPTY = Object.freeze( /** * Function interface for merging interval data. - * @callback TimeInterval~MergeCallback + * @callback TimeInterval.MergeCallback * * @param {*} leftData The first data instance. * @param {*} rightData The second data instance. @@ -427,7 +428,7 @@ TimeInterval.EMPTY = Object.freeze( /** * Function interface for comparing interval data. - * @callback TimeInterval~DataComparer + * @callback TimeInterval.DataComparer * @param {*} leftData The first data instance. * @param {*} rightData The second data instance. * @returns {Boolean} true if the provided instances are equal, false otherwise. diff --git a/Source/Core/TimeIntervalCollection.js b/Source/Core/TimeIntervalCollection.js index 7ec77401a76d..f4e1d135a576 100644 --- a/Source/Core/TimeIntervalCollection.js +++ b/Source/Core/TimeIntervalCollection.js @@ -129,7 +129,7 @@ Object.defineProperties(TimeIntervalCollection.prototype, { * true if they are equal, false otherwise. * * @param {TimeIntervalCollection} [right] The right hand side collection. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns {Boolean} true if they are equal, false otherwise. */ TimeIntervalCollection.prototype.equals = function (right, dataComparer) { @@ -305,7 +305,7 @@ TimeIntervalCollection.prototype.findInterval = function (options) { * The data in the new interval takes precedence over any existing intervals in the collection. * * @param {TimeInterval} interval The interval to add. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. */ TimeIntervalCollection.prototype.addInterval = function ( interval, @@ -664,8 +664,8 @@ TimeIntervalCollection.prototype.removeInterval = function (interval) { * Creates a new instance that is the intersection of this collection and the provided collection. * * @param {TimeIntervalCollection} other The collection to intersect with. - * @param {TimeInterval~DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. - * @param {TimeInterval~MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. * @returns {TimeIntervalCollection} A new TimeIntervalCollection which is the intersection of this collection and the provided collection. */ TimeIntervalCollection.prototype.intersect = function ( diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js index a41435ea9424..97f951354a94 100644 --- a/Source/Core/TimeStandard.js +++ b/Source/Core/TimeStandard.js @@ -1,7 +1,7 @@ /** * Provides the type of time standards which JulianDate can take as input. * - * @exports TimeStandard + * @enum {Number} * * @see JulianDate */ diff --git a/Source/Core/Tipsify.js b/Source/Core/Tipsify.js index 6836c7207ba9..575bd76788a5 100644 --- a/Source/Core/Tipsify.js +++ b/Source/Core/Tipsify.js @@ -8,7 +8,7 @@ import DeveloperError from "./DeveloperError.js"; * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.' * The runtime is linear but several passes are made. * - * @exports Tipsify + * @namespace Tipsify * * @see * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw diff --git a/Source/Core/Transforms.js b/Source/Core/Transforms.js index 5bf47eff85f9..26e7f715435f 100644 --- a/Source/Core/Transforms.js +++ b/Source/Core/Transforms.js @@ -23,8 +23,7 @@ import TimeConstants from "./TimeConstants.js"; /** * Contains functions for transforming positions to various reference frames. * - * @exports Transforms - * @namespace + * @namespace Transforms */ var Transforms = {}; @@ -96,7 +95,7 @@ var scratchThirdCartesian = new Cartesian3(); * 'east', 'north', 'up', 'west', 'south' or 'down'. * @param {String} secondAxis name of the second axis of the local reference frame. Must be * 'east', 'north', 'up', 'west', 'south' or 'down'. - * @return {localFrameToFixedFrameGenerator~resultat} The function that will computes a + * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters, */ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { @@ -113,7 +112,7 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) { /** * Computes a 4x4 transformation matrix from a reference frame * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * @callback Transforms~LocalFrameToFixedFrame + * @callback Transforms.LocalFrameToFixedFrame * @param {Cartesian3} origin The center point of the local reference frame. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. * @param {Matrix4} [result] The object onto which to store the result. @@ -369,7 +368,7 @@ var scratchHPRMatrix4 = new Matrix4(); * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Matrix4} [result] The object onto which to store the result. * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided. @@ -424,7 +423,7 @@ var scratchHPRMatrix3 = new Matrix3(); * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Quaternion} [result] The object onto which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. @@ -473,7 +472,7 @@ var hprQuaternionScratch = new Quaternion(); * * @param {Matrix4} transform The transform * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {HeadingPitchRoll} [result] The object onto which to store the result. * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided. @@ -654,7 +653,7 @@ var j2000ttDays = 2451545.0; * indicates that the preload has completed. * * @param {TimeInterval} timeInterval The interval to preload. - * @returns {Promise} A promise that, when resolved, indicates that the preload has completed + * @returns {Promise} A promise that, when resolved, indicates that the preload has completed * and evaluation of the transformation between the fixed and ICRF axes will * no longer return undefined for a time inside the interval. * diff --git a/Source/Core/TridiagonalSystemSolver.js b/Source/Core/TridiagonalSystemSolver.js index b4cef5548d7c..dd387a708e34 100644 --- a/Source/Core/TridiagonalSystemSolver.js +++ b/Source/Core/TridiagonalSystemSolver.js @@ -6,7 +6,7 @@ import DeveloperError from "./DeveloperError.js"; * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve * a system of linear equations where the coefficient matrix is a tridiagonal matrix. * - * @exports TridiagonalSystemSolver + * @namespace TridiagonalSystemSolver */ var TridiagonalSystemSolver = {}; diff --git a/Source/Core/TrustedServers.js b/Source/Core/TrustedServers.js index 8393a1adb192..7618506de07e 100644 --- a/Source/Core/TrustedServers.js +++ b/Source/Core/TrustedServers.js @@ -6,7 +6,7 @@ import DeveloperError from "./DeveloperError.js"; * A singleton that contains all of the servers that are trusted. Credentials will be sent with * any requests to these servers. * - * @exports TrustedServers + * @namespace TrustedServers * * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} */ diff --git a/Source/Core/VRTheWorldTerrainProvider.js b/Source/Core/VRTheWorldTerrainProvider.js index 00870f6878ca..dd54dd1ca541 100644 --- a/Source/Core/VRTheWorldTerrainProvider.js +++ b/Source/Core/VRTheWorldTerrainProvider.js @@ -417,7 +417,7 @@ VRTheWorldTerrainProvider.prototype.getTileDataAvailable = function ( * @param {Number} x The X coordinate of the tile for which to request geometry. * @param {Number} y The Y coordinate of the tile for which to request geometry. * @param {Number} level The level of the tile for which to request geometry. - * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded */ VRTheWorldTerrainProvider.prototype.loadTileDataAvailability = function ( x, diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js index c052f3f4a128..cc20094d549b 100644 --- a/Source/Core/Visibility.js +++ b/Source/Core/Visibility.js @@ -4,7 +4,7 @@ * it has no visibility, may partially block an occludee from view, or may not block it at all, * leading to full visibility. * - * @exports Visibility + * @enum {Number} */ var Visibility = { /** diff --git a/Source/Core/WebGLConstants.js b/Source/Core/WebGLConstants.js index e0923a3d8f8b..32b63443cd2a 100644 --- a/Source/Core/WebGLConstants.js +++ b/Source/Core/WebGLConstants.js @@ -7,7 +7,7 @@ * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} * specifications. * - * @exports WebGLConstants + * @enum {Number} */ var WebGLConstants = { DEPTH_BUFFER_BIT: 0x00000100, diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js index a24e50a49b54..2ec8947e6886 100644 --- a/Source/Core/WindingOrder.js +++ b/Source/Core/WindingOrder.js @@ -3,7 +3,7 @@ import WebGLConstants from "./WebGLConstants.js"; /** * Winding order defines the order of vertices for a triangle to be considered front-facing. * - * @exports WindingOrder + * @enum {Number} */ var WindingOrder = { /** @@ -21,15 +21,16 @@ var WindingOrder = { * @constant */ COUNTER_CLOCKWISE: WebGLConstants.CCW, +}; - /** - * @private - */ - validate: function (windingOrder) { - return ( - windingOrder === WindingOrder.CLOCKWISE || - windingOrder === WindingOrder.COUNTER_CLOCKWISE - ); - }, +/** + * @private + */ +WindingOrder.validate = function (windingOrder) { + return ( + windingOrder === WindingOrder.CLOCKWISE || + windingOrder === WindingOrder.COUNTER_CLOCKWISE + ); }; + export default Object.freeze(WindingOrder); diff --git a/Source/Core/barycentricCoordinates.js b/Source/Core/barycentricCoordinates.js index 70b81978626f..61daebcf5530 100644 --- a/Source/Core/barycentricCoordinates.js +++ b/Source/Core/barycentricCoordinates.js @@ -11,7 +11,7 @@ var scratchCartesian3 = new Cartesian3(); /** * Computes the barycentric coordinates for a point with respect to a triangle. * - * @exports barycentricCoordinates + * @function * * @param {Cartesian2|Cartesian3} point The point to test. * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis. diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js index b4866ac34565..20c9655620ea 100644 --- a/Source/Core/binarySearch.js +++ b/Source/Core/binarySearch.js @@ -3,10 +3,10 @@ import Check from "./Check.js"; /** * Finds an item in a sorted array. * - * @exports binarySearch + * @function * @param {Array} array The sorted array to search. * @param {*} itemToFind The item to find in the array. - * @param {binarySearch~Comparator} comparator The function to use to compare the item to + * @param {binarySearchComparator} comparator The function to use to compare the item to * elements in the array. * @returns {Number} The index of itemToFind in the array, if it exists. If itemToFind * does not exist, the return value is a negative number which is the bitwise complement (~) @@ -51,7 +51,7 @@ function binarySearch(array, itemToFind, comparator) { /** * A function used to compare two items while performing a binary search. - * @callback binarySearch~Comparator + * @callback binarySearchComparator * * @param {*} a An item in the array. * @param {*} b The item being searched for. diff --git a/Source/Core/cancelAnimationFrame.js b/Source/Core/cancelAnimationFrame.js index fdfdab4883f7..c0b1cfd58883 100644 --- a/Source/Core/cancelAnimationFrame.js +++ b/Source/Core/cancelAnimationFrame.js @@ -29,7 +29,7 @@ if (typeof cancelAnimationFrame !== "undefined") { /** * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}. * - * @exports cancelAnimationFrame + * @function cancelAnimationFrame * * @param {Number} requestID The value returned by {@link requestAnimationFrame}. * diff --git a/Source/Core/clone.js b/Source/Core/clone.js index 589e026d2a4c..98ae5f2809d5 100644 --- a/Source/Core/clone.js +++ b/Source/Core/clone.js @@ -3,7 +3,7 @@ import defaultValue from "./defaultValue.js"; /** * Clones an object, returning a new object containing the same properties. * - * @exports clone + * @function * * @param {Object} object The object to clone. * @param {Boolean} [deep=false] If true, all properties will be deep cloned recursively. diff --git a/Source/Core/combine.js b/Source/Core/combine.js index 4c589c03ac34..c238e11e226f 100644 --- a/Source/Core/combine.js +++ b/Source/Core/combine.js @@ -30,7 +30,7 @@ import defined from "./defined.js"; * @param {Boolean} [deep=false] Perform a recursive merge. * @returns {Object} The combined object containing all properties from both objects. * - * @exports combine + * @function */ function combine(object1, object2, deep) { deep = defaultValue(deep, false); diff --git a/Source/Core/createGuid.js b/Source/Core/createGuid.js index d141e7df4fb6..882eef2e2950 100644 --- a/Source/Core/createGuid.js +++ b/Source/Core/createGuid.js @@ -1,7 +1,7 @@ /** * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. * - * @exports createGuid + * @function * * @returns {String} * diff --git a/Source/Core/createWorldTerrain.js b/Source/Core/createWorldTerrain.js index a2e7f4572bd4..7b4eccaa20ae 100644 --- a/Source/Core/createWorldTerrain.js +++ b/Source/Core/createWorldTerrain.js @@ -5,7 +5,7 @@ import IonResource from "./IonResource.js"; /** * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. * - * @exports createWorldTerrain + * @function * * @param {Object} [options] Object with the following properties: * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available. diff --git a/Source/Core/defaultValue.js b/Source/Core/defaultValue.js index ad5a279b0658..9a52e51ecfb6 100644 --- a/Source/Core/defaultValue.js +++ b/Source/Core/defaultValue.js @@ -2,7 +2,7 @@ * Returns the first parameter if not undefined, otherwise the second parameter. * Useful for setting a default value for a parameter. * - * @exports defaultValue + * @function * * @param {*} a * @param {*} b @@ -22,6 +22,8 @@ function defaultValue(a, b) { * A frozen empty object that can be used as the default value for options passed as * an object literal. * @type {Object} + * @memberof defaultValue */ defaultValue.EMPTY_OBJECT = Object.freeze({}); + export default defaultValue; diff --git a/Source/Core/defined.js b/Source/Core/defined.js index 837d212e5488..d9125ecd06b0 100644 --- a/Source/Core/defined.js +++ b/Source/Core/defined.js @@ -1,5 +1,5 @@ /** - * @exports defined + * @function * * @param {*} value The object. * @returns {Boolean} Returns true if the object is defined, returns false otherwise. diff --git a/Source/Core/deprecationWarning.js b/Source/Core/deprecationWarning.js index 77efbe1f1d4e..6e762389326f 100644 --- a/Source/Core/deprecationWarning.js +++ b/Source/Core/deprecationWarning.js @@ -7,7 +7,7 @@ import oneTimeWarning from "./oneTimeWarning.js"; * console.log directly since this does not log duplicate messages * unless it is called from multiple workers. * - * @exports deprecationWarning + * @function deprecationWarning * * @param {String} identifier The unique identifier for this deprecated API. * @param {String} message The message to log to the console. diff --git a/Source/Core/destroyObject.js b/Source/Core/destroyObject.js index 8e3f631be348..6a73f626eec8 100644 --- a/Source/Core/destroyObject.js +++ b/Source/Core/destroyObject.js @@ -16,7 +16,7 @@ function returnTrue() { * which then releases the native resource and calls destroyObject to put itself * in a destroyed state. * - * @exports destroyObject + * @function * * @param {Object} object The object to destroy. * @param {String} [message] The message to include in the exception that is thrown if diff --git a/Source/Core/formatError.js b/Source/Core/formatError.js index 9593effbc986..02c2c532be6f 100644 --- a/Source/Core/formatError.js +++ b/Source/Core/formatError.js @@ -4,7 +4,7 @@ import defined from "./defined.js"; * Formats an error object into a String. If available, uses name, message, and stack * properties, otherwise, falls back on toString(). * - * @exports formatError + * @function * * @param {*} object The item to find in the array. * @returns {String} A string containing the formatted error. diff --git a/Source/Core/getAbsoluteUri.js b/Source/Core/getAbsoluteUri.js index 7a0b3c747bf3..fa10178da021 100644 --- a/Source/Core/getAbsoluteUri.js +++ b/Source/Core/getAbsoluteUri.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri. - * @exports getAbsoluteUri + * @function * * @param {String} relative The relative Uri. * @param {String} [base] The base Uri. diff --git a/Source/Core/getBaseUri.js b/Source/Core/getBaseUri.js index 9a50b773c32d..a12482eff87a 100644 --- a/Source/Core/getBaseUri.js +++ b/Source/Core/getBaseUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the base path of the URI. - * @exports getBaseUri + * @function * * @param {String} uri The Uri. * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri diff --git a/Source/Core/getExtensionFromUri.js b/Source/Core/getExtensionFromUri.js index e961fcd7dfb5..084443c6da38 100644 --- a/Source/Core/getExtensionFromUri.js +++ b/Source/Core/getExtensionFromUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the extension of the URI. - * @exports getExtensionFromUri + * @function getExtensionFromUri * * @param {String} uri The Uri. * @returns {String} The extension of the Uri. diff --git a/Source/Core/getFilenameFromUri.js b/Source/Core/getFilenameFromUri.js index 20b6f7fd6385..4bb4f6372c18 100644 --- a/Source/Core/getFilenameFromUri.js +++ b/Source/Core/getFilenameFromUri.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Given a URI, returns the last segment of the URI, removing any path or query information. - * @exports getFilenameFromUri + * @function getFilenameFromUri * * @param {String} uri The Uri. * @returns {String} The last segment of the Uri. diff --git a/Source/Core/getImagePixels.js b/Source/Core/getImagePixels.js index 69476755a46d..d6a8044e9c6b 100644 --- a/Source/Core/getImagePixels.js +++ b/Source/Core/getImagePixels.js @@ -6,12 +6,12 @@ var context2DsByWidthAndHeight = {}; * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * - * @exports getImagePixels + * @function getImagePixels * - * @param {Image} image The image to extract pixels from. + * @param {HTMLImageElement} image The image to extract pixels from. * @param {Number} width The width of the image. If not defined, then image.width is assigned. * @param {Number} height The height of the image. If not defined, then image.height is assigned. - * @returns {CanvasPixelArray} The pixels of the image. + * @returns {ImageData} The pixels of the image. */ function getImagePixels(image, width, height) { if (!defined(width)) { diff --git a/Source/Core/getTimestamp.js b/Source/Core/getTimestamp.js index b75cbcac3523..664c39aa26c2 100644 --- a/Source/Core/getTimestamp.js +++ b/Source/Core/getTimestamp.js @@ -4,7 +4,7 @@ * measured from. This function uses performance.now() if it is available, or Date.now() * otherwise. * - * @exports getTimestamp + * @function getTimestamp * * @returns {Number} The timestamp in milliseconds since some unspecified reference time. */ diff --git a/Source/Core/isBlobUri.js b/Source/Core/isBlobUri.js index 96ac059334ef..513e448fefdb 100644 --- a/Source/Core/isBlobUri.js +++ b/Source/Core/isBlobUri.js @@ -5,7 +5,7 @@ var blobUriRegex = /^blob:/i; /** * Determines if the specified uri is a blob uri. * - * @exports isBlobUri + * @function isBlobUri * * @param {String} uri The uri to test. * @returns {Boolean} true when the uri is a blob uri; otherwise, false. diff --git a/Source/Core/isDataUri.js b/Source/Core/isDataUri.js index 12c36d108a6d..a32ad5dcef6d 100644 --- a/Source/Core/isDataUri.js +++ b/Source/Core/isDataUri.js @@ -5,7 +5,7 @@ var dataUriRegex = /^data:/i; /** * Determines if the specified uri is a data uri. * - * @exports isDataUri + * @function isDataUri * * @param {String} uri The uri to test. * @returns {Boolean} true when the uri is a data uri; otherwise, false. diff --git a/Source/Core/isLeapYear.js b/Source/Core/isLeapYear.js index 3e180bcafab8..84380496dd7d 100644 --- a/Source/Core/isLeapYear.js +++ b/Source/Core/isLeapYear.js @@ -3,7 +3,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Determines if a given date is a leap year. * - * @exports isLeapYear + * @function isLeapYear * * @param {Number} year The year to be tested. * @returns {Boolean} True if year is a leap year. diff --git a/Source/Core/loadCRN.js b/Source/Core/loadCRN.js index 68b659c2833c..c7676364cc13 100644 --- a/Source/Core/loadCRN.js +++ b/Source/Core/loadCRN.js @@ -17,7 +17,7 @@ var transcodeTaskProcessor = new TaskProcessor( * using XMLHttpRequest, which means that in order to make requests to another origin, * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * - * @exports loadCRN + * @function loadCRN * * @param {Resource|String|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer. * @returns {Promise.|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. diff --git a/Source/Core/loadKTX.js b/Source/Core/loadKTX.js index 48e9ef10c288..6fdab8ae14ec 100644 --- a/Source/Core/loadKTX.js +++ b/Source/Core/loadKTX.js @@ -25,7 +25,7 @@ import WebGLConstants from "./WebGLConstants.js"; * *

* - * @exports loadKTX + * @function loadKTX * * @param {Resource|String|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer. * @returns {Promise.|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. diff --git a/Source/Core/mergeSort.js b/Source/Core/mergeSort.js index 1b1d2341c95a..ffe0b095b420 100644 --- a/Source/Core/mergeSort.js +++ b/Source/Core/mergeSort.js @@ -55,9 +55,9 @@ function sort(array, compare, userDefinedObject, start, end) { /** * A stable merge sort. * - * @exports mergeSort + * @function mergeSort * @param {Array} array The array to sort. - * @param {mergeSort~Comparator} comparator The function to use to compare elements in the array. + * @param {mergeSortComparator} comparator The function to use to compare elements in the array. * @param {*} [userDefinedObject] Any item to pass as the third parameter to comparator. * * @example @@ -94,7 +94,7 @@ function mergeSort(array, comparator, userDefinedObject) { /** * A function used to compare two items while performing a merge sort. - * @callback mergeSort~Comparator + * @callback mergeSortComparator * * @param {*} a An item in the array. * @param {*} b An item in the array. diff --git a/Source/Core/objectToQuery.js b/Source/Core/objectToQuery.js index 598d05242b6e..85ea4fe51261 100644 --- a/Source/Core/objectToQuery.js +++ b/Source/Core/objectToQuery.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * Converts an object representing a set of name/value pairs into a query string, * with names and values encoded properly for use in a URL. Values that are arrays * will produce multiple values with the same name. - * @exports objectToQuery + * @function objectToQuery * * @param {Object} obj The object containing data to encode. * @returns {String} An encoded query string. diff --git a/Source/Core/oneTimeWarning.js b/Source/Core/oneTimeWarning.js index 11f0a043f935..849604bf1eab 100644 --- a/Source/Core/oneTimeWarning.js +++ b/Source/Core/oneTimeWarning.js @@ -9,7 +9,7 @@ var warnings = {}; * console.log directly since this does not log duplicate messages * unless it is called from multiple workers. * - * @exports oneTimeWarning + * @function oneTimeWarning * * @param {String} identifier The unique identifier for this warning. * @param {String} [message=identifier] The message to log to the console. diff --git a/Source/Core/parseResponseHeaders.js b/Source/Core/parseResponseHeaders.js index 5a2f30dd9a60..d6501c19200f 100644 --- a/Source/Core/parseResponseHeaders.js +++ b/Source/Core/parseResponseHeaders.js @@ -2,7 +2,7 @@ * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into * a dictionary. * - * @exports parseResponseHeaders + * @function parseResponseHeaders * * @param {String} headerString The header string returned by getAllResponseHeaders(). The format is * described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method diff --git a/Source/Core/pointInsideTriangle.js b/Source/Core/pointInsideTriangle.js index 19cf0608f9f4..ca4f55b87356 100644 --- a/Source/Core/pointInsideTriangle.js +++ b/Source/Core/pointInsideTriangle.js @@ -6,7 +6,7 @@ var coords = new Cartesian3(); /** * Determines if a point is inside a triangle. * - * @exports pointInsideTriangle + * @function pointInsideTriangle * * @param {Cartesian2|Cartesian3} point The point to test. * @param {Cartesian2|Cartesian3} p0 The first point of the triangle. diff --git a/Source/Core/queryToObject.js b/Source/Core/queryToObject.js index 7668c63dbeb4..bc36e569ae18 100644 --- a/Source/Core/queryToObject.js +++ b/Source/Core/queryToObject.js @@ -5,7 +5,7 @@ import DeveloperError from "./DeveloperError.js"; * Parses a query string into an object, where the keys and values of the object are the * name/value pairs from the query string, decoded. If a name appears multiple times, * the value in the object will be an array of values. - * @exports queryToObject + * @function queryToObject * * @param {String} queryString The query string. * @returns {Object} An object containing the parameters parsed from the query string. diff --git a/Source/Core/requestAnimationFrame.js b/Source/Core/requestAnimationFrame.js index 3c4db07f3ed9..e0fb02d9cb80 100644 --- a/Source/Core/requestAnimationFrame.js +++ b/Source/Core/requestAnimationFrame.js @@ -41,9 +41,9 @@ if (typeof requestAnimationFrame !== "undefined") { * A browser-independent function to request a new animation frame. This is used to create * an application's draw loop as shown in the example below. * - * @exports requestAnimationFrame + * @function requestAnimationFrame * - * @param {requestAnimationFrame~Callback} callback The function to call when the next frame should be drawn. + * @param {requestAnimationFrameCallback} callback The function to call when the next frame should be drawn. * @returns {Number} An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. * * @@ -67,7 +67,7 @@ function requestAnimationFramePolyFill(callback) { /** * A function that will be called when the next frame should be drawn. - * @callback requestAnimationFrame~Callback + * @callback requestAnimationFrameCallback * * @param {Number} timestamp A timestamp for the frame, in milliseconds. */ diff --git a/Source/Core/sampleTerrain.js b/Source/Core/sampleTerrain.js index 8696e1e34ed1..93f2f6f3407c 100644 --- a/Source/Core/sampleTerrain.js +++ b/Source/Core/sampleTerrain.js @@ -15,7 +15,7 @@ import Check from "./Check.js"; * terrain level of detail as input, if you need to get the altitude of the terrain as precisely * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. * - * @exports sampleTerrain + * @function sampleTerrain * * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. * @param {Number} level The terrain level-of-detail from which to query terrain heights. diff --git a/Source/Core/sampleTerrainMostDetailed.js b/Source/Core/sampleTerrainMostDetailed.js index f899cbb870d1..21a598632a0e 100644 --- a/Source/Core/sampleTerrainMostDetailed.js +++ b/Source/Core/sampleTerrainMostDetailed.js @@ -9,7 +9,7 @@ var scratchCartesian2 = new Cartesian2(); /** * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. * - * @exports sampleTerrainMostDetailed + * @function sampleTerrainMostDetailed * * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. * @param {Cartographic[]} positions The positions to update with terrain heights. diff --git a/Source/Core/scaleToGeodeticSurface.js b/Source/Core/scaleToGeodeticSurface.js index 563d651cb392..04beab4efdc4 100644 --- a/Source/Core/scaleToGeodeticSurface.js +++ b/Source/Core/scaleToGeodeticSurface.js @@ -18,7 +18,7 @@ var scaleToGeodeticSurfaceGradient = new Cartesian3(); * @param {Cartesian3} [result] The object onto which to store the result. * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center. * - * @exports scaleToGeodeticSurface + * @function scaleToGeodeticSurface * * @private */ diff --git a/Source/Core/subdivideArray.js b/Source/Core/subdivideArray.js index 5697a7119afd..a4eed785084c 100644 --- a/Source/Core/subdivideArray.js +++ b/Source/Core/subdivideArray.js @@ -4,7 +4,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Subdivides an array into a number of smaller, equal sized arrays. * - * @exports subdivideArray + * @function subdivideArray * * @param {Array} array The array to divide. * @param {Number} numberOfArrays The number of arrays to divide the provided array into. diff --git a/Source/Core/writeTextToCanvas.js b/Source/Core/writeTextToCanvas.js index 6e13eaac6b70..6c1a8544d1c8 100644 --- a/Source/Core/writeTextToCanvas.js +++ b/Source/Core/writeTextToCanvas.js @@ -21,10 +21,10 @@ var imageSmoothingEnabledName; * @param {Number} [options.strokeWidth=1] The stroke width. * @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas. * @param {Number} [options.padding=0] The pixel size of the padding to add around the text. - * @returns {Canvas} A new canvas with the given text drawn into it. The dimensions object + * @returns {HTMLCanvasElement} A new canvas with the given text drawn into it. The dimensions object * from measureText will also be added to the returned canvas. If text is * blank, returns undefined. - * @exports writeTextToCanvas + * @function writeTextToCanvas */ function writeTextToCanvas(text, options) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/DataSources/BoundingSphereState.js b/Source/DataSources/BoundingSphereState.js index 59eac59561ee..f16ac0be0793 100644 --- a/Source/DataSources/BoundingSphereState.js +++ b/Source/DataSources/BoundingSphereState.js @@ -1,6 +1,6 @@ /** * The state of a BoundingSphere computation being performed by a {@link Visualizer}. - * @exports BoundingSphereState + * @enum {Number} * @private */ var BoundingSphereState = { diff --git a/Source/DataSources/BoxGeometryUpdater.js b/Source/DataSources/BoxGeometryUpdater.js index b9a16b1a83f9..fa45b4d15fc0 100644 --- a/Source/DataSources/BoxGeometryUpdater.js +++ b/Source/DataSources/BoxGeometryUpdater.js @@ -66,6 +66,7 @@ Object.defineProperties(BoxGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof BoxGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/CallbackProperty.js b/Source/DataSources/CallbackProperty.js index dd06f384b2db..e353d092bcba 100644 --- a/Source/DataSources/CallbackProperty.js +++ b/Source/DataSources/CallbackProperty.js @@ -8,7 +8,7 @@ import Event from "../Core/Event.js"; * @alias CallbackProperty * @constructor * - * @param {CallbackProperty~Callback} callback The function to be called when the property is evaluated. + * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated. * @param {Boolean} isConstant true when the callback function returns the same value every time, false if the value will change. */ function CallbackProperty(callback, isConstant) { @@ -60,7 +60,7 @@ CallbackProperty.prototype.getValue = function (time, result) { /** * Sets the callback to be used. * - * @param {CallbackProperty~Callback} callback The function to be called when the property is evaluated. + * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated. * @param {Boolean} isConstant true when the callback function returns the same value every time, false if the value will change. */ CallbackProperty.prototype.setCallback = function (callback, isConstant) { @@ -101,7 +101,7 @@ CallbackProperty.prototype.equals = function (other) { /** * A function that returns the value of the property. - * @callback CallbackProperty~Callback + * @callback CallbackProperty.Callback * * @param {JulianDate} [time] The time for which to retrieve the value. * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned. diff --git a/Source/DataSources/CylinderGeometryUpdater.js b/Source/DataSources/CylinderGeometryUpdater.js index bcfb95bb6ac0..17b2b0e29b85 100644 --- a/Source/DataSources/CylinderGeometryUpdater.js +++ b/Source/DataSources/CylinderGeometryUpdater.js @@ -75,6 +75,7 @@ Object.defineProperties(CylinderGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof CylinderGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js index d74732437c31..909057bdd92f 100644 --- a/Source/DataSources/DataSourceDisplay.js +++ b/Source/DataSources/DataSourceDisplay.js @@ -28,7 +28,7 @@ import PolylineVisualizer from "./PolylineVisualizer.js"; * @param {Object} options Object with the following properties: * @param {Scene} options.scene The scene in which to display the data. * @param {DataSourceCollection} options.dataSourceCollection The data sources to display. - * @param {DataSourceDisplay~VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] + * @param {DataSourceDisplay.VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] * A function which creates an array of visualizers used for visualization. * If undefined, all standard visualizers are used. */ @@ -124,7 +124,7 @@ function DataSourceDisplay(options) { * Gets or sets the default function which creates an array of visualizers used for visualization. * By default, this function uses all standard visualizers. * - * @type {DataSourceDisplay~VisualizersCallback} + * @type {DataSourceDisplay.VisualizersCallback} */ DataSourceDisplay.defaultVisualizersCallback = function ( scene, @@ -496,7 +496,7 @@ DataSourceDisplay.prototype._onDataSourceMoved = function ( /** * A function which creates an array of visualizers used for visualization. - * @callback DataSourceDisplay~VisualizersCallback + * @callback DataSourceDisplay.VisualizersCallback * * @param {Scene} scene The scene to create visualizers for. * @param {DataSource} dataSource The data source to create visualizers for. diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js index 2718bc8f2179..6531eb18564d 100644 --- a/Source/DataSources/EllipsoidGeometryUpdater.js +++ b/Source/DataSources/EllipsoidGeometryUpdater.js @@ -92,6 +92,7 @@ Object.defineProperties(EllipsoidGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof EllipsoidGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 977483823518..2779deb12142 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -547,7 +547,7 @@ Object.defineProperties(EntityCluster.prototype, { }, }, /** - * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster~newClusterCallback}. + * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. * @memberof EntityCluster.prototype * @type {Event} */ @@ -960,7 +960,7 @@ EntityCluster.prototype.destroy = function () { /** * A event listener function used to style clusters. - * @callback EntityCluster~newClusterCallback + * @callback EntityCluster.newClusterCallback * * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster. * @param {Object} cluster An object containing billboard, label, and point properties. The values are the same as diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js index e5d73e80ce41..9f8972fcb0ef 100644 --- a/Source/DataSources/GeoJsonDataSource.js +++ b/Source/DataSources/GeoJsonDataSource.js @@ -888,7 +888,7 @@ Object.defineProperties(GeoJsonDataSource.prototype, { * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded. * @param {Object} [options] An object with the following properties: * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links. - * @param {GeoJsonDataSource~describe} [options.describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string), + * @param {GeoJsonDataSource.describe} [options.describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string), * which converts the properties into an html description. * @param {Number} [options.markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels. * @param {String} [options.markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point. @@ -1037,7 +1037,7 @@ function load(that, geoJson, options, sourceUri) { /** * This callback is displayed as part of the GeoJsonDataSource class. - * @callback GeoJsonDataSource~describe + * @callback GeoJsonDataSource.describe * @param {Object} properties The properties of the feature. * @param {String} nameProperty The property key that Cesium estimates to have the name of the feature. */ diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js index 1377c87dc82c..d23137b4b797 100644 --- a/Source/DataSources/GeometryUpdater.js +++ b/Source/DataSources/GeometryUpdater.js @@ -519,6 +519,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. + * @private */ GeometryUpdater.prototype.createDynamicUpdater = function ( primitives, diff --git a/Source/DataSources/GroundGeometryUpdater.js b/Source/DataSources/GroundGeometryUpdater.js index 724b0b04f1c1..2879e88ea059 100644 --- a/Source/DataSources/GroundGeometryUpdater.js +++ b/Source/DataSources/GroundGeometryUpdater.js @@ -54,6 +54,7 @@ Object.defineProperties(GroundGeometryUpdater.prototype, { * @type {TerrainOffsetProperty} * @memberof GroundGeometryUpdater.prototype * @readonly + * @private */ terrainOffsetProperty: { get: function () { diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 124298ba9a96..63833fb6a62f 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -3358,7 +3358,7 @@ function load(dataSource, entityCollection, data, options) { * * @param {Object} options An object with the following properties: * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - * @param {Canvas} options.canvas The canvas that is used for sending viewer properties to network links. + * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. * @@ -3436,7 +3436,7 @@ function KmlDataSource(options) { * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. * @param {Object} options An object with the following properties: * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - * @param {Canvas} options.canvas The canvas that is used for sending viewer properties to network links. + * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links and other KML network features. * @param {Boolean} [options.clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. @@ -4006,112 +4006,68 @@ KmlDataSource.prototype.update = function (time) { * @constructor */ function KmlFeatureData() { + /** + * @typedef KmlFeatureData.Author + * @type {Object} + * @property {String} name Gets the name. + * @property {String} uri Gets the URI. + * @property {Number} age Gets the email. + */ + /** * Gets the atom syndication format author field. - * @type Object + * @type {KmlFeatureData.Author} */ this.author = { - /** - * Gets the name. - * @type String - * @alias author.name - * @memberof! KmlFeatureData# - * @property author.name - */ name: undefined, - /** - * Gets the URI. - * @type String - * @alias author.uri - * @memberof! KmlFeatureData# - * @property author.uri - */ uri: undefined, - /** - * Gets the email. - * @type String - * @alias author.email - * @memberof! KmlFeatureData# - * @property author.email - */ email: undefined, }; + /** + * @typedef KmlFeatureData.Link + * @type {Object} + * @property {String} href Gets the href. + * @property {String} hreflang Gets the language of the linked resource. + * @property {String} rel Gets the link relation. + * @property {String} type Gets the link type. + * @property {String} title Gets the link title. + * @property {String} length Gets the link length. + */ + /** * Gets the link. - * @type Object + * @type {KmlFeatureData.Link} */ this.link = { - /** - * Gets the href. - * @type String - * @alias link.href - * @memberof! KmlFeatureData# - * @property link.href - */ href: undefined, - /** - * Gets the language of the linked resource. - * @type String - * @alias link.hreflang - * @memberof! KmlFeatureData# - * @property link.hreflang - */ hreflang: undefined, - /** - * Gets the link relation. - * @type String - * @alias link.rel - * @memberof! KmlFeatureData# - * @property link.rel - */ rel: undefined, - /** - * Gets the link type. - * @type String - * @alias link.type - * @memberof! KmlFeatureData# - * @property link.type - */ type: undefined, - /** - * Gets the link title. - * @type String - * @alias link.title - * @memberof! KmlFeatureData# - * @property link.title - */ title: undefined, - /** - * Gets the link length. - * @type String - * @alias link.length - * @memberof! KmlFeatureData# - * @property link.length - */ length: undefined, }; /** * Gets the unstructured address field. - * @type String + * @type {String} */ this.address = undefined; /** * Gets the phone number. - * @type String + * @type {String} */ this.phoneNumber = undefined; /** * Gets the snippet. - * @type String + * @type {String} */ this.snippet = undefined; /** * Gets the extended data, parsed into a JSON object. * Currently only the Data property is supported. * SchemaData and custom data are ignored. - * @type String + * @type {String} */ this.extendedData = undefined; } diff --git a/Source/DataSources/KmlTourFlyTo.js b/Source/DataSources/KmlTourFlyTo.js index 97a3d8cce55b..f2f6b980fda4 100644 --- a/Source/DataSources/KmlTourFlyTo.js +++ b/Source/DataSources/KmlTourFlyTo.js @@ -24,7 +24,7 @@ function KmlTourFlyTo(duration, flyToMode, view) { /** * Play this playlist entry * - * @param {KmlTourFlyTo~DoneCallback} done function which will be called when playback ends + * @param {KmlTourFlyTo.DoneCallback} done function which will be called when playback ends * @param {Camera} camera Cesium camera * @param {Object} [cameraOptions] which will be merged with camera flyTo options. See {@link Camera#flyTo} */ @@ -95,7 +95,7 @@ KmlTourFlyTo.prototype.getCameraOptions = function (cameraOptions) { /** * A function that will be executed when the flight completes. - * @callback KmlTourFlyTo~DoneCallback + * @callback KmlTourFlyTo.DoneCallback * * @param {Boolean} terminated true if {@link KmlTourFlyTo#stop} was * called before entry done playback. diff --git a/Source/DataSources/KmlTourWait.js b/Source/DataSources/KmlTourWait.js index 6a809461ae42..476603d18553 100644 --- a/Source/DataSources/KmlTourWait.js +++ b/Source/DataSources/KmlTourWait.js @@ -16,7 +16,7 @@ function KmlTourWait(duration) { /** * Play this playlist entry * - * @param {KmlTourWait~DoneCallback} done function which will be called when playback ends + * @param {KmlTourWait.DoneCallback} done function which will be called when playback ends */ KmlTourWait.prototype.play = function (done) { var self = this; @@ -40,7 +40,7 @@ KmlTourWait.prototype.stop = function () { /** * A function which will be called when playback ends. * - * @callback KmlTourWait~DoneCallback + * @callback KmlTourWait.DoneCallback * @param {Boolean} terminated true if {@link KmlTourWait#stop} was * called before entry done playback. */ diff --git a/Source/DataSources/PolylineGeometryUpdater.js b/Source/DataSources/PolylineGeometryUpdater.js index b782858b1be8..96fc87575d61 100644 --- a/Source/DataSources/PolylineGeometryUpdater.js +++ b/Source/DataSources/PolylineGeometryUpdater.js @@ -616,6 +616,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. + * @private */ PolylineGeometryUpdater.prototype.createDynamicUpdater = function ( primitives, diff --git a/Source/DataSources/Rotation.js b/Source/DataSources/Rotation.js index 42aa8dbc8883..8273f8d1a3aa 100755 --- a/Source/DataSources/Rotation.js +++ b/Source/DataSources/Rotation.js @@ -9,7 +9,7 @@ import CesiumMath from "../Core/Math.js"; * but is instead passed to the constructor of {@link SampledProperty} * in order to represent a two-dimensional angle of rotation. * - * @exports Rotation + * @interface Rotation * * * @example @@ -87,7 +87,7 @@ var Rotation = { * @param {Number[]} packedArray The packed array. * @param {Number} [startingIndex=0] The index of the first element to be converted. * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted. - * @param {Number[]} result The object into which to store the result. + * @param {Number[]} [result] The object into which to store the result. */ convertPackedArrayForInterpolation: function ( packedArray, @@ -101,6 +101,10 @@ var Rotation = { } //>>includeEnd('debug'); + if (!defined(result)) { + result = []; + } + startingIndex = defaultValue(startingIndex, 0); lastIndex = defaultValue(lastIndex, packedArray.length); diff --git a/Source/DataSources/StripeOrientation.js b/Source/DataSources/StripeOrientation.js index aed7c398e134..c2da3b8f8810 100644 --- a/Source/DataSources/StripeOrientation.js +++ b/Source/DataSources/StripeOrientation.js @@ -1,7 +1,7 @@ /** * Defined the orientation of stripes in {@link StripeMaterialProperty}. * - * @exports StripeOrientation + * @enum {Number} */ var StripeOrientation = { /** diff --git a/Source/DataSources/TerrainOffsetProperty.js b/Source/DataSources/TerrainOffsetProperty.js index dc6d4d89f48d..ed9c22e13723 100644 --- a/Source/DataSources/TerrainOffsetProperty.js +++ b/Source/DataSources/TerrainOffsetProperty.js @@ -238,7 +238,7 @@ TerrainOffsetProperty.prototype.destroy = function () { /** * A function which creates one or more providers. - * @callback TerrainOffsetProperty~PositionFunction + * @callback TerrainOffsetProperty.PositionFunction * @param {JulianDate} time The clock time at which to retrieve the position * @param {Cartesian3} result The result position * @returns {Cartesian3} The position at which to do the terrain height check diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index d251de4143b3..bcb9ce080dc8 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -232,12 +232,12 @@ IdManager.prototype.get = function (id) { * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary * color is used. Canvas objects are exported as PNG images. * - * @exports exportKml + * @function exportKml * * @param {Object} options An object with the following properties: * @param {EntityCollection} options.entities The EntityCollection to export as KML. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. - * @param {exportKml~ModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. + * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. @@ -1503,7 +1503,7 @@ function colorToString(color) { * It can also be used to add additional files to the externalFiles object, which is the list of files embedded in the exported KMZ, * or otherwise returned with the KML string when exporting. * - * @callback exportKml~ModelCallback + * @callback exportKmlModelCallback * * @param {ModelGraphics} model The ModelGraphics instance for an Entity. * @param {JulianDate} time The time that any properties should use to get the value. diff --git a/Source/Renderer/AutomaticUniforms.js b/Source/Renderer/AutomaticUniforms.js index 89d5c436887f..e72cd6eddb2e 100644 --- a/Source/Renderer/AutomaticUniforms.js +++ b/Source/Renderer/AutomaticUniforms.js @@ -51,10 +51,6 @@ var AutomaticUniforms = { * and height properties in an vec4's x, y, z, * and w components, respectively. * - * @alias czm_viewport - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec4 czm_viewport; @@ -85,10 +81,6 @@ var AutomaticUniforms = { * The former transforms from normalized device coordinates to window coordinates; the later transforms * from window coordinates to clip coordinates, and is often used to assign to gl_Position. * - * @alias czm_viewportOrthographic - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewportOrthographic; @@ -124,10 +116,6 @@ var AutomaticUniforms = { * The former transforms from normalized device coordinates to window coordinates; the later transforms * from window coordinates to clip coordinates, and is often used to assign to gl_Position. * - * @alias czm_viewportTransformation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewportTransformation; @@ -157,12 +145,6 @@ var AutomaticUniforms = { * after the globe pass and then updated after the 3D Tiles pass. * The depth is packed into an RGBA texture. * - * @private - * - * @alias czm_globeDepthTexture - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_globeDepthTexture; @@ -183,10 +165,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 model transformation matrix that * transforms model coordinates to world coordinates. * - * @alias czm_model - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_model; @@ -211,10 +189,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 model transformation matrix that * transforms world coordinates to model coordinates. * - * @alias czm_inverseModel - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModel; @@ -238,10 +212,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 view transformation matrix that * transforms world coordinates to eye coordinates. * - * @alias czm_view - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_view; @@ -271,10 +241,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_view3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_view3D; @@ -297,10 +263,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 view rotation matrix that * transforms vectors in world coordinates to eye coordinates. * - * @alias czm_viewRotation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_viewRotation; @@ -328,10 +290,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_viewRotation3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_viewRotation3D; @@ -354,10 +312,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 transformation matrix that * transforms from eye coordinates to world coordinates. * - * @alias czm_inverseView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseView; @@ -384,10 +338,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseView3D; @@ -410,10 +360,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 rotation matrix that * transforms vectors from eye coordinates to world coordinates. * - * @alias czm_inverseViewRotation - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseViewRotation; @@ -441,10 +387,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseViewRotation3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseViewRotation3D; @@ -468,10 +410,6 @@ var AutomaticUniforms = { * transforms eye coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_projection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_projection; @@ -497,10 +435,6 @@ var AutomaticUniforms = { * transforms from clip coordinates to eye coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseProjection; @@ -526,10 +460,6 @@ var AutomaticUniforms = { * in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles * are not clipped by the far plane. * - * @alias czm_infiniteProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_infiniteProjection; @@ -556,10 +486,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using czm_modelView and * normals should be transformed using {@link czm_normal}. * - * @alias czm_modelView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelView; @@ -594,10 +520,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using czm_modelView3D and * normals should be transformed using {@link czm_normal3D}. * - * @alias czm_modelView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelView3D; @@ -624,10 +546,6 @@ var AutomaticUniforms = { * transforms model coordinates, relative to the eye, to eye coordinates. This is used * in conjunction with {@link czm_translateRelativeToEye}. * - * @alias czm_modelViewRelativeToEye - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewRelativeToEye; @@ -658,10 +576,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 4x4 transformation matrix that * transforms from eye coordinates to model coordinates. * - * @alias czm_inverseModelView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelView; @@ -687,10 +601,6 @@ var AutomaticUniforms = { * as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseModelView3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelView3D; @@ -715,10 +625,6 @@ var AutomaticUniforms = { * transforms world coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_viewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_viewProjection; @@ -748,10 +654,6 @@ var AutomaticUniforms = { * transforms clip coordinates to world coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseViewProjection; @@ -775,10 +677,6 @@ var AutomaticUniforms = { * transforms model coordinates to clip coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_modelViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewProjection; @@ -811,10 +709,6 @@ var AutomaticUniforms = { * transforms clip coordinates to model coordinates. Clip coordinates is the * coordinate system for a vertex shader's gl_Position output. * - * @alias czm_inverseModelViewProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_inverseModelViewProjection; @@ -839,10 +733,6 @@ var AutomaticUniforms = { * coordinate system for a vertex shader's gl_Position output. This is used in * conjunction with {@link czm_translateRelativeToEye}. * - * @alias czm_modelViewProjectionRelativeToEye - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewProjectionRelativeToEye; @@ -876,10 +766,6 @@ var AutomaticUniforms = { * the far plane at infinity. This is useful in algorithms like shadow volumes and GPU ray casting with * proxy geometry to ensure that triangles are not clipped by the far plane. * - * @alias czm_modelViewInfiniteProjection - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat4 czm_modelViewInfiniteProjection; @@ -907,9 +793,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that indicates if the current camera is orthographic in 3D. * - * @alias czm_orthographicIn3D - * @namespace - * @glslUniform * @see UniformState#orthographicIn3D */ czm_orthographicIn3D: new AutomaticUniform({ @@ -927,10 +810,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using {@link czm_modelView} and * normals should be transformed using czm_normal. * - * @alias czm_normal - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_normal; @@ -961,10 +840,6 @@ var AutomaticUniforms = { * Positions should be transformed to eye coordinates using {@link czm_modelView3D} and * normals should be transformed using czm_normal3D. * - * @alias czm_normal3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_normal3D; @@ -988,10 +863,6 @@ var AutomaticUniforms = { * transforms normal vectors in eye coordinates to model coordinates. This is * the opposite of the transform provided by {@link czm_normal}. * - * @alias czm_inverseNormal - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseNormal; @@ -1021,10 +892,6 @@ var AutomaticUniforms = { * matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting * 2D and Columbus View in the same way that 3D is lit. * - * @alias czm_inverseNormal3D - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_inverseNormal3D; @@ -1047,10 +914,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform containing the height in meters of the * eye (camera) above or below the ellipsoid. * - * @alias czm_eyeHeight - * @namespace - * @glslUniform - * * @see UniformState#eyeHeight */ czm_eyeHeight: new AutomaticUniform({ @@ -1066,10 +929,6 @@ var AutomaticUniforms = { * in meters of the eye (camera) above the 2D world plane. This uniform is only valid * when the {@link SceneMode} is SCENE2D. * - * @alias czm_eyeHeight2D - * @namespace - * @glslUniform - * * @see UniformState#eyeHeight2D */ czm_eyeHeight2D: new AutomaticUniform({ @@ -1085,10 +944,6 @@ var AutomaticUniforms = { * of the frustum defined by the camera. This is the largest possible frustum, not an individual * frustum used for multi-frustum rendering. * - * @alias czm_entireFrustum - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_entireFrustum; @@ -1112,10 +967,6 @@ var AutomaticUniforms = { * of the frustum defined by the camera. This is the individual * frustum used for multi-frustum rendering. * - * @alias czm_currentFrustum - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_currentFrustum; @@ -1137,10 +988,6 @@ var AutomaticUniforms = { /** * The distances to the frustum planes. The top, bottom, left and right distances are * the x, y, z, and w components, respectively. - * - * @alias czm_frustumPlanes - * @namespace - * @glslUniform */ czm_frustumPlanes: new AutomaticUniform({ size: 1, @@ -1152,10 +999,6 @@ var AutomaticUniforms = { /** * Gets the far plane's distance from the near plane, plus 1.0. - * - * @alias czm_farDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_farDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1167,10 +1010,6 @@ var AutomaticUniforms = { /** * Gets the log2 of {@link AutomaticUniforms#czm_farDepthFromNearPlusOne}. - * - * @alias czm_oneOverLog2FarDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_log2FarDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1182,10 +1021,6 @@ var AutomaticUniforms = { /** * Gets 1.0 divided by {@link AutomaticUniforms#czm_log2FarDepthFromNearPlusOne}. - * - * @alias czm_oneOverLog2FarDepthFromNearPlusOne - * @namespace - * @glslUniform */ czm_oneOverLog2FarDepthFromNearPlusOne: new AutomaticUniform({ size: 1, @@ -1198,10 +1033,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the sun position in world coordinates. * - * @alias czm_sunPositionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunPositionWC; @@ -1221,10 +1052,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the sun position in Columbus view world coordinates. * - * @alias czm_sunPositionColumbusView - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunPositionColumbusView; @@ -1243,10 +1070,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the sun in eye coordinates. * - * @alias czm_sunDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunDirectionEC; @@ -1269,10 +1092,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the sun in world coordinates. * - * @alias czm_sunDirectionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_sunDirectionWC; @@ -1295,10 +1114,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the normalized direction to the moon in eye coordinates. * - * @alias czm_moonDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_moonDirectionEC; @@ -1321,10 +1136,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the normalized direction to the scene's light source in eye coordinates. * This is commonly used for directional lighting computations. * - * @alias czm_lightDirectionEC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightDirectionEC; @@ -1347,10 +1158,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the normalized direction to the scene's light source in world coordinates. * This is commonly used for directional lighting computations. * - * @alias czm_lightDirectionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightDirectionWC; @@ -1374,10 +1181,6 @@ var AutomaticUniforms = { * is equivalent to the light color multiplied by the light intensity limited to a maximum luminance of 1.0 * suitable for non-HDR lighting. * - * @alias czm_lightColor - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightColor; @@ -1400,10 +1203,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform that represents the high dynamic range color of light emitted by the scene's light * source. This is equivalent to the light color multiplied by the light intensity suitable for HDR lighting. * - * @alias czm_lightColorHdr - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_lightColorHdr; @@ -1427,10 +1226,6 @@ var AutomaticUniforms = { * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. * - * @alias czm_encodedCameraPositionMCHigh - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_encodedCameraPositionMCHigh; @@ -1452,10 +1247,6 @@ var AutomaticUniforms = { * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering * as described in {@linkhttp://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. * - * @alias czm_encodedCameraPositionMCLow - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_encodedCameraPositionMCLow; @@ -1475,10 +1266,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the position of the viewer (camera) in world coordinates. * - * @alias czm_viewerPositionWC - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3 czm_viewerPositionWC; @@ -1498,10 +1285,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the frame number. This uniform is automatically incremented * every frame. * - * @alias czm_frameNumber - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_frameNumber; @@ -1518,10 +1301,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the current morph transition time between * 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D. * - * @alias czm_morphTime - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_morphTime; @@ -1541,10 +1320,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the current {@link SceneMode}, expressed * as a float. * - * @alias czm_sceneMode - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_sceneMode; @@ -1571,10 +1346,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the current rendering pass. * - * @alias czm_pass - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_pass; @@ -1596,10 +1367,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the current scene background color. * - * @alias czm_backgroundColor - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec4 czm_backgroundColor; @@ -1626,10 +1393,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the BRDF look up texture used for image-based lighting computations. * - * @alias czm_brdfLut - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_brdfLut; @@ -1650,10 +1413,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the environment map used within the scene. * - * @alias czm_environmentMap - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform samplerCube czm_environmentMap; @@ -1673,10 +1432,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMaps - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform sampler2D czm_specularEnvironmentMaps; @@ -1692,10 +1447,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the size of the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMapSize - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec2 czm_specularEnvironmentMapSize; @@ -1711,10 +1462,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the maximum level-of-detail of the specular environment map atlas used within the scene. * - * @alias czm_specularEnvironmentMapsMaximumLOD - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_specularEnvironmentMapsMaximumLOD; @@ -1730,10 +1477,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform containing the spherical harmonic coefficients used within the scene. * - * @alias czm_sphericalHarmonicCoefficients - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform vec3[9] czm_sphericalHarmonicCoefficients; @@ -1750,10 +1493,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing a 3x3 rotation matrix that transforms * from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at the current scene time. * - * @alias czm_temeToPseudoFixed - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform mat3 czm_temeToPseudoFixed; @@ -1775,10 +1514,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform representing the ratio of canvas coordinate space to canvas pixel space. * - * @alias czm_pixelRatio - * @namespace - * @glslUniform - * * @example * uniform float czm_pixelRatio; */ @@ -1793,10 +1528,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform scalar used to mix a color with the fog color based on the distance to the camera. * - * @alias czm_fogDensity - * @namespace - * @glslUniform - * * @see czm_fog */ czm_fogDensity: new AutomaticUniform({ @@ -1811,10 +1542,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the splitter position to use when rendering imagery layers with a splitter. * This will be in pixel coordinates relative to the canvas. * - * @alias czm_imagerySplitPosition - * @namespace - * @glslUniform - * * @example * // GLSL declaration * uniform float czm_imagerySplitPosition; @@ -1829,10 +1556,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform scalar representing the geometric tolerance per meter - * - * @alias czm_geometricToleranceOverMeter - * @namespace - * @glslUniform */ czm_geometricToleranceOverMeter: new AutomaticUniform({ size: 1, @@ -1846,10 +1569,6 @@ var AutomaticUniforms = { * An automatic GLSL uniform representing the distance from the camera at which to disable the depth test of billboards, labels and points * to, for example, prevent clipping against terrain. When set to zero, the depth test should always be applied. When less than zero, * the depth test should never be applied. - * - * @alias czm_minimumDisableDepthTestDistance - * @namespace - * @glslUniform */ czm_minimumDisableDepthTestDistance: new AutomaticUniform({ size: 1, @@ -1861,10 +1580,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that will be the highlight color of unclassified 3D Tiles. - * - * @alias czm_invertClassificationColor - * @namespace - * @glslUniform */ czm_invertClassificationColor: new AutomaticUniform({ size: 1, @@ -1876,9 +1591,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that is used for gamma correction. - * - * @alias czm_gamma - * @glslUniform */ czm_gamma: new AutomaticUniform({ size: 1, @@ -1890,9 +1602,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that stores the ellipsoid radii. - * - * @alias czm_ellipsoidRadii - * @glslUniform */ czm_ellipsoidRadii: new AutomaticUniform({ size: 1, @@ -1904,9 +1613,6 @@ var AutomaticUniforms = { /** * An automatic GLSL uniform that stores the ellipsoid inverse radii. - * - * @alias czm_ellipsoidRadii - * @glslUniform */ czm_ellipsoidInverseRadii: new AutomaticUniform({ size: 1, diff --git a/Source/Renderer/PixelDatatype.js b/Source/Renderer/PixelDatatype.js index e7f17f8404cd..e9238e94f5a8 100644 --- a/Source/Renderer/PixelDatatype.js +++ b/Source/Renderer/PixelDatatype.js @@ -1,7 +1,10 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** - * @private + * The data type of a pixel. + * + * @enum {Number} + * @see PostProcessStage */ var PixelDatatype = { UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE, @@ -13,45 +16,55 @@ var PixelDatatype = { UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5, +}; - isPacked: function (pixelDatatype) { - return ( - pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 - ); - }, +/** + @private +*/ +PixelDatatype.isPacked = function (pixelDatatype) { + return ( + pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 + ); +}; - sizeInBytes: function (pixelDatatype) { - switch (pixelDatatype) { - case PixelDatatype.UNSIGNED_BYTE: - return 1; - case PixelDatatype.UNSIGNED_SHORT: - case PixelDatatype.UNSIGNED_SHORT_4_4_4_4: - case PixelDatatype.UNSIGNED_SHORT_5_5_5_1: - case PixelDatatype.UNSIGNED_SHORT_5_6_5: - case PixelDatatype.HALF_FLOAT: - return 2; - case PixelDatatype.UNSIGNED_INT: - case PixelDatatype.FLOAT: - case PixelDatatype.UNSIGNED_INT_24_8: - return 4; - } - }, +/** + @private +*/ +PixelDatatype.sizeInBytes = function (pixelDatatype) { + switch (pixelDatatype) { + case PixelDatatype.UNSIGNED_BYTE: + return 1; + case PixelDatatype.UNSIGNED_SHORT: + case PixelDatatype.UNSIGNED_SHORT_4_4_4_4: + case PixelDatatype.UNSIGNED_SHORT_5_5_5_1: + case PixelDatatype.UNSIGNED_SHORT_5_6_5: + case PixelDatatype.HALF_FLOAT: + return 2; + case PixelDatatype.UNSIGNED_INT: + case PixelDatatype.FLOAT: + case PixelDatatype.UNSIGNED_INT_24_8: + return 4; + } +}; - validate: function (pixelDatatype) { - return ( - pixelDatatype === PixelDatatype.UNSIGNED_BYTE || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT || - pixelDatatype === PixelDatatype.UNSIGNED_INT || - pixelDatatype === PixelDatatype.FLOAT || - pixelDatatype === PixelDatatype.HALF_FLOAT || - pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || - pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 - ); - }, +/** + @private +*/ +PixelDatatype.validate = function (pixelDatatype) { + return ( + pixelDatatype === PixelDatatype.UNSIGNED_BYTE || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT || + pixelDatatype === PixelDatatype.UNSIGNED_INT || + pixelDatatype === PixelDatatype.FLOAT || + pixelDatatype === PixelDatatype.HALF_FLOAT || + pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || + pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5 + ); }; + export default Object.freeze(PixelDatatype); diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js index d4d117da35e1..3ccdad327c82 100644 --- a/Source/Renderer/Texture.js +++ b/Source/Renderer/Texture.js @@ -633,10 +633,10 @@ Object.defineProperties(Texture.prototype, { }); /** - * Copy new image data into this texture, from a source {@link ImageData}, {@link Image}, {@link Canvas}, or {@link Video}. + * Copy new image data into this texture, from a source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}. * or an object with width, height, and arrayBufferView properties. * - * @param {Object} source The source {@link ImageData}, {@link Image}, {@link Canvas}, or {@link Video}, + * @param {Object} source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}, * or an object with width, height, and arrayBufferView properties. * @param {Number} [xOffset=0] The offset in the x direction within the texture to copy into. * @param {Number} [yOffset=0] The offset in the y direction within the texture to copy into. diff --git a/Source/Renderer/TextureMagnificationFilter.js b/Source/Renderer/TextureMagnificationFilter.js index 5103252b72ba..cc1b5a05a821 100644 --- a/Source/Renderer/TextureMagnificationFilter.js +++ b/Source/Renderer/TextureMagnificationFilter.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Enumerates all possible filters used when magnifying WebGL textures. * - * @exports TextureMagnificationFilter + * @enum {Number} * * @see TextureMinificationFilter */ @@ -22,20 +22,20 @@ var TextureMagnificationFilter = { * @constant */ LINEAR: WebGLConstants.LINEAR, +}; - /** - * Validates the given textureMinificationFilter with respect to the possible enum values. - * - * @private - * - * @param textureMagnificationFilter - * @returns {Boolean} true if textureMagnificationFilter is valid. - */ - validate: function (textureMagnificationFilter) { - return ( - textureMagnificationFilter === TextureMagnificationFilter.NEAREST || - textureMagnificationFilter === TextureMagnificationFilter.LINEAR - ); - }, +/** + * Validates the given textureMinificationFilter with respect to the possible enum values. + * @param textureMagnificationFilter + * @returns {Boolean} true if textureMagnificationFilter is valid. + * + * @private + */ +TextureMagnificationFilter.validate = function (textureMagnificationFilter) { + return ( + textureMagnificationFilter === TextureMagnificationFilter.NEAREST || + textureMagnificationFilter === TextureMagnificationFilter.LINEAR + ); }; + export default Object.freeze(TextureMagnificationFilter); diff --git a/Source/Renderer/TextureMinificationFilter.js b/Source/Renderer/TextureMinificationFilter.js index 2eb8929bd8f0..a7cc13fb2bde 100644 --- a/Source/Renderer/TextureMinificationFilter.js +++ b/Source/Renderer/TextureMinificationFilter.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Enumerates all possible filters used when minifying WebGL textures. * - * @exports TextureMinificationFilter + * @enum {Number} * * @see TextureMagnificationFilter */ @@ -67,28 +67,28 @@ var TextureMinificationFilter = { * @constant */ LINEAR_MIPMAP_LINEAR: WebGLConstants.LINEAR_MIPMAP_LINEAR, +}; - /** - * Validates the given textureMinificationFilter with respect to the possible enum values. - * - * @private - * - * @param textureMinificationFilter - * @returns {Boolean} true if textureMinificationFilter is valid. - */ - validate: function (textureMinificationFilter) { - return ( - textureMinificationFilter === TextureMinificationFilter.NEAREST || - textureMinificationFilter === TextureMinificationFilter.LINEAR || - textureMinificationFilter === - TextureMinificationFilter.NEAREST_MIPMAP_NEAREST || - textureMinificationFilter === - TextureMinificationFilter.LINEAR_MIPMAP_NEAREST || - textureMinificationFilter === - TextureMinificationFilter.NEAREST_MIPMAP_LINEAR || - textureMinificationFilter === - TextureMinificationFilter.LINEAR_MIPMAP_LINEAR - ); - }, +/** + * Validates the given textureMinificationFilter with respect to the possible enum values. + * + * @private + * + * @param textureMinificationFilter + * @returns {Boolean} true if textureMinificationFilter is valid. + */ +TextureMinificationFilter.validate = function (textureMinificationFilter) { + return ( + textureMinificationFilter === TextureMinificationFilter.NEAREST || + textureMinificationFilter === TextureMinificationFilter.LINEAR || + textureMinificationFilter === + TextureMinificationFilter.NEAREST_MIPMAP_NEAREST || + textureMinificationFilter === + TextureMinificationFilter.LINEAR_MIPMAP_NEAREST || + textureMinificationFilter === + TextureMinificationFilter.NEAREST_MIPMAP_LINEAR || + textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR + ); }; + export default Object.freeze(TextureMinificationFilter); diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index 733cf886ca97..7fc58612aec0 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -867,7 +867,7 @@ Object.defineProperties(UniformState.prototype, { /** * A scalar that represents the geometric tolerance per meter - * @memberof UniformStat.prototype + * @memberof UniformState.prototype * @type {Number} */ geometricToleranceOverMeter: { diff --git a/Source/Renderer/loadCubeMap.js b/Source/Renderer/loadCubeMap.js index 70a30f5807bf..449f169a9853 100644 --- a/Source/Renderer/loadCubeMap.js +++ b/Source/Renderer/loadCubeMap.js @@ -9,7 +9,7 @@ import CubeMap from "./CubeMap.js"; * Asynchronously loads six images and creates a cube map. Returns a promise that * will resolve to a {@link CubeMap} once loaded, or reject if any image fails to load. * - * @exports loadCubeMap + * @function loadCubeMap * * @param {Context} context The context to use to create the cube map. * @param {Object} urls The source URL of each image. See the example below. diff --git a/Source/Scene/Appearance.js b/Source/Scene/Appearance.js index 26e507a2308b..88547f5a0b15 100644 --- a/Source/Scene/Appearance.js +++ b/Source/Scene/Appearance.js @@ -19,7 +19,7 @@ import CullFace from "./CullFace.js"; * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see MaterialAppearance * @see EllipsoidSurfaceAppearance diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 73e8f4d2523f..0107a47a9941 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -394,7 +394,7 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ArcGisMapServerImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -677,7 +677,7 @@ ArcGisMapServerImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/AttributeType.js b/Source/Scene/AttributeType.js index 23c0772204d2..36c7cae8848f 100644 --- a/Source/Scene/AttributeType.js +++ b/Source/Scene/AttributeType.js @@ -1,7 +1,7 @@ /** * An enum describing the attribute type for glTF and 3D Tiles. * - * @exports AttributeType + * @enum {String} * * @private */ diff --git a/Source/Scene/Axis.js b/Source/Scene/Axis.js index 160e3fbe0ee2..fb38e6e98332 100644 --- a/Source/Scene/Axis.js +++ b/Source/Scene/Axis.js @@ -6,7 +6,7 @@ import Matrix4 from "../Core/Matrix4.js"; /** * An enum describing the x, y, and z axes and helper conversion functions. * - * @exports Axis + * @enum {Number} * @private */ var Axis = { diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js index a6b130ff334a..bd1b86df97d7 100644 --- a/Source/Scene/BatchTable.js +++ b/Source/Scene/BatchTable.js @@ -426,7 +426,7 @@ BatchTable.prototype.update = function (frameState) { /** * Gets a function that will update a uniform map to contain values for looking up values in the batch table. * - * @returns {BatchTable~updateUniformMapCallback} A callback for updating uniform maps. + * @returns {BatchTable.updateUniformMapCallback} A callback for updating uniform maps. */ BatchTable.prototype.getUniformMapCallback = function () { var that = this; @@ -569,7 +569,7 @@ function getGlslAttributeFunction(batchTable, attributeIndex) { /** * Gets a function that will update a vertex shader to contain functions for looking up values in the batch table. * - * @returns {BatchTable~updateVertexShaderSourceCallback} A callback for updating a vertex shader source. + * @returns {BatchTable.updateVertexShaderSourceCallback} A callback for updating a vertex shader source. */ BatchTable.prototype.getVertexShaderCallback = function () { var attributes = this._attributes; @@ -628,7 +628,7 @@ BatchTable.prototype.destroy = function () { /** * A callback for updating uniform maps. - * @callback BatchTable~updateUniformMapCallback + * @callback BatchTable.updateUniformMapCallback * * @param {Object} uniformMap The uniform map. * @returns {Object} The new uniform map with properties for retrieving values from the batch table. @@ -636,7 +636,7 @@ BatchTable.prototype.destroy = function () { /** * A callback for updating a vertex shader source. - * @callback BatchTable~updateVertexShaderSourceCallback + * @callback BatchTable.updateVertexShaderSourceCallback * * @param {String} vertexShaderSource The vertex shader source. * @returns {String} The new vertex shader source with the functions for retrieving batch table values injected. diff --git a/Source/Scene/Billboard.js b/Source/Scene/Billboard.js index ceb2a7e65769..38ed91290f7d 100644 --- a/Source/Scene/Billboard.js +++ b/Source/Scene/Billboard.js @@ -1192,7 +1192,7 @@ Billboard.prototype._loadImage = function () { *

* * @param {String} id The id of the image. This can be any string that uniquely identifies the image. - * @param {Image|Canvas|String|Resource|Billboard~CreateImageCallback} image The image to load. This parameter + * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Billboard.CreateImageCallback} image The image to load. This parameter * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, * or a function which will be called to create the image if it hasn't been loaded already. * @example @@ -1528,8 +1528,8 @@ Billboard.prototype._destroy = function () { /** * A function that creates an image. - * @callback Billboard~CreateImageCallback + * @callback Billboard.CreateImageCallback * @param {String} id The identifier of the image to load. - * @returns {Image|Canvas|Promise} The image, or a promise that will resolve to an image. + * @returns {HTMLImageElement|HTMLCanvasElement|Promise} The image, or a promise that will resolve to an image. */ export default Billboard; diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index fff7897960b6..716828a97034 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -246,7 +246,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof BingMapsImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -550,7 +550,7 @@ BingMapsImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index de1f0b35bccf..0923588f2dd6 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -1,7 +1,7 @@ /** * The types of imagery provided by Bing Maps. * - * @exports BingMapsStyle + * @enum {Number} * * @see BingMapsImageryProvider */ diff --git a/Source/Scene/BlendEquation.js b/Source/Scene/BlendEquation.js index 1d70ebaa957a..d2f49cbe4d8f 100644 --- a/Source/Scene/BlendEquation.js +++ b/Source/Scene/BlendEquation.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines how two pixels' values are combined. * - * @exports BlendEquation + * @enum {Number} */ var BlendEquation = { /** diff --git a/Source/Scene/BlendFunction.js b/Source/Scene/BlendFunction.js index 0b1d91d5847f..f0232d2ebb75 100644 --- a/Source/Scene/BlendFunction.js +++ b/Source/Scene/BlendFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines how blending factors are computed. * - * @exports BlendFunction + * @enum {Number} */ var BlendFunction = { /** diff --git a/Source/Scene/BlendOption.js b/Source/Scene/BlendOption.js index 0dc6e060a5c3..0af43ae1d41e 100644 --- a/Source/Scene/BlendOption.js +++ b/Source/Scene/BlendOption.js @@ -1,7 +1,7 @@ /** * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. * - * @exports BlendOption + * @enum {Number} */ var BlendOption = { /** diff --git a/Source/Scene/BlendingState.js b/Source/Scene/BlendingState.js index f697e0a9c8bd..f01f1f68180f 100644 --- a/Source/Scene/BlendingState.js +++ b/Source/Scene/BlendingState.js @@ -9,7 +9,7 @@ import BlendFunction from "./BlendFunction.js"; * This is a helper when using custom render states with {@link Appearance#renderState}. *

* - * @exports BlendingState + * @namespace */ var BlendingState = { /** diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index cbfedd8b73c8..167e2631b10e 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -137,7 +137,7 @@ function Camera(scene) { /** * The region of space in view. * - * @type {Frustum} + * @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum} * @default PerspectiveFrustum() * * @see PerspectiveFrustum @@ -3191,15 +3191,15 @@ Camera.prototype.cancelFlight = function () { * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. - * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. - * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true. - * @param {EasingFunction|EasingFunction~Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. + * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. * * @exception {DeveloperError} If either direction or up is given, then both are required. * @@ -3459,14 +3459,14 @@ var scratchFlyToBoundingSphereMatrix3 = new Matrix3(); * @param {Object} [options] Object with the following properties: * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target. - * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. - * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. - * @param {EasingFunction|EasingFunction~Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. + * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight. */ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { //>>includeStart('debug', pragmas.debug); @@ -3852,11 +3852,11 @@ Camera.clone = function (camera, result) { /** * A function that will execute when a flight completes. - * @callback Camera~FlightCompleteCallback + * @callback Camera.FlightCompleteCallback */ /** * A function that will execute when a flight is cancelled. - * @callback Camera~FlightCancelledCallback + * @callback Camera.FlightCancelledCallback */ export default Camera; diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js index cdaaa41bc083..364ffaa4f41f 100644 --- a/Source/Scene/CameraEventAggregator.js +++ b/Source/Scene/CameraEventAggregator.js @@ -296,7 +296,7 @@ function listenMouseMove(aggregator, modifier) { * @alias CameraEventAggregator * @constructor * - * @param {Canvas} [canvas=document] The element to handle events for. + * @param {HTMLCanvasElement} [canvas=document] The element to handle events for. * * @see ScreenSpaceEventHandler */ diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index 29e652544818..ec6ab41afed7 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -1,7 +1,7 @@ /** * Enumerates the available input for interacting with the camera. * - * @exports CameraEventType + * @enum {Number} */ var CameraEventType = { /** diff --git a/Source/Scene/Cesium3DTileColorBlendMode.js b/Source/Scene/Cesium3DTileColorBlendMode.js index 02e4bde25e00..3f096aafebb4 100644 --- a/Source/Scene/Cesium3DTileColorBlendMode.js +++ b/Source/Scene/Cesium3DTileColorBlendMode.js @@ -22,7 +22,7 @@ * } * * - * @exports Cesium3DTileColorBlendMode + * @enum {Number} */ var Cesium3DTileColorBlendMode = { /** diff --git a/Source/Scene/Cesium3DTileOptimizationHint.js b/Source/Scene/Cesium3DTileOptimizationHint.js index 9469838d0f91..0ee1d97145e8 100644 --- a/Source/Scene/Cesium3DTileOptimizationHint.js +++ b/Source/Scene/Cesium3DTileOptimizationHint.js @@ -1,7 +1,7 @@ /** * Hint defining optimization support for a 3D tile * - * @exports Cesium3DTileOptimizationHint + * @enum {Number} * * @private */ diff --git a/Source/Scene/Cesium3DTileOptimizations.js b/Source/Scene/Cesium3DTileOptimizations.js index 9117b6e931cb..98a288f6ffa6 100644 --- a/Source/Scene/Cesium3DTileOptimizations.js +++ b/Source/Scene/Cesium3DTileOptimizations.js @@ -7,7 +7,7 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js"; /** * Utility functions for computing optimization hints for a {@link Cesium3DTileset}. * - * @exports Cesium3DTileOptimizations + * @namespace Cesium3DTileOptimizations * * @private */ diff --git a/Source/Scene/Cesium3DTileRefine.js b/Source/Scene/Cesium3DTileRefine.js index c142ff7187d5..ade192c1ee03 100644 --- a/Source/Scene/Cesium3DTileRefine.js +++ b/Source/Scene/Cesium3DTileRefine.js @@ -5,7 +5,7 @@ * in the 3D Tiles spec. *

* - * @exports Cesium3DTileRefine + * @enum {Number} * * @private */ diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 89370d7d43a4..305679733d89 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -72,7 +72,7 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js"; * @param {Boolean} [options.foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. * @param {Number} [options.foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect. * @param {Number} [options.foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. - * @param {Cesium3DTileset~foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} + * @param {Cesium3DTileset.foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} * @param {Number} [options.foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view. * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal. * @param {Number} [options.baseScreenSpaceError=1024] When skipLevelOfDetail is true, the screen space error that must be reached before skipping levels of detail. @@ -325,9 +325,10 @@ function Cesium3DTileset(options) { ); /** - * Gets a function that will update the foveated screen space error for a tile. + * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, + * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * - * @type {Cesium3DTileset~foveatedInterpolationCallback} A callback to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + * @type {Cesium3DTileset.foveatedInterpolationCallback} */ this.foveatedInterpolationCallback = defaultValue( options.foveatedInterpolationCallback, @@ -2219,7 +2220,7 @@ function updateTiles(tileset, frameState, passOptions) { tileset._backfaceCommands.trim(); if (bivariateVisibilityTest) { - /** + /* * Consider 'effective leaf' tiles as selected tiles that have no selected descendants. They may have children, * but they are currently our effective leaves because they do not have selected descendants. These tiles * are those where with tile._finalResolution === true. @@ -2618,7 +2619,7 @@ Cesium3DTileset.prototype.destroy = function () { * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * - * @callback Cesium3DTileset~foveatedInterpolationCallback + * @callback Cesium3DTileset.foveatedInterpolationCallback * @default Math.lerp * * @param {Number} p The start value to interpolate. diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js index 1989b2cd63c0..259ca16ec0b0 100644 --- a/Source/Scene/ClassificationType.js +++ b/Source/Scene/ClassificationType.js @@ -1,7 +1,7 @@ /** * Whether a classification affects terrain, 3D Tiles or both. * - * @exports ClassificationType + * @enum {Number} */ var ClassificationType = { /** @@ -25,9 +25,11 @@ var ClassificationType = { * @constant */ BOTH: 2, - /** - * @private - */ - NUMBER_OF_CLASSIFICATION_TYPES: 3, }; + +/** + * @private + */ +ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES = 3; + export default Object.freeze(ClassificationType); diff --git a/Source/Scene/ColorBlendMode.js b/Source/Scene/ColorBlendMode.js index 95dbfed023ff..696c101a2c83 100644 --- a/Source/Scene/ColorBlendMode.js +++ b/Source/Scene/ColorBlendMode.js @@ -7,7 +7,7 @@ import CesiumMath from "../Core/Math.js"; * REPLACE replaces the source color with the target color * MIX blends the source color and target color together * - * @exports ColorBlendMode + * @enum {Number} * * @see Model.colorBlendMode */ diff --git a/Source/Scene/CullFace.js b/Source/Scene/CullFace.js index 7be2cb95c7d6..ecd2676270f1 100644 --- a/Source/Scene/CullFace.js +++ b/Source/Scene/CullFace.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines which triangles, if any, are culled. * - * @exports CullFace + * @enum {Number} */ var CullFace = { /** diff --git a/Source/Scene/DebugAppearance.js b/Source/Scene/DebugAppearance.js index c321a41d0302..fc2c720d9a78 100644 --- a/Source/Scene/DebugAppearance.js +++ b/Source/Scene/DebugAppearance.js @@ -20,7 +20,7 @@ import Appearance from "./Appearance.js"; * @param {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are float, vec2, vec3, and vec4. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @exception {DeveloperError} options.glslDatatype must be float, vec2, vec3, or vec4. * diff --git a/Source/Scene/DepthFunction.js b/Source/Scene/DepthFunction.js index 75ca750a45cc..e84970b58ea7 100644 --- a/Source/Scene/DepthFunction.js +++ b/Source/Scene/DepthFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the function used to compare two depths for the depth test. * - * @exports DepthFunction + * @enum {Number} */ var DepthFunction = { /** diff --git a/Source/Scene/DiscardEmptyTileImagePolicy.js b/Source/Scene/DiscardEmptyTileImagePolicy.js index 40d4322ba9aa..90fb289b678f 100644 --- a/Source/Scene/DiscardEmptyTileImagePolicy.js +++ b/Source/Scene/DiscardEmptyTileImagePolicy.js @@ -23,7 +23,7 @@ DiscardEmptyTileImagePolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage = function (image) { @@ -35,7 +35,7 @@ var emptyImage; Object.defineProperties(DiscardEmptyTileImagePolicy, { /** * Default value for representing an empty image. - * @type {Image} + * @type {HTMLImageElement} * @readonly * @memberof DiscardEmptyTileImagePolicy */ diff --git a/Source/Scene/DiscardMissingTileImagePolicy.js b/Source/Scene/DiscardMissingTileImagePolicy.js index ce7ce5dd17ac..66b5110124dc 100644 --- a/Source/Scene/DiscardMissingTileImagePolicy.js +++ b/Source/Scene/DiscardMissingTileImagePolicy.js @@ -104,7 +104,7 @@ DiscardMissingTileImagePolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. * * @exception {DeveloperError} shouldDiscardImage must not be called before the discard policy is ready. diff --git a/Source/Scene/EllipsoidSurfaceAppearance.js b/Source/Scene/EllipsoidSurfaceAppearance.js index 84f6836af07b..1457e7115551 100644 --- a/Source/Scene/EllipsoidSurfaceAppearance.js +++ b/Source/Scene/EllipsoidSurfaceAppearance.js @@ -24,7 +24,7 @@ import Material from "./Material.js"; * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js index 44fcb7f51166..8c5e706a8bc5 100644 --- a/Source/Scene/FrameState.js +++ b/Source/Scene/FrameState.js @@ -177,40 +177,37 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.pixelRatio = 1.0; + /** + * @typedef FrameState.Passes + * @type {Object} + * @property {Boolean} render true if the primitive should update for a render pass, false otherwise. + * @property {Boolean} pick true if the primitive should update for a picking pass, false otherwise. + * @property {Boolean} depth true if the primitive should update for a depth only pass, false otherwise. + * @property {Boolean} postProcess true if the primitive should update for a per-feature post-process pass, false otherwise. + * @property {Boolean} offscreen true if the primitive should update for an offscreen pass, false otherwise. + */ + + /** + * @type {FrameState.Passes} + */ this.passes = { /** - * true if the primitive should update for a render pass, false otherwise. - * - * @type {Boolean} * @default false */ render: false, - /** - * true if the primitive should update for a picking pass, false otherwise. - * - * @type {Boolean} * @default false */ pick: false, - /** - * true if the primitive should update for a depth only pass, false otherwise. - * @type {Boolean} * @default false */ depth: false, - /** - * true if the primitive should update for a per-feature post-process pass, false otherwise. - * @type {Boolean} * @default false */ postProcess: false, - /** - * true if the primitive should update for an offscreen pass, false otherwise. - * @type {Boolean} * @default false */ offscreen: false, @@ -233,7 +230,7 @@ function FrameState(context, creditDisplay, jobScheduler) { * directly in update functions. *

* - * @type {FrameState~AfterRenderCallback[]} + * @type {FrameState.AfterRenderCallback[]} * * @example * frameState.afterRender.push(function() { @@ -250,33 +247,26 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.scene3DOnly = false; + /** + * @typedef FrameState.Fog + * @type {Object} + * @property {Boolean} enabled true if fog is enabled, false otherwise. + * @property {Number} density A positive number used to mix the color and fog color based on camera distance. + * @property {Number} sse A scalar used to modify the screen space error of geometry partially in fog. + * @property {Number} minimumBrightness The minimum brightness of terrain with fog applied. + */ + + /** + * @type {FrameState.Fog} + */ + this.fog = { /** - * true if fog is enabled, false otherwise. - * @type {Boolean} * @default false */ enabled: false, - /** - * A positive number used to mix the color and fog color based on camera distance. - * - * @type {Number} - * @default undefined - */ density: undefined, - /** - * A scalar used to modify the screen space error of geometry partially in fog. - * - * @type {Number} - * @default undefined - */ sse: undefined, - /** - * The minimum brightness of terrain with fog applied. - * - * @type {Number} - * @default undefined - */ minimumBrightness: undefined, }; @@ -287,57 +277,49 @@ function FrameState(context, creditDisplay, jobScheduler) { */ this.terrainExaggeration = 1.0; - this.shadowState = { - /** - * Whether there are any active shadow maps this frame. - * @type {Boolean} - */ - shadowsEnabled: true, + /** + * @typedef FrameState.ShadowState + * @type {Object} + * @property {Boolean} shadowsEnabled Whether there are any active shadow maps this frame. + * @property {Boolean} lightShadowsEnabled Whether there are any active shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. + * @property {ShadowMap[]} shadowMaps All shadow maps that are enabled this frame. + * @property {ShadowMap[]} lightShadowMaps Shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. Only these shadow maps will be used to generate receive shadows shaders. + * @property {Number} nearPlane The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps. + * @property {Number} farPlane The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps. + * @property {Number} closestObjectSize The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object. + * @property {Number} lastDirtyTime The time when a shadow map was last dirty + * @property {Boolean} outOfView Whether the shadows maps are out of view this frame + */ - /** - * Whether there are any active shadow maps that originate from light sources. Does not - * include shadow maps that are used for analytical purposes. - */ - lightShadowsEnabled: true, + /** + * @type {FrameState.ShadowState} + */ + this.shadowState = { /** - * All shadow maps that are enabled this frame. + * @default true */ + shadowsEnabled: true, shadowMaps: [], - - /** - * Shadow maps that originate from light sources. Does not include shadow maps that are used for - * analytical purposes. Only these shadow maps will be used to generate receive shadows shaders. - */ lightShadowMaps: [], - /** - * The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps. - * @type {Number} + * @default 1.0 */ nearPlane: 1.0, - /** - * The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps. - * @type {Number} + * @default 5000.0 */ farPlane: 5000.0, - /** - * The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object. - * @type {Number} + * @default 1000.0 */ closestObjectSize: 1000.0, - /** - * The time when a shadow map was last dirty - * @type {Number} + * @default 0 */ lastDirtyTime: 0, - /** - * Whether the shadows maps are out of view this frame - * @type {Boolean} + * @default true */ outOfView: true, }; @@ -420,6 +402,6 @@ function FrameState(context, creditDisplay, jobScheduler) { /** * A function that will be called at the end of the frame. * - * @callback FrameState~AfterRenderCallback + * @callback FrameState.AfterRenderCallback */ export default FrameState; diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index 6104a29af1b9..cabaaab557cc 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -16,6 +16,9 @@ import TileProviderError from "../Core/TileProviderError.js"; import protobuf from "../ThirdParty/protobuf-minimal.js"; import when from "../ThirdParty/when.js"; +/** + * @private + */ function GoogleEarthEnterpriseDiscardPolicy() { this._image = new Image(); } @@ -31,7 +34,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function ( @@ -182,7 +185,7 @@ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -451,7 +454,7 @@ GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index caed15af4bea..9e3bafde92a3 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -293,7 +293,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseMapsProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -598,7 +598,7 @@ GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index 7a89ae5379c1..c8c84ae6f3af 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -63,7 +63,7 @@ Object.defineProperties(GridImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GridImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -315,7 +315,7 @@ GridImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/GroundPolylinePrimitive.js b/Source/Scene/GroundPolylinePrimitive.js index 974db0d6bbf9..9364a560423d 100644 --- a/Source/Scene/GroundPolylinePrimitive.js +++ b/Source/Scene/GroundPolylinePrimitive.js @@ -334,7 +334,7 @@ Object.defineProperties(GroundPolylinePrimitive.prototype, { * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPolylinePrimitive synchronously. * - * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. + * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. */ GroundPolylinePrimitive.initializeTerrainHeights = function () { return ApproximateTerrainHeights.initialize(); diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index 5b7a1dfaf777..e07d256f54ab 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -685,7 +685,7 @@ function updateAndQueueCommands( * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the * GroundPrimitive synchronously. * - * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. + * @returns {Promise} A promise that will resolve once the terrain heights have been loaded. * */ GroundPrimitive.initializeTerrainHeights = function () { diff --git a/Source/Scene/HeightReference.js b/Source/Scene/HeightReference.js index 11788d5210b8..5fcd6f3ba874 100644 --- a/Source/Scene/HeightReference.js +++ b/Source/Scene/HeightReference.js @@ -1,7 +1,7 @@ /** * Represents the position relative to the terrain. * - * @exports HeightReference + * @enum {Number} */ var HeightReference = { /** diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js index f98f12188e8d..ab46bf910222 100644 --- a/Source/Scene/HorizontalOrigin.js +++ b/Source/Scene/HorizontalOrigin.js @@ -8,7 +8,7 @@ *
* * - * @exports HorizontalOrigin + * @enum {Number} * * @see Billboard#horizontalOrigin * @see Label#horizontalOrigin diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index 884a28d71ce2..0abe0a776a8f 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -233,7 +233,7 @@ Object.defineProperties(ImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -278,7 +278,7 @@ ImageryProvider.prototype.getTileCredits = * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. @@ -318,7 +318,7 @@ var crnRegex = /\.crn$/i; * * @param {ImageryProvider} imageryProvider The imagery provider for the URL. * @param {Resource|String} url The URL of the image. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/ImagerySplitDirection.js b/Source/Scene/ImagerySplitDirection.js index 84b6e4be79ce..0778b4021d01 100644 --- a/Source/Scene/ImagerySplitDirection.js +++ b/Source/Scene/ImagerySplitDirection.js @@ -1,7 +1,7 @@ /** * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}. * - * @exports ImagerySplitDirection + * @enum {Number} * * @see ImageryLayer#splitDirection */ diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index 806449949d30..0a636594c1a1 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -460,7 +460,7 @@ IonImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/IonWorldImageryStyle.js b/Source/Scene/IonWorldImageryStyle.js index cf7b325c15de..824de2cb4fdd 100644 --- a/Source/Scene/IonWorldImageryStyle.js +++ b/Source/Scene/IonWorldImageryStyle.js @@ -3,7 +3,7 @@ /** * The types of imagery provided by {@link createWorldImagery}. * - * @exports IonWorldImageryStyle + * @enum {Number} */ var IonWorldImageryStyle = { /** diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index 4412141dc9d7..10517de8aff3 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -1,7 +1,7 @@ /** * Describes how to draw a label. * - * @exports LabelStyle + * @enum {Number} * * @see Label#style */ diff --git a/Source/Scene/MapMode2D.js b/Source/Scene/MapMode2D.js index 3663f43a68db..7e1d8b538dce 100644 --- a/Source/Scene/MapMode2D.js +++ b/Source/Scene/MapMode2D.js @@ -1,7 +1,7 @@ /** * Describes how the map will operate in 2D. * - * @exports MapMode2D + * @enum {Number} */ var MapMode2D = { /** diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index e27c0e8eb83d..5013bc89e081 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -264,7 +264,7 @@ Object.defineProperties(MapboxImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -314,7 +314,7 @@ MapboxImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index a52b5972b4e3..83228c035351 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -276,7 +276,7 @@ Object.defineProperties(MapboxStyleImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxStyleImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -326,7 +326,7 @@ MapboxStyleImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/MaterialAppearance.js b/Source/Scene/MaterialAppearance.js index e5a69b513abc..e0770a047378 100644 --- a/Source/Scene/MaterialAppearance.js +++ b/Source/Scene/MaterialAppearance.js @@ -22,11 +22,11 @@ import Material from "./Material.js"; * @param {Boolean} [options.faceForward=!options.closed] When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. * @param {Boolean} [options.translucent=true] When true, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled. * @param {Boolean} [options.closed=false] When true, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled. - * @param {MaterialAppearance.MaterialSupport} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported. + * @param {MaterialAppearance.MaterialSupportType} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported. * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Material Appearance Demo} @@ -177,7 +177,7 @@ Object.defineProperties(MaterialAppearance.prototype, { * * @memberof MaterialAppearance.prototype * - * @type {MaterialAppearance.MaterialSupport} + * @type {MaterialAppearance.MaterialSupportType} * @readonly * * @default {@link MaterialAppearance.MaterialSupport.TEXTURED} @@ -276,18 +276,27 @@ MaterialAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent; MaterialAppearance.prototype.getRenderState = Appearance.prototype.getRenderState; +/** + * @typedef MaterialAppearance.MaterialSupportType + * @type {Object} + * @property {VertexFormat} vertexFormat + * @property {String} vertexShaderSource + * @property {String} fragmentShaderSource + */ + /** * Determines the type of {@link Material} that is supported by a * {@link MaterialAppearance} instance. This is a trade-off between * flexibility (a wide array of materials) and memory/performance * (required vertex format and GLSL shader complexity. - * @exports MaterialAppearance.MaterialSupport + * @namespace */ MaterialAppearance.MaterialSupport = { /** * Only basic materials, which require just position and * normal vertex attributes, are supported. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ BASIC: Object.freeze({ @@ -300,6 +309,7 @@ MaterialAppearance.MaterialSupport = { * normal, and st vertex attributes, * are supported. The vast majority of materials fall into this category. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ TEXTURED: Object.freeze({ @@ -312,6 +322,7 @@ MaterialAppearance.MaterialSupport = { * This requires position, normal, st, * tangent, and bitangent vertex attributes. * + * @type {MaterialAppearance.MaterialSupportType} * @constant */ ALL: Object.freeze({ diff --git a/Source/Scene/ModelAnimationLoop.js b/Source/Scene/ModelAnimationLoop.js index cda8146ea601..3cb0a59948e9 100644 --- a/Source/Scene/ModelAnimationLoop.js +++ b/Source/Scene/ModelAnimationLoop.js @@ -1,7 +1,7 @@ /** * Determines if and how a glTF animation is looped. * - * @exports ModelAnimationLoop + * @enum {Number} * * @see ModelAnimationCollection#add */ diff --git a/Source/Scene/NeverTileDiscardPolicy.js b/Source/Scene/NeverTileDiscardPolicy.js index 3bccb7882442..77b6035d8435 100644 --- a/Source/Scene/NeverTileDiscardPolicy.js +++ b/Source/Scene/NeverTileDiscardPolicy.js @@ -19,7 +19,7 @@ NeverTileDiscardPolicy.prototype.isReady = function () { /** * Given a tile image, decide whether to discard that image. * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ NeverTileDiscardPolicy.prototype.shouldDiscardImage = function (image) { diff --git a/Source/Scene/OctahedralProjectedCubeMap.js b/Source/Scene/OctahedralProjectedCubeMap.js index 1a3f753e7b32..1de61027cc73 100644 --- a/Source/Scene/OctahedralProjectedCubeMap.js +++ b/Source/Scene/OctahedralProjectedCubeMap.js @@ -93,7 +93,7 @@ Object.defineProperties(OctahedralProjectedCubeMap.prototype, { /** * Gets a promise that resolves when the texture atlas is ready to use. * @memberof OctahedralProjectedCubeMap.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/ParticleSystem.js b/Source/Scene/ParticleSystem.js index d18aff1c3a19..5169caa227f6 100644 --- a/Source/Scene/ParticleSystem.js +++ b/Source/Scene/ParticleSystem.js @@ -23,7 +23,7 @@ var defaultImageSize = new Cartesian2(1.0, 1.0); * * @param {Object} [options] Object with the following properties: * @param {Boolean} [options.show=true] Whether to display the particle system. - * @param {ParticleSystem~updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle. + * @param {ParticleSystem.updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle. * @param {ParticleEmitter} [options.emitter=new CircleEmitter(0.5)] The particle emitter for this system. * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system from model to world coordinates. * @param {Matrix4} [options.emitterModelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. @@ -67,7 +67,7 @@ function ParticleSystem(options) { /** * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time - * @type {ParticleSystem~updateCallback} + * @type {ParticleSystem.updateCallback} * @default undefined */ this.updateCallback = options.updateCallback; @@ -894,7 +894,7 @@ ParticleSystem.prototype.destroy = function () { * A function used to modify attributes of the particle at each time step. This can include force modifications, * color, sizing, etc. * - * @callback ParticleSystem~updateCallback + * @callback ParticleSystem.updateCallback * * @param {Particle} particle The particle being updated. * @param {Number} dt The time in seconds since the last update. diff --git a/Source/Scene/PerInstanceColorAppearance.js b/Source/Scene/PerInstanceColorAppearance.js index bcc1d7eb9f45..79fc05bceea8 100644 --- a/Source/Scene/PerInstanceColorAppearance.js +++ b/Source/Scene/PerInstanceColorAppearance.js @@ -21,7 +21,7 @@ import Appearance from "./Appearance.js"; * @param {Boolean} [options.closed=false] When true, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @example * // A solid white line segment diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 56b88ac1ffeb..50ec733be009 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -40,10 +40,6 @@ function PointCloud3DTileContent( this._batchTable = undefined; // Used when feature table contains BATCH_ID semantic this._styleDirty = false; this._features = undefined; - - /** - * @inheritdoc Cesium3DTileContent#featurePropertiesDirty - */ this.featurePropertiesDirty = false; this._pointCloud = new PointCloud({ diff --git a/Source/Scene/Polyline.js b/Source/Scene/Polyline.js index e37a0323b6be..bbc4a6d1d82a 100644 --- a/Source/Scene/Polyline.js +++ b/Source/Scene/Polyline.js @@ -17,7 +17,7 @@ import Material from "./Material.js"; * @internalConstructor * @class * - * @param {Object} [options] Object with the following properties: + * @param {Object} options Object with the following properties: * @param {Boolean} [options.show=true] true if this polyline will be shown; otherwise, false. * @param {Number} [options.width=1.0] The width of the polyline in pixels. * @param {Boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop. diff --git a/Source/Scene/PolylineColorAppearance.js b/Source/Scene/PolylineColorAppearance.js index aaf4c4b8ed41..f5055d3b469c 100644 --- a/Source/Scene/PolylineColorAppearance.js +++ b/Source/Scene/PolylineColorAppearance.js @@ -28,7 +28,7 @@ if (!FeatureDetection.isInternetExplorer()) { * @param {Boolean} [options.translucent=true] When true, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @example * // A solid white line segment diff --git a/Source/Scene/PolylineMaterialAppearance.js b/Source/Scene/PolylineMaterialAppearance.js index ca2afd643a56..da555d65deb7 100644 --- a/Source/Scene/PolylineMaterialAppearance.js +++ b/Source/Scene/PolylineMaterialAppearance.js @@ -28,7 +28,7 @@ if (!FeatureDetection.isInternetExplorer()) { * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - * @param {RenderState} [options.renderState] Optional render state to override the default render state. + * @param {Object} [options.renderState] Optional render state to override the default render state. * * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric} * diff --git a/Source/Scene/PostProcessStageLibrary.js b/Source/Scene/PostProcessStageLibrary.js index 3b779589bfd7..a455f76f25d6 100644 --- a/Source/Scene/PostProcessStageLibrary.js +++ b/Source/Scene/PostProcessStageLibrary.js @@ -30,7 +30,7 @@ import PostProcessStageSampleMode from "./PostProcessStageSampleMode.js"; /** * Contains functions for creating common post-process stages. * - * @exports PostProcessStageLibrary + * @namespace PostProcessStageLibrary */ var PostProcessStageLibrary = {}; diff --git a/Source/Scene/PostProcessStageSampleMode.js b/Source/Scene/PostProcessStageSampleMode.js index 2518c57e2aab..32caaf7bb475 100644 --- a/Source/Scene/PostProcessStageSampleMode.js +++ b/Source/Scene/PostProcessStageSampleMode.js @@ -1,7 +1,7 @@ /** * Determines how input texture to a {@link PostProcessStage} is sampled. * - * @exports PostProcessStageSampleMode + * @enum {Number} */ var PostProcessStageSampleMode = { /** diff --git a/Source/Scene/QuadtreeTileLoadState.js b/Source/Scene/QuadtreeTileLoadState.js index dfce7d7b0328..e09deeeabd8a 100644 --- a/Source/Scene/QuadtreeTileLoadState.js +++ b/Source/Scene/QuadtreeTileLoadState.js @@ -1,6 +1,6 @@ /** * The state of a {@link QuadtreeTile} in the tile load pipeline. - * @exports QuadtreeTileLoadState + * @enum {Number} * @private */ var QuadtreeTileLoadState = { diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 61ece96a6826..e6f39dba5ac0 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -126,7 +126,7 @@ var requestRenderAfterFrame = function (scene) { * @constructor * * @param {Object} [options] Object with the following properties: - * @param {Canvas} options.canvas The HTML canvas element to create the scene for. + * @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for. * @param {Object} [options.contextOptions] Context and WebGL creation properties. See details above. * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed. * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas. @@ -787,7 +787,7 @@ Object.defineProperties(Scene.prototype, { * Gets the canvas element to which this scene is bound. * @memberof Scene.prototype * - * @type {Canvas} + * @type {HTMLCanvasElement} * @readonly */ canvas: { diff --git a/Source/Scene/SceneMode.js b/Source/Scene/SceneMode.js index 14858ffd8604..a9eabb4caae0 100644 --- a/Source/Scene/SceneMode.js +++ b/Source/Scene/SceneMode.js @@ -1,8 +1,7 @@ /** * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view. * - * @exports SceneMode - * + * @enum {Number} * @see Scene#mode */ var SceneMode = { diff --git a/Source/Scene/SceneTransforms.js b/Source/Scene/SceneTransforms.js index 5db365f69572..d6eee52df206 100644 --- a/Source/Scene/SceneTransforms.js +++ b/Source/Scene/SceneTransforms.js @@ -15,7 +15,7 @@ import SceneMode from "./SceneMode.js"; /** * Functions that do scene-dependent transforms between rendering-related coordinate systems. * - * @exports SceneTransforms + * @namespace SceneTransforms */ var SceneTransforms = {}; diff --git a/Source/Scene/ShadowMode.js b/Source/Scene/ShadowMode.js index c8a326643949..95e49b843912 100644 --- a/Source/Scene/ShadowMode.js +++ b/Source/Scene/ShadowMode.js @@ -2,7 +2,7 @@ * Specifies whether the object casts or receives shadows from light sources when * shadows are enabled. * - * @exports ShadowMode + * @enum {Number} */ var ShadowMode = { /** @@ -36,13 +36,13 @@ var ShadowMode = { * @constant */ RECEIVE_ONLY: 3, - - /** - * @private - */ - NUMBER_OF_SHADOW_MODES: 4, }; +/** + * @private + */ +ShadowMode.NUMBER_OF_SHADOW_MODES = 4; + /** * @private */ @@ -74,4 +74,5 @@ ShadowMode.fromCastReceive = function (castShadows, receiveShadows) { } return ShadowMode.DISABLED; }; + export default Object.freeze(ShadowMode); diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 8ad4aa8fe339..1914251224ab 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -119,7 +119,7 @@ Object.defineProperties(SingleTileImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof SingleTileImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -359,7 +359,7 @@ SingleTileImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/StencilFunction.js b/Source/Scene/StencilFunction.js index 2a0fc199677a..f6affdf4a6b9 100644 --- a/Source/Scene/StencilFunction.js +++ b/Source/Scene/StencilFunction.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the function used to compare stencil values for the stencil test. * - * @exports StencilFunction + * @enum {Number} */ var StencilFunction = { /** diff --git a/Source/Scene/StencilOperation.js b/Source/Scene/StencilOperation.js index b288b1d2edb2..aad78dcbd7be 100644 --- a/Source/Scene/StencilOperation.js +++ b/Source/Scene/StencilOperation.js @@ -3,7 +3,7 @@ import WebGLConstants from "../Core/WebGLConstants.js"; /** * Determines the action taken based on the result of the stencil test. * - * @exports StencilOperation + * @enum {Number} */ var StencilOperation = { /** diff --git a/Source/Scene/TextureAtlas.js b/Source/Scene/TextureAtlas.js index f640000377bd..446be3b0505e 100644 --- a/Source/Scene/TextureAtlas.js +++ b/Source/Scene/TextureAtlas.js @@ -354,7 +354,7 @@ function addImage(textureAtlas, image, index) { * the existing index is used. * * @param {String} id An identifier to detect whether the image already exists in the atlas. - * @param {Image|Canvas|String|Resource|Promise|TextureAtlas~CreateImageCallback} image An image or canvas to add to the texture atlas, + * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Promise|TextureAtlas.CreateImageCallback} image An image or canvas to add to the texture atlas, * or a URL to an Image, or a Promise for an image, or a function that creates an image. * @returns {Promise.} A Promise for the image index. */ @@ -494,8 +494,8 @@ TextureAtlas.prototype.destroy = function () { /** * A function that creates an image. - * @callback TextureAtlas~CreateImageCallback + * @callback TextureAtlas.CreateImageCallback * @param {String} id The identifier of the image to load. - * @returns {Image|Promise} The image, or a promise that will resolve to an image. + * @returns {HTMLImageElement|Promise} The image, or a promise that will resolve to an image. */ export default TextureAtlas; diff --git a/Source/Scene/TileBoundingVolume.js b/Source/Scene/TileBoundingVolume.js index 3a9093cd3c01..06d655078a81 100644 --- a/Source/Scene/TileBoundingVolume.js +++ b/Source/Scene/TileBoundingVolume.js @@ -4,6 +4,9 @@ import DeveloperError from "../Core/DeveloperError.js"; * Defines a bounding volume for a tile. This type describes an interface * and is not intended to be instantiated directly. * + * @alias TileBoundingVolume + * @constructor + * * @see TileBoundingRegion * @see TileBoundingSphere * @see TileOrientedBoundingBox @@ -15,8 +18,6 @@ function TileBoundingVolume() {} /** * The underlying bounding volume. * - * @memberof TileBoundingVolume.prototype - * * @type {Object} * @readonly */ @@ -25,8 +26,6 @@ TileBoundingVolume.prototype.boundingVolume = undefined; /** * The underlying bounding sphere. * - * @memberof TileBoundingVolume.prototype - * * @type {BoundingSphere} * @readonly */ diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index ee56a9b317bd..9e119a322fdf 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -39,7 +39,7 @@ Object.defineProperties(TileCoordinatesImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof TileCoordinatesImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -235,7 +235,7 @@ TileCoordinatesImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/TileDiscardPolicy.js b/Source/Scene/TileDiscardPolicy.js index c50a02a8611e..1977b881fcac 100644 --- a/Source/Scene/TileDiscardPolicy.js +++ b/Source/Scene/TileDiscardPolicy.js @@ -26,7 +26,7 @@ TileDiscardPolicy.prototype.isReady = DeveloperError.throwInstantiationError; * Given a tile image, decide whether to discard that image. * @function * - * @param {Image} image An image to test. + * @param {HTMLImageElement} image An image to test. * @returns {Boolean} True if the image should be discarded; otherwise, false. */ TileDiscardPolicy.prototype.shouldDiscardImage = diff --git a/Source/Scene/TimeDynamicImagery.js b/Source/Scene/TimeDynamicImagery.js index 7afa8d904349..ef579f198928 100644 --- a/Source/Scene/TimeDynamicImagery.js +++ b/Source/Scene/TimeDynamicImagery.js @@ -111,7 +111,7 @@ Object.defineProperties(TimeDynamicImagery.prototype, { * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. * - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if the tile is not in the cache. */ TimeDynamicImagery.prototype.getFromCache = function (x, y, level, request) { diff --git a/Source/Scene/Tonemapper.js b/Source/Scene/Tonemapper.js index 4c34f7515f7f..2deefe17b20b 100644 --- a/Source/Scene/Tonemapper.js +++ b/Source/Scene/Tonemapper.js @@ -1,7 +1,7 @@ /** * A tonemapping algorithm when rendering with high dynamic range. * - * @exports Tonemapper + * @enum {Number} * @private */ var Tonemapper = { diff --git a/Source/Scene/TweenCollection.js b/Source/Scene/TweenCollection.js index ff1515276763..e27df7182912 100644 --- a/Source/Scene/TweenCollection.js +++ b/Source/Scene/TweenCollection.js @@ -45,7 +45,7 @@ function Tween( * The callback to call if the tween is canceled either because {@link Tween#cancelTween} * was called or because the tween was removed from the collection. * - * @type {TweenCollection~TweenCancelledCallback} + * @type {TweenCollection.TweenCancelledCallback} */ this.cancel = cancel; @@ -125,7 +125,7 @@ Object.defineProperties(Tween.prototype, { * The callback to call at each animation update (usually tied to the a rendered frame). * @memberof Tween.prototype * - * @type {TweenCollection~TweenUpdateCallback} + * @type {TweenCollection.TweenUpdateCallback} * @readonly */ update: { @@ -138,7 +138,7 @@ Object.defineProperties(Tween.prototype, { * The callback to call when the tween finishes animating. * @memberof Tween.prototype * - * @type {TweenCollection~TweenCompleteCallback} + * @type {TweenCollection.TweenCompleteCallback} * @readonly */ complete: { @@ -204,9 +204,9 @@ Object.defineProperties(TweenCollection.prototype, { * @param {Number} options.duration The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.duration must be positive. @@ -284,9 +284,9 @@ TweenCollection.prototype.add = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.object must have the specified property. @@ -350,9 +350,9 @@ TweenCollection.prototype.addProperty = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material has no properties with alpha components. @@ -423,8 +423,8 @@ TweenCollection.prototype.addAlpha = function (options) { * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material.uniforms must have an offset property. @@ -573,16 +573,16 @@ TweenCollection.prototype.update = function (time) { /** * A function that will execute when a tween completes. - * @callback TweenCollection~TweenCompleteCallback + * @callback TweenCollection.TweenCompleteCallback */ /** * A function that will execute when a tween updates. - * @callback TweenCollection~TweenUpdateCallback + * @callback TweenCollection.TweenUpdateCallback */ /** * A function that will execute when a tween is cancelled. - * @callback TweenCollection~TweenCancelledCallback + * @callback TweenCollection.TweenCancelledCallback */ export default TweenCollection; diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index b053017be6ef..4585c38bab54 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -308,7 +308,7 @@ Object.defineProperties(UrlTemplateImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof UrlTemplateImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly * @default undefined */ @@ -660,7 +660,7 @@ UrlTemplateImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/Vector3DTileGeometry.js b/Source/Scene/Vector3DTileGeometry.js index 89095aa3e9aa..63e8ca8b74b3 100644 --- a/Source/Scene/Vector3DTileGeometry.js +++ b/Source/Scene/Vector3DTileGeometry.js @@ -139,7 +139,7 @@ Object.defineProperties(Vector3DTileGeometry.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTileGeometry.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePoints.js b/Source/Scene/Vector3DTilePoints.js index 9d2c9d5951dd..b6cd9346dc90 100644 --- a/Source/Scene/Vector3DTilePoints.js +++ b/Source/Scene/Vector3DTilePoints.js @@ -92,7 +92,7 @@ Object.defineProperties(Vector3DTilePoints.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePoints.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePolygons.js b/Source/Scene/Vector3DTilePolygons.js index 50a1712ba549..afe4f440b18e 100644 --- a/Source/Scene/Vector3DTilePolygons.js +++ b/Source/Scene/Vector3DTilePolygons.js @@ -143,7 +143,7 @@ Object.defineProperties(Vector3DTilePolygons.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePolygons.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/Vector3DTilePolylines.js b/Source/Scene/Vector3DTilePolylines.js index 13c363a1056b..d9672ddd222b 100644 --- a/Source/Scene/Vector3DTilePolylines.js +++ b/Source/Scene/Vector3DTilePolylines.js @@ -121,7 +121,7 @@ Object.defineProperties(Vector3DTilePolylines.prototype, { /** * Gets a promise that resolves when the primitive is ready to render. * @memberof Vector3DTilePolylines.prototype - * @type {Promise} + * @type {Promise} * @readonly */ readyPromise: { diff --git a/Source/Scene/VerticalOrigin.js b/Source/Scene/VerticalOrigin.js index a86ab56be337..dfd99dc56e5c 100644 --- a/Source/Scene/VerticalOrigin.js +++ b/Source/Scene/VerticalOrigin.js @@ -8,7 +8,7 @@ *
* * - * @exports VerticalOrigin + * @enum {Number} * * @see Billboard#verticalOrigin * @see Label#verticalOrigin diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 8cc2b28dff20..8d76c9223b3d 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -242,7 +242,7 @@ Object.defineProperties(WebMapServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapServiceImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -494,7 +494,7 @@ WebMapServiceImageryProvider.prototype.getTileCredits = function (x, y, level) { * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 54e66417b684..6703ba4c7965 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -300,7 +300,7 @@ Object.defineProperties(WebMapTileServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapTileServiceImageryProvider.prototype - * @type {Proxy} + * @type {DefaultProxy} * @readonly */ proxy: { @@ -552,7 +552,7 @@ WebMapTileServiceImageryProvider.prototype.getTileCredits = function ( * @param {Number} y The tile Y coordinate. * @param {Number} level The tile level. * @param {Request} [request] The request object. Intended for internal use only. - * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or + * @returns {Promise.|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request * should be retried later. The resolved image may be either an * Image or a Canvas DOM object. diff --git a/Source/Scene/createBillboardPointCallback.js b/Source/Scene/createBillboardPointCallback.js index 24453e9af971..65718192d807 100644 --- a/Source/Scene/createBillboardPointCallback.js +++ b/Source/Scene/createBillboardPointCallback.js @@ -1,12 +1,12 @@ /** - * Creates a {@link createBillboardPointCallback~CanvasFunction} that will create a canvas with a point. + * Creates a {@link createBillboardPointCallback.CanvasFunction} that will create a canvas with a point. * * @param {Number} centerAlpha The alpha of the center of the point. The value must be in the range [0.0, 1.0]. * @param {String} cssColor The CSS color string. * @param {String} cssOutlineColor The CSS color of the point outline. * @param {Number} cssOutlineWidth The width of the outline in pixels. * @param {Number} pixelSize The size of the point in pixels. - * @return {createBillboardPointCallback~CanvasFunction} The function that will return a canvas with the point drawn on it. + * @return {createBillboardPointCallback.CanvasFunction} The function that will return a canvas with the point drawn on it. * * @private */ @@ -64,7 +64,7 @@ function createBillboardPointCallback( /** * A function that returns a canvas containing an image of a point. - * @callback createBillboardPointCallback~CanvasFunction + * @callback createBillboardPointCallback.CanvasFunction * @returns {HTMLCanvasElement} The result of the calculation. */ export default createBillboardPointCallback; diff --git a/Source/Scene/createOsmBuildings.js b/Source/Scene/createOsmBuildings.js index a692281fae11..09636e39ced1 100644 --- a/Source/Scene/createOsmBuildings.js +++ b/Source/Scene/createOsmBuildings.js @@ -11,7 +11,7 @@ import Cesium3DTileStyle from "./Cesium3DTileStyle.js"; * {@link https://cesium.com/content/#cesium-osm-buildings|Cesium OSM Buildings} * tileset. * - * @exports createOsmBuildings + * @function * * @param {Object} [options] Construction options. Any options allowed by the {@link Cesium3DTileset} constructor * may be specified here. In addition to those, the following properties are supported: diff --git a/Source/Scene/createTangentSpaceDebugPrimitive.js b/Source/Scene/createTangentSpaceDebugPrimitive.js index fe809e7c1163..78f6436322f8 100644 --- a/Source/Scene/createTangentSpaceDebugPrimitive.js +++ b/Source/Scene/createTangentSpaceDebugPrimitive.js @@ -14,7 +14,7 @@ import Primitive from "./Primitive.js"; * is red; tangent is green; and bitangent is blue. If an attribute is not * present, it is not drawn. * - * @exports createTangentSpaceDebugPrimitive + * @function * * @param {Object} options Object with the following properties: * @param {Geometry} options.geometry The Geometry instance with the attribute. diff --git a/Source/Scene/createWorldImagery.js b/Source/Scene/createWorldImagery.js index bb00d364a3be..460d4c7ffeaa 100644 --- a/Source/Scene/createWorldImagery.js +++ b/Source/Scene/createWorldImagery.js @@ -5,7 +5,7 @@ import IonWorldImageryStyle from "./IonWorldImageryStyle.js"; /** * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. * - * @exports createWorldImagery + * @function * * @param {Object} [options] Object with the following properties: * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. diff --git a/Source/Widgets/Animation/AnimationViewModel.js b/Source/Widgets/Animation/AnimationViewModel.js index 4a16227185d9..4da7381d0001 100644 --- a/Source/Widgets/Animation/AnimationViewModel.js +++ b/Source/Widgets/Animation/AnimationViewModel.js @@ -380,7 +380,7 @@ function AnimationViewModel(clockViewModel) { * Gets or sets the default date formatter used by new instances. * * @member - * @type {AnimationViewModel~DateFormatter} + * @type {AnimationViewModel.DateFormatter} */ AnimationViewModel.defaultDateFormatter = function (date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -435,7 +435,7 @@ AnimationViewModel.defaultTicks = [ * Gets or sets the default time formatter used by new instances. * * @member - * @type {AnimationViewModel~TimeFormatter} + * @type {AnimationViewModel.TimeFormatter} */ AnimationViewModel.defaultTimeFormatter = function (date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -598,7 +598,7 @@ Object.defineProperties(AnimationViewModel.prototype, { * Gets or sets the function which formats a date for display. * @memberof AnimationViewModel.prototype * - * @type {AnimationViewModel~DateFormatter} + * @type {AnimationViewModel.DateFormatter} * @default AnimationViewModel.defaultDateFormatter */ dateFormatter: { @@ -621,7 +621,7 @@ Object.defineProperties(AnimationViewModel.prototype, { * Gets or sets the function which formats a time for display. * @memberof AnimationViewModel.prototype * - * @type {AnimationViewModel~TimeFormatter} + * @type {AnimationViewModel.TimeFormatter} * @default AnimationViewModel.defaultTimeFormatter */ timeFormatter: { @@ -647,7 +647,7 @@ AnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle; /** * A function that formats a date for display. - * @callback AnimationViewModel~DateFormatter + * @callback AnimationViewModel.DateFormatter * * @param {JulianDate} date The date to be formatted * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. @@ -656,7 +656,7 @@ AnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle; /** * A function that formats a time for display. - * @callback AnimationViewModel~TimeFormatter + * @callback AnimationViewModel.TimeFormatter * * @param {JulianDate} date The date to be formatted * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. diff --git a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js index f301e667748d..093bb62bf7f8 100644 --- a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js +++ b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js @@ -15,7 +15,7 @@ import createCommand from "../createCommand.js"; * @param {String} options.tooltip The tooltip to show when the item is moused over. * @param {String} options.iconUrl An icon representing the layer. * @param {String} [options.category] A category for the layer. - * @param {ProviderViewModel~CreationFunction|Command} options.creationFunction A function or Command + * @param {ProviderViewModel.CreationFunction|Command} options.creationFunction A function or Command * that creates one or more providers which will be added to the globe when this item is selected. * * @see BaseLayerPicker @@ -98,7 +98,7 @@ Object.defineProperties(ProviderViewModel.prototype, { /** * A function which creates one or more providers. - * @callback ProviderViewModel~CreationFunction + * @callback ProviderViewModel.CreationFunction * @returns {ImageryProvider|TerrainProvider|ImageryProvider[]|TerrainProvider[]} * The ImageryProvider or TerrainProvider, or array of providers, to be added * to the globe. diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 409c9f10e6b0..178109857acd 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -58,7 +58,7 @@ var scratchPickCartesian = new Cartesian3(); * @constructor * * @param {Scene} scene The scene instance to use. - * @param {PerformanceContainer} performanceContainer The instance to use for performance container. + * @param {Element} performanceContainer The instance to use for performance container. */ function CesiumInspectorViewModel(scene, performanceContainer) { //>>includeStart('debug', pragmas.debug); diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index bc1add14f2f8..b008161b2030 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -404,7 +404,7 @@ Object.defineProperties(CesiumWidget.prototype, { * Gets the canvas. * @memberof CesiumWidget.prototype * - * @type {Canvas} + * @type {HTMLCanvasElement} */ canvas: { get: function () { diff --git a/Source/Widgets/Geocoder/Geocoder.js b/Source/Widgets/Geocoder/Geocoder.js index 390a3b879ea1..943d52b1e6dd 100644 --- a/Source/Widgets/Geocoder/Geocoder.js +++ b/Source/Widgets/Geocoder/Geocoder.js @@ -24,7 +24,7 @@ var stopSearchPath = * @param {GeocoderService[]} [options.geocoderServices] The geocoder services to be used * @param {Boolean} [options.autoComplete = true] True if the geocoder should query as the user types to autocomplete * @param {Number} [options.flightDuration=1.5] The duration of the camera flight to an entered location, in seconds. - * @param {Geocoder~DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. */ function Geocoder(options) { //>>includeStart('debug', pragmas.debug); @@ -224,7 +224,7 @@ Geocoder.prototype.destroy = function () { /** * A function that handles the result of a successful geocode. - * @callback Geocoder~DestinationFoundFunction + * @callback Geocoder.DestinationFoundFunction * @param {GeocoderViewModel} viewModel The view model. * @param {Cartesian3|Rectangle} destination The destination result of the geocode. */ diff --git a/Source/Widgets/Geocoder/GeocoderViewModel.js b/Source/Widgets/Geocoder/GeocoderViewModel.js index b704825c6786..b384fcb853de 100644 --- a/Source/Widgets/Geocoder/GeocoderViewModel.js +++ b/Source/Widgets/Geocoder/GeocoderViewModel.js @@ -29,7 +29,7 @@ var DEFAULT_HEIGHT = 1000; * If more than one are supplied, suggestions will be gathered for the geocoders that support it, * and if no suggestion is selected the result from the first geocoder service wil be used. * @param {Number} [options.flightDuration] The duration of the camera flight to an entered location, in seconds. - * @param {Geocoder~DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. */ function GeocoderViewModel(options) { //>>includeStart('debug', pragmas.debug); @@ -157,7 +157,7 @@ function GeocoderViewModel(options) { /** * Gets and sets the command called when a geocode destination is found - * @type {Geocoder~DestinationFoundFunction} + * @type {Geocoder.DestinationFoundFunction} */ this.destinationFound = defaultValue( options.destinationFound, @@ -547,7 +547,7 @@ function updateSearchSuggestions(viewModel) { /** * A function to fly to the destination found by a successful geocode. - * @type {Geocoder~DestinationFoundFunction} + * @type {Geocoder.DestinationFoundFunction} */ GeocoderViewModel.flyToDestination = flyToDestination; diff --git a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js index 08cee4b730f6..83ee0ce9a240 100644 --- a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js +++ b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js @@ -87,7 +87,7 @@ function SelectionIndicatorViewModel( * Gets or sets the function for converting the world position of the object to the screen space position. * * @member - * @type {SelectionIndicatorViewModel~ComputeScreenSpacePosition} + * @type {SelectionIndicatorViewModel.ComputeScreenSpacePosition} * @default SceneTransforms.wgs84ToWindowCoordinates * * @example @@ -205,7 +205,7 @@ Object.defineProperties(SelectionIndicatorViewModel.prototype, { /** * A function that converts the world position of an object to a screen space position. - * @callback SelectionIndicatorViewModel~ComputeScreenSpacePosition + * @callback SelectionIndicatorViewModel.ComputeScreenSpacePosition * @param {Cartesian3} position The position in WGS84 (world) coordinates. * @param {Cartesian2} result An object to return the input position transformed to window coordinates. * @returns {Cartesian2} The modified result parameter. diff --git a/Source/Widgets/SvgPathBindingHandler.js b/Source/Widgets/SvgPathBindingHandler.js index e57e6429efc5..cba2bd5f3cb7 100644 --- a/Source/Widgets/SvgPathBindingHandler.js +++ b/Source/Widgets/SvgPathBindingHandler.js @@ -16,7 +16,7 @@ var svgClassName = "cesium-svgPath-svg"; *
  • css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.
  • * * - * @exports SvgPathBindingHandler + * @namespace SvgPathBindingHandler * * @example * // Create an SVG as a child of a div @@ -29,6 +29,9 @@ var svgClassName = "cesium-svgPath-svg"; *
    */ var SvgPathBindingHandler = { + /** + * @function + */ register: function (knockout) { knockout.bindingHandlers.cesiumSvgPath = { init: function (element, valueAccessor) { diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index c54f7d9cdfb0..6e27585a1813 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -1065,7 +1065,7 @@ Object.defineProperties(Viewer.prototype, { /** * Gets the canvas. * @memberof Viewer.prototype - * @type {Canvas} + * @type {HTMLCanvasElement} * @readonly */ canvas: { @@ -1439,7 +1439,7 @@ Object.defineProperties(Viewer.prototype, { * A mixin may add additional properties, functions, or other behavior * to the provided viewer instance. * - * @param {Viewer~ViewerMixin} mixin The Viewer mixin to add to this instance. + * @param {Viewer.ViewerMixin} mixin The Viewer mixin to add to this instance. * @param {Object} [options] The options object to be passed to the mixin function. * * @see viewerDragDropMixin @@ -2311,7 +2311,7 @@ function updateTrackedEntity(viewer) { /** * A function that augments a Viewer instance with additional functionality. - * @callback Viewer~ViewerMixin + * @callback Viewer.ViewerMixin * @param {Viewer} viewer The viewer instance. * @param {Object} options Options object to be passed to the mixin function. * diff --git a/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js b/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js index ce0a01a079c9..c4bb1761429f 100644 --- a/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js +++ b/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js @@ -5,7 +5,7 @@ import Cesium3DTilesInspector from "../Cesium3DTilesInspector/Cesium3DTilesInspe * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerCesium3DTilesInspectorMixin + * @function * * @param {Viewer} viewer The viewer instance. * diff --git a/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js b/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js index a7413fb3c225..de8518f1c60f 100644 --- a/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js +++ b/Source/Widgets/Viewer/viewerCesiumInspectorMixin.js @@ -6,7 +6,7 @@ import CesiumInspector from "../CesiumInspector/CesiumInspector.js"; * A mixin which adds the CesiumInspector widget to the Viewer widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerCesiumInspectorMixin + * @function * * @param {Viewer} viewer The viewer instance. * diff --git a/Source/Widgets/Viewer/viewerDragDropMixin.js b/Source/Widgets/Viewer/viewerDragDropMixin.js index d111f7cdef42..06d7b7dbeffb 100644 --- a/Source/Widgets/Viewer/viewerDragDropMixin.js +++ b/Source/Widgets/Viewer/viewerDragDropMixin.js @@ -12,8 +12,8 @@ import getElement from "../getElement.js"; * A mixin which adds default drag and drop support for CZML files to the Viewer widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerDragDropMixin - * @namespace + * @function viewerDragDropMixin + * @param {Viewer} viewer The viewer instance. * @param {Object} [options] Object with the following properties: * @param {Element|String} [options.dropTarget=viewer.container] The DOM element which will serve as the drop target. diff --git a/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js b/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js index 589277ad44e6..c0cbb78c517c 100644 --- a/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js +++ b/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js @@ -7,7 +7,7 @@ import PerformanceWatchdog from "../PerformanceWatchdog/PerformanceWatchdog.js"; * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget. * Rather than being called directly, this function is normally passed as * a parameter to {@link Viewer#extend}, as shown in the example below. - * @exports viewerPerformanceWatchdogMixin + * @function * * @param {Viewer} viewer The viewer instance. * @param {Object} [options] An object with properties. diff --git a/Source/Widgets/createCommand.js b/Source/Widgets/createCommand.js index 88a0aec3a735..27e761f234fd 100644 --- a/Source/Widgets/createCommand.js +++ b/Source/Widgets/createCommand.js @@ -12,7 +12,7 @@ import knockout from "../ThirdParty/knockout.js"; * value of canExecute and throw if false. It also provides events for when * a command has been or is about to be executed. * - * @exports createCommand + * @function * * @param {Function} func The function to execute. * @param {Boolean} [canExecute=true] A boolean indicating whether the function can currently be executed. diff --git a/Source/Widgets/subscribeAndEvaluate.js b/Source/Widgets/subscribeAndEvaluate.js index 700240f76b12..768829eef8b7 100644 --- a/Source/Widgets/subscribeAndEvaluate.js +++ b/Source/Widgets/subscribeAndEvaluate.js @@ -6,7 +6,7 @@ import knockout from "../ThirdParty/knockout.js"; * * @private * - * @exports subscribeAndEvaluate + * @function subscribeAndEvaluate * * @param {Object} owner The object containing the observable property. * @param {String} observablePropertyName The name of the observable property. diff --git a/Source/WorkersES6/createTaskProcessorWorker.js b/Source/WorkersES6/createTaskProcessorWorker.js index 55a699a3012c..2b6f49308d8d 100644 --- a/Source/WorkersES6/createTaskProcessorWorker.js +++ b/Source/WorkersES6/createTaskProcessorWorker.js @@ -21,11 +21,11 @@ function callAndWrap(workerFunction, parameters, transferableObjects) { * Creates an adapter function to allow a calculation function to operate as a Web Worker, * paired with TaskProcessor, to receive tasks and return results. * - * @exports createTaskProcessorWorker + * @function createTaskProcessorWorker * - * @param {createTaskProcessorWorker~WorkerFunction} workerFunction The calculation function, + * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function, * which takes parameters and returns a result. - * @returns {createTaskProcessorWorker~TaskProcessorWorkerFunction} A function that adapts the + * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the * calculation function to work as a Web Worker onmessage listener with TaskProcessor. * * @@ -101,7 +101,7 @@ function createTaskProcessorWorker(workerFunction) { /** * A function that performs a calculation in a Web Worker. - * @callback createTaskProcessorWorker~WorkerFunction + * @callback createTaskProcessorWorker.WorkerFunction * * @param {Object} parameters Parameters to the calculation. * @param {Array} transferableObjects An array that should be filled with references to objects inside @@ -125,7 +125,7 @@ function createTaskProcessorWorker(workerFunction) { /** * A Web Worker message event handler function that handles the interaction with TaskProcessor, * specifically, task ID management and posting a response message containing the result. - * @callback createTaskProcessorWorker~TaskProcessorWorkerFunction + * @callback createTaskProcessorWorker.TaskProcessorWorkerFunction * * @param {Object} event The onmessage event object. */ diff --git a/Specs/Core/Cartesian2Spec.js b/Specs/Core/Cartesian2Spec.js index 95d5d2c573f3..591d66f99f5d 100644 --- a/Specs/Core/Cartesian2Spec.js +++ b/Specs/Core/Cartesian2Spec.js @@ -860,12 +860,6 @@ describe("Core/Cartesian2", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian2.equalsEpsilon(new Cartesian2(), new Cartesian2(), undefined); - }).toThrowDeveloperError(); - }); - it("fromElements returns a cartesian2 with corrrect coordinates", function () { var cartesian2 = Cartesian2.fromElements(2, 2); var expectedResult = new Cartesian2(2, 2); diff --git a/Specs/Core/Cartesian3Spec.js b/Specs/Core/Cartesian3Spec.js index b00b85e7e4f0..338e05fa27e1 100644 --- a/Specs/Core/Cartesian3Spec.js +++ b/Specs/Core/Cartesian3Spec.js @@ -1031,12 +1031,6 @@ describe("Core/Cartesian3", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian3.equalsEpsilon(new Cartesian3(), new Cartesian3(), undefined); - }).toThrowDeveloperError(); - }); - it("cross throw with no left paramater", function () { var right = new Cartesian3(4, 3, 6); expect(function () { diff --git a/Specs/Core/Cartesian4Spec.js b/Specs/Core/Cartesian4Spec.js index f153832e553f..813007d128e0 100644 --- a/Specs/Core/Cartesian4Spec.js +++ b/Specs/Core/Cartesian4Spec.js @@ -1011,12 +1011,6 @@ describe("Core/Cartesian4", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Cartesian4.equalsEpsilon(new Cartesian4(), new Cartesian4(), undefined); - }).toThrowDeveloperError(); - }); - it("minimumByComponent throws with no result", function () { expect(function () { Cartesian4.minimumByComponent(new Cartesian4(), new Cartesian4()); diff --git a/Specs/Core/CartographicSpec.js b/Specs/Core/CartographicSpec.js index 8c662bde0cf0..358907e22867 100644 --- a/Specs/Core/CartographicSpec.js +++ b/Specs/Core/CartographicSpec.js @@ -216,10 +216,4 @@ describe("Core/Cartographic", function () { it("clone returns undefined without cartographic parameter", function () { expect(Cartographic.clone(undefined)).toBeUndefined(); }); - - it("equalsEpsilon throws without numeric epsilon", function () { - expect(function () { - Cartographic.equalsEpsilon(new Cartographic(), new Cartographic(), {}); - }).toThrowDeveloperError(); - }); }); diff --git a/Specs/Core/MathSpec.js b/Specs/Core/MathSpec.js index 7c38c87ac2e8..d065817d3afd 100644 --- a/Specs/Core/MathSpec.js +++ b/Specs/Core/MathSpec.js @@ -339,12 +339,6 @@ describe("Core/Math", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws for undefined relativeEpsilon", function () { - expect(function () { - CesiumMath.equalsEpsilon(1.0, 5.0, undefined); - }).toThrowDeveloperError(); - }); - it("equalsEpsilon throws for undefined", function () { expect(function () { CesiumMath.equalsEpsilon(); diff --git a/Specs/Core/Matrix2Spec.js b/Specs/Core/Matrix2Spec.js index 975b25d1c4a2..d1f9666e0b31 100644 --- a/Specs/Core/Matrix2Spec.js +++ b/Specs/Core/Matrix2Spec.js @@ -740,12 +740,6 @@ describe("Core/Matrix2", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix2.equalsEpsilon(new Matrix2(), new Matrix2(), {}); - }).toThrowDeveloperError(); - }); - it("getColumn throws without result parameter", function () { expect(function () { Matrix2.getColumn(new Matrix2(), 1); diff --git a/Specs/Core/Matrix3Spec.js b/Specs/Core/Matrix3Spec.js index b6dc75eafcdd..bfd75f43f763 100644 --- a/Specs/Core/Matrix3Spec.js +++ b/Specs/Core/Matrix3Spec.js @@ -1373,12 +1373,6 @@ describe("Core/Matrix3", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix3.equalsEpsilon(new Matrix3(), new Matrix3(), {}); - }).toThrowDeveloperError(); - }); - it("getColumn throws without result parameter", function () { expect(function () { Matrix3.getColumn(new Matrix3(), 2); diff --git a/Specs/Core/Matrix4Spec.js b/Specs/Core/Matrix4Spec.js index da2c3e55af50..6fad177a2d8d 100644 --- a/Specs/Core/Matrix4Spec.js +++ b/Specs/Core/Matrix4Spec.js @@ -4306,12 +4306,6 @@ describe("Core/Matrix4", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with non-number parameter", function () { - expect(function () { - Matrix4.equalsEpsilon(new Matrix4(), new Matrix4(), {}); - }).toThrowDeveloperError(); - }); - it("getTranslation throws without matrix parameter", function () { expect(function () { Matrix4.getTranslation(undefined); @@ -4566,21 +4560,6 @@ describe("Core/Matrix4", function () { }).toThrowDeveloperError(); }); - it("computeViewportTransformation works", function () { - expect(function () { - Matrix4.computeViewportTransformation( - { - x: 0, - y: 0, - width: 4.0, - height: 6.0, - }, - 0.0, - 2.0 - ); - }).toThrowDeveloperError(); - }); - it("Matrix4 objects can be used as array like objects", function () { var matrix = new Matrix4( 1, diff --git a/Specs/Core/QuaternionSpec.js b/Specs/Core/QuaternionSpec.js index 45ec1c8d2d69..d330f5905009 100644 --- a/Specs/Core/QuaternionSpec.js +++ b/Specs/Core/QuaternionSpec.js @@ -1152,12 +1152,6 @@ describe("Core/Quaternion", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - expect(function () { - Quaternion.equalsEpsilon(new Quaternion(), new Quaternion(), undefined); - }).toThrowDeveloperError(); - }); - it("conjugate throws with no result", function () { expect(function () { Quaternion.conjugate(new Quaternion()); diff --git a/Specs/Core/RectangleSpec.js b/Specs/Core/RectangleSpec.js index 4b18f74f707a..36db8a65726d 100644 --- a/Specs/Core/RectangleSpec.js +++ b/Specs/Core/RectangleSpec.js @@ -1014,14 +1014,6 @@ describe("Core/Rectangle", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws with no epsilon", function () { - var rectangle = new Rectangle(west, south, east, north); - var other = new Rectangle(); - expect(function () { - rectangle.equalsEpsilon(other, undefined); - }).toThrowDeveloperError(); - }); - it("intersection throws with no rectangle", function () { expect(function () { Rectangle.intersection(undefined); diff --git a/Specs/Core/TimeIntervalSpec.js b/Specs/Core/TimeIntervalSpec.js index 2ada0a768700..2de525dc7623 100644 --- a/Specs/Core/TimeIntervalSpec.js +++ b/Specs/Core/TimeIntervalSpec.js @@ -633,14 +633,6 @@ describe("Core/TimeInterval", function () { }).toThrowDeveloperError(); }); - it("equalsEpsilon throws without epsilon.", function () { - var left = new TimeInterval(); - var right = new TimeInterval(); - expect(function () { - TimeInterval.equalsEpsilon(left, right, undefined); - }).toThrowDeveloperError(); - }); - it("intersect throws without left.", function () { var right = new TimeInterval(); var result = new TimeInterval(); @@ -649,14 +641,6 @@ describe("Core/TimeInterval", function () { }).toThrowDeveloperError(); }); - it("intersect throws without result.", function () { - var left = new TimeInterval(); - var right = new TimeInterval(); - expect(function () { - TimeInterval.intersect(left, right, undefined); - }).toThrowDeveloperError(); - }); - it("contains throws without interval.", function () { var date = new JulianDate(); expect(function () { diff --git a/Tools/jsdoc/cesium_template/publish.js b/Tools/jsdoc/cesium_template/publish.js index ab9fcf459d29..1cd1c6960ec8 100644 --- a/Tools/jsdoc/cesium_template/publish.js +++ b/Tools/jsdoc/cesium_template/publish.js @@ -217,6 +217,7 @@ function buildNav(members) { var items = members.modules .concat(members.classes) + .concat(members.globals) .concat(members.namespaces) .sort(function (a, b) { return a.longname.toLowerCase().localeCompare(b.longname.toLowerCase()); @@ -436,6 +437,7 @@ exports.publish = function (taffyData, opts, tutorials) { var classes = taffy(members.classes); var modules = taffy(members.modules); var namespaces = taffy(members.namespaces); + var globals = taffy(members.globals); var typesJson = {}; @@ -450,6 +452,10 @@ exports.publish = function (taffyData, opts, tutorials) { items = helper.find(namespaces, { longname: longname }); } + if (!items.length) { + items = helper.find(globals, { longname: longname }); + } + if (items.length) { var title = items[0].name; var filename = helper.longnameToUrl[longname]; diff --git a/Tools/jsdoc/conf.json b/Tools/jsdoc/conf.json index 84d69edfb90c..f775c5099463 100644 --- a/Tools/jsdoc/conf.json +++ b/Tools/jsdoc/conf.json @@ -3,12 +3,19 @@ "allowUnknownTags": false }, "source": { - "include": ["Source"], - "exclude": ["Source/ThirdParty", "Source/Workers"], + "include": [ + "Source" + ], + "exclude": [ + "Source/ThirdParty", + "Source/Workers" + ], "includePattern": ".+\\.js(doc)?$", "excludePattern": "(^|\\/|\\\\)_" }, - "plugins": ["./Tools/jsdoc/cesiumTags"], + "plugins": [ + "./Tools/jsdoc/cesiumTags" + ], "templates": { "cleverLinks": true, "default": { @@ -21,4 +28,4 @@ "template": "./Tools/jsdoc/cesium_template", "recurse": true } -} +} \ No newline at end of file diff --git a/Tools/jsdoc/ts-conf.json b/Tools/jsdoc/ts-conf.json new file mode 100644 index 000000000000..c5cf568076a9 --- /dev/null +++ b/Tools/jsdoc/ts-conf.json @@ -0,0 +1,32 @@ +{ + "tags": { + "allowUnknownTags": false + }, + "source": { + "include": [ + "Source" + ], + "exclude": [ + "Source/ThirdParty", + "Source/Workers" + ], + "includePattern": ".+\\.js(doc)?$", + "excludePattern": "(^|\\/|\\\\)_" + }, + "plugins": [ + "./Tools/jsdoc/cesiumTags" + ], + "templates": { + "cleverLinks": true, + "default": { + "outputSourceFiles": false + }, + "sourceUrl": "https://github.com/CesiumGS/cesium/blob/{version}/Source/{filename}" + }, + "opts": { + "destination": "Source", + "template": "./node_modules/tsd-jsdoc/dist", + "outFile": "Cesium.d.ts", + "recurse": true + } +} \ No newline at end of file diff --git a/gulpfile.cjs b/gulpfile.cjs index 9c0e88939310..a660e726903c 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -34,6 +34,7 @@ var rollupPluginStripPragma = require("rollup-plugin-strip-pragma"); var rollupPluginExternalGlobals = require("rollup-plugin-external-globals"); var rollupPluginUglify = require("rollup-plugin-uglify"); var cleanCSS = require("gulp-clean-css"); +var typescript = require("typescript"); var packageJson = require("./package.json"); var version = packageJson.version; @@ -194,6 +195,11 @@ gulp.task("build-watch", function () { return gulp.watch(watchedFiles, gulp.series("build")); }); +gulp.task("build-ts", function () { + createTypeScriptDefinitions(); + return Promise.resolve(); +}); + gulp.task("buildApps", function () { return Promise.join(buildCesiumViewer(), buildSandcastle()); }); @@ -371,7 +377,13 @@ gulp.task("generateDocumentation-watch", function () { gulp.task( "release", - gulp.series("build", combine, minifyRelease, generateDocumentation) + gulp.series( + "build", + "build-ts", + combine, + minifyRelease, + generateDocumentation + ) ); gulp.task( @@ -1467,6 +1479,131 @@ function createCesiumJs() { fs.writeFileSync("Source/Cesium.js", contents); } +function createTypeScriptDefinitions() { + // Run jsdoc with tsd-jsdoc to generate an initial Cesium.d.ts file. + child_process.execSync( + "node_modules/.bin/jsdoc --configure Tools/jsdoc/ts-conf.json", + { stdio: "inherit" } + ); + + var source = fs.readFileSync("Source/Cesium.d.ts").toString(); + + // All of our enum assignments that alias to WebGLConstants, such as PixelDatatype.js + // end up as enum strings instead of actually mapping values to WebGLConstants. + // We fix this with a simple regex replace later on, but it means the + // WebGLConstants constants enum needs to be defined in the file before it can + // be used. This block of code reads in the TS file, finds the WebGLConstants + // declaration, and then writes the file back out (in memory to source) with + // WebGLConstants being the first module. + const node = typescript.createSourceFile( + "Source/Cesium.d.ts", + source, + typescript.ScriptTarget.Latest + ); + let firstNode; + node.forEachChild((child) => { + if ( + typescript.SyntaxKind[child.kind] === "EnumDeclaration" && + child.name.escapedText === "WebGLConstants" + ) { + firstNode = child; + } + }); + + const printer = typescript.createPrinter({ + removeComments: false, + newLine: typescript.NewLineKind.LineFeed, + }); + + let newSource = ""; + newSource += printer.printNode( + typescript.EmitHint.Unspecified, + firstNode, + node + ); + node.forEachChild((child) => { + if ( + typescript.SyntaxKind[child.kind] !== "EnumDeclaration" || + child.name.escapedText !== "WebGLConstants" + ) { + newSource += printer.printNode( + typescript.EmitHint.Unspecified, + child, + node + ); + newSource += "\n\n"; + } + }); + source = newSource; + + // The next step is to find the list of Cesium modules exported by the Cesium API + // So that we can map these modules with a link back to their original source file. + + var regex = /^declare (function|class|namespace|enum) (.+)/gm; + var matches; + var publicModules = new Set(); + //eslint-disable-next-line no-cond-assign + while ((matches = regex.exec(source))) { + const moduleName = matches[2].match(/([^\s|\(]+)/); + if (moduleName[1] === "CesiumMath") { + moduleName[1] = "Math"; + } + publicModules.add(moduleName[1]); + } + + // Fix up the output to match what we need + // declare => export since we are wrapping everything in a namespace + // CesiumMath => Math (because no CesiumJS build step would be complete without special logic for the Math class) + // Fix up the WebGLConstants aliasing we mentioned above by simply unquoting the strings. + source = source + .replace(/^declare /gm, "export ") + .replace(/CesiumMath/gm, "Math") + .replace( + /= "WebGLConstants\.(.+)"/gm, + (match, p1) => `= WebGLConstants.${p1}` + ); + + // Wrap the source to actually be inside of a declared cesium module. + source = 'declare module "cesium" {\n' + source + "}\n"; + + // Map individual modules back to their source file so that TS still works + // when importing individual files instead of the entire cesium module. + globby.sync(sourceFiles).forEach(function (file) { + file = path.relative("Source", file); + + var moduleId = file; + moduleId = filePathToModuleId(moduleId); + + var assignmentName = path.basename(file, path.extname(file)); + if (publicModules.has(assignmentName)) { + publicModules.delete(assignmentName); + source += `declare module "cesium/Source/${moduleId}" { import { ${assignmentName} } from 'cesium'; export default ${assignmentName}; }\n`; + } + }); + + // Write the final source file back out + fs.writeFileSync("Source/Cesium.d.ts", source); + + // Use tsc to compile it and make sure it is valid + child_process.execSync("node_modules/.bin/tsc Source/Cesium.d.ts --noEmit", { + stdio: "inherit", + }); + + // Below is a sanity check to make sure we didn't leave anything out that + // we don't already know about + + // Intentionally ignored nested items + publicModules.delete("KmlFeatureData"); + publicModules.delete("MaterialAppearance"); + + if (publicModules.size !== 0) { + throw new Error( + "Unexpected unexposed modules: " + + Array.from(publicModules.values()).join(", ") + ); + } +} + function createSpecList() { var specFiles = globby.sync(["Specs/**/*Spec.js"]); diff --git a/package.json b/package.json index 2b1ec9a26936..bcc72607df43 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "main": "index.cjs", "module": "./Source/Cesium.js", + "types": "./Source/Cesium.d.ts", "exports": { "require": "./index.cjs", "import": "./Source/Cesium.js" @@ -83,6 +84,8 @@ "rollup-plugin-strip-pragma": "^1.0.0", "rollup-plugin-uglify": "^6.0.3", "stream-to-promise": "^2.2.0", + "tsd-jsdoc": "^2.5.0", + "typescript": "^3.9.2", "yargs": "^15.0.1" }, "husky": { @@ -96,6 +99,7 @@ "startPublic": "node server.cjs --public", "build": "gulp build", "build-watch": "gulp build-watch", + "build-ts": "gulp build-ts", "buildApps": "gulp buildApps", "clean": "gulp clean", "cloc": "gulp cloc", From d84166d2c5b14b386f1ffd3437e3a5f98f77d352 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 27 May 2020 15:36:56 +1000 Subject: [PATCH 02/36] Don't hardcode ./node_modules/tsd-jsdoc It may be different in some environments. Instead, just use the normal module name, which will be resolved according to node's module resolution rules. --- Tools/jsdoc/ts-conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/jsdoc/ts-conf.json b/Tools/jsdoc/ts-conf.json index c5cf568076a9..e231b1adb8f6 100644 --- a/Tools/jsdoc/ts-conf.json +++ b/Tools/jsdoc/ts-conf.json @@ -25,8 +25,8 @@ }, "opts": { "destination": "Source", - "template": "./node_modules/tsd-jsdoc/dist", + "template": "tsd-jsdoc/dist", "outFile": "Cesium.d.ts", "recurse": true } -} \ No newline at end of file +} From 0b17c85168a55fdd1d387331608c0a846fb5d603 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 27 May 2020 17:17:03 +1000 Subject: [PATCH 03/36] Use tsconfig.json to avoid errors in some environments. --- Tools/jsdoc/tsconfig.json | 9 +++++++++ gulpfile.cjs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 Tools/jsdoc/tsconfig.json diff --git a/Tools/jsdoc/tsconfig.json b/Tools/jsdoc/tsconfig.json new file mode 100644 index 000000000000..2cd41ea62053 --- /dev/null +++ b/Tools/jsdoc/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "noEmit": true, + "types": [] + }, + "files": [ + "../../Source/Cesium.d.ts" + ] +} diff --git a/gulpfile.cjs b/gulpfile.cjs index a660e726903c..6af5edf42c0d 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1585,7 +1585,7 @@ function createTypeScriptDefinitions() { fs.writeFileSync("Source/Cesium.d.ts", source); // Use tsc to compile it and make sure it is valid - child_process.execSync("node_modules/.bin/tsc Source/Cesium.d.ts --noEmit", { + child_process.execSync("node_modules/.bin/tsc -p Tools/jsdoc/tsconfig.json", { stdio: "inherit", }); From 08b67392a56342cf456bfc4ed1c7af67ef502fc2 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 10:27:51 -0400 Subject: [PATCH 04/36] Add back a "Proxy" type. Since master documented a `Proxy` base class, create it rather than using `DefaultProxy` everywhere. --- Source/Core/DefaultProxy.js | 2 ++ Source/Core/GoogleEarthEnterpriseMetadata.js | 2 +- .../GoogleEarthEnterpriseTerrainProvider.js | 2 +- Source/Core/Proxy.js | 24 +++++++++++++ Source/Core/Resource.js | 34 +++++++++---------- .../Scene/ArcGisMapServerImageryProvider.js | 2 +- Source/Scene/BingMapsImageryProvider.js | 2 +- .../GoogleEarthEnterpriseImageryProvider.js | 2 +- .../GoogleEarthEnterpriseMapsProvider.js | 2 +- Source/Scene/GridImageryProvider.js | 2 +- Source/Scene/ImageryProvider.js | 2 +- Source/Scene/MapboxImageryProvider.js | 2 +- Source/Scene/MapboxStyleImageryProvider.js | 2 +- Source/Scene/SingleTileImageryProvider.js | 2 +- .../Scene/TileCoordinatesImageryProvider.js | 2 +- Source/Scene/UrlTemplateImageryProvider.js | 2 +- Source/Scene/WebMapServiceImageryProvider.js | 2 +- .../Scene/WebMapTileServiceImageryProvider.js | 2 +- Source/Widgets/Viewer/viewerDragDropMixin.js | 4 +-- 19 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 Source/Core/Proxy.js diff --git a/Source/Core/DefaultProxy.js b/Source/Core/DefaultProxy.js index 948675d8b968..38ac7f817973 100644 --- a/Source/Core/DefaultProxy.js +++ b/Source/Core/DefaultProxy.js @@ -4,6 +4,7 @@ * * @alias DefaultProxy * @constructor + * @extends {Proxy} * * @param {String} proxy The proxy URL that will be used to requests all resources. */ @@ -21,4 +22,5 @@ DefaultProxy.prototype.getURL = function (resource) { var prefix = this.proxy.indexOf("?") === -1 ? "?" : ""; return this.proxy + prefix + encodeURIComponent(resource); }; + export default DefaultProxy; diff --git a/Source/Core/GoogleEarthEnterpriseMetadata.js b/Source/Core/GoogleEarthEnterpriseMetadata.js index 2bd39d9d8efa..da939555ae1c 100644 --- a/Source/Core/GoogleEarthEnterpriseMetadata.js +++ b/Source/Core/GoogleEarthEnterpriseMetadata.js @@ -148,7 +148,7 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, { /** * Gets the proxy used for metadata requests. * @memberof GoogleEarthEnterpriseMetadata.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js index 4402c159f28b..551d5c665664 100644 --- a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +++ b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js @@ -192,7 +192,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseTerrainProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Core/Proxy.js b/Source/Core/Proxy.js new file mode 100644 index 000000000000..43af4dbabc38 --- /dev/null +++ b/Source/Core/Proxy.js @@ -0,0 +1,24 @@ +import DeveloperError from "./DeveloperError.js"; + +/** + * Base class for proxying requested made by {@link Resource}. + * + * @alias Proxy + * @constructor + * + * @see DefaultProxy + */ +function Proxy() { + DeveloperError.throwInstantiationError(); +} + +/** + * Get the final URL to use to request a given resource. + * + * @param {String} resource The resource to request. + * @returns {String} proxied resource + * @function + */ +Proxy.prototype.getURL = DeveloperError.throwInstantiationError; + +export default Proxy; diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index 85616a1fd52f..404701e8f31f 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -223,7 +223,7 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -291,7 +291,7 @@ function Resource(options) { /** * A proxy to be used when loading the resource. * - * @type {DefaultProxy} + * @type {Proxy} */ this.proxy = options.proxy; @@ -620,7 +620,7 @@ Resource.prototype.setTemplateValues = function (template, useAsDefault) { * @param {Object} [options.queryParameters] An object containing query parameters that will be combined with those of the current instance. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance. * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails. * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -782,7 +782,7 @@ Resource.prototype.fetchArrayBuffer = function () { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -826,7 +826,7 @@ Resource.prototype.fetchBlob = function () { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1033,7 +1033,7 @@ function fetchImage(options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. @@ -1091,7 +1091,7 @@ Resource.prototype.fetchText = function () { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1152,7 +1152,7 @@ Resource.prototype.fetchJson = function () { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1201,7 +1201,7 @@ Resource.prototype.fetchXML = function () { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1304,7 +1304,7 @@ function fetchJsonp(resource, callbackParameterName, functionName) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1470,7 +1470,7 @@ Resource.prototype.fetch = function (options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1527,7 +1527,7 @@ Resource.prototype.delete = function (options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1584,7 +1584,7 @@ Resource.prototype.head = function (options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1640,7 +1640,7 @@ Resource.prototype.options = function (options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1702,7 +1702,7 @@ Resource.prototype.post = function (data, options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1763,7 +1763,7 @@ Resource.prototype.put = function (data, options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. @@ -1824,7 +1824,7 @@ Resource.prototype.patch = function (data, options) { * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {DefaultProxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 0107a47a9941..1a2131d7dfce 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -394,7 +394,7 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ArcGisMapServerImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index 716828a97034..dc85a634a6a2 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -246,7 +246,7 @@ Object.defineProperties(BingMapsImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof BingMapsImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index cabaaab557cc..ea2a89505a7c 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -185,7 +185,7 @@ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index 9e3bafde92a3..0e7db70310d4 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -293,7 +293,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GoogleEarthEnterpriseMapsProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index c8c84ae6f3af..1e875dbae900 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -63,7 +63,7 @@ Object.defineProperties(GridImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof GridImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index 0abe0a776a8f..d694a7c424af 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -233,7 +233,7 @@ Object.defineProperties(ImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof ImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index 5013bc89e081..a402e29ac4b4 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -264,7 +264,7 @@ Object.defineProperties(MapboxImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index 83228c035351..b0735ac01947 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -276,7 +276,7 @@ Object.defineProperties(MapboxStyleImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof MapboxStyleImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 1914251224ab..4a6ceaa73007 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -119,7 +119,7 @@ Object.defineProperties(SingleTileImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof SingleTileImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index 9e119a322fdf..2bbda41ac915 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -39,7 +39,7 @@ Object.defineProperties(TileCoordinatesImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof TileCoordinatesImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index 4585c38bab54..a51727bbbaa3 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -308,7 +308,7 @@ Object.defineProperties(UrlTemplateImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof UrlTemplateImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly * @default undefined */ diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 8d76c9223b3d..0532f40846e3 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -242,7 +242,7 @@ Object.defineProperties(WebMapServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapServiceImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 6703ba4c7965..093f958d02de 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -300,7 +300,7 @@ Object.defineProperties(WebMapTileServiceImageryProvider.prototype, { /** * Gets the proxy used by this provider. * @memberof WebMapTileServiceImageryProvider.prototype - * @type {DefaultProxy} + * @type {Proxy} * @readonly */ proxy: { diff --git a/Source/Widgets/Viewer/viewerDragDropMixin.js b/Source/Widgets/Viewer/viewerDragDropMixin.js index 06d7b7dbeffb..5130fb1e164c 100644 --- a/Source/Widgets/Viewer/viewerDragDropMixin.js +++ b/Source/Widgets/Viewer/viewerDragDropMixin.js @@ -20,7 +20,7 @@ import getElement from "../getElement.js"; * @param {Boolean} [options.clearOnDrop=true] When true, dropping files will clear all existing data sources first, when false, new data sources will be loaded after the existing ones. * @param {Boolean} [options.flyToOnDrop=true] When true, dropping files will fly to the data source once it is loaded. * @param {Boolean} [options.clampToGround=true] When true, datasources are clamped to the ground. - * @param {DefaultProxy} [options.proxy] The proxy to be used for KML network links. + * @param {Proxy} [options.proxy] The proxy to be used for KML network links. * * @exception {DeveloperError} Element with id does not exist in the document. * @exception {DeveloperError} dropTarget is already defined by another mixin. @@ -164,7 +164,7 @@ function viewerDragDropMixin(viewer, options) { /** * Gets or sets the proxy to be used for KML. * @memberof viewerDragDropMixin.prototype - * @type {DefaultProxy} + * @type {Proxy} */ proxy: { get: function () { From c90ac8fada60027acd8dd884bcc059df077baa9f Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 10:55:02 -0400 Subject: [PATCH 05/36] Add missing `update` function to all DataSource implementations Allows them to be assignable to `DataSource` in the TS definitions. --- Source/DataSources/CustomDataSource.js | 14 ++++++++++++++ Source/DataSources/CzmlDataSource.js | 13 +++++++++++++ Source/DataSources/DataSource.js | 5 +++-- Source/DataSources/GeoJsonDataSource.js | 13 +++++++++++++ Source/DataSources/KmlDataSource.js | 3 +-- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Source/DataSources/CustomDataSource.js b/Source/DataSources/CustomDataSource.js index 0332bfd5866c..eb14891e200e 100644 --- a/Source/DataSources/CustomDataSource.js +++ b/Source/DataSources/CustomDataSource.js @@ -156,4 +156,18 @@ Object.defineProperties(CustomDataSource.prototype, { }, }, }); + +/** + * Updates the data source to the provided time. This function is optional and + * is not required to be implemented. It is provided for data sources which + * retrieve data based on the current animation time or scene state. + * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * + * @param {JulianDate} time The simulation time. + * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise. + */ +CustomDataSource.prototype.update = function (time) { + return true; +}; + export default CustomDataSource; diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index b89fea89ed24..dd14ca4c8a5d 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -4858,6 +4858,19 @@ CzmlDataSource.prototype.load = function (czml, options) { return load(this, czml, options, true); }; +/** + * Updates the data source to the provided time. This function is optional and + * is not required to be implemented. It is provided for data sources which + * retrieve data based on the current animation time or scene state. + * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * + * @param {JulianDate} time The simulation time. + * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise. + */ +CzmlDataSource.prototype.update = function (time) { + return true; +}; + /** * A helper function used by custom CZML updater functions * which creates or updates a {@link Property} from a CZML packet. diff --git a/Source/DataSources/DataSource.js b/Source/DataSources/DataSource.js index f50dd3542ac2..182dac7602bf 100644 --- a/Source/DataSources/DataSource.js +++ b/Source/DataSources/DataSource.js @@ -96,12 +96,13 @@ Object.defineProperties(DataSource.prototype, { * is not required to be implemented. It is provided for data sources which * retrieve data based on the current animation time or scene state. * If implemented, update will be called by {@link DataSourceDisplay} once a frame. - * @function * * @param {JulianDate} time The simulation time. * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise. */ -DataSource.prototype.update = DeveloperError.throwInstantiationError; +DataSource.prototype.update = function (time) { + DeveloperError.throwInstantiationError(); +}; /** * @private diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js index 9f8972fcb0ef..c194705cb096 100644 --- a/Source/DataSources/GeoJsonDataSource.js +++ b/Source/DataSources/GeoJsonDataSource.js @@ -964,6 +964,19 @@ GeoJsonDataSource.prototype.load = function (data, options) { }); }; +/** + * Updates the data source to the provided time. This function is optional and + * is not required to be implemented. It is provided for data sources which + * retrieve data based on the current animation time or scene state. + * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * + * @param {JulianDate} time The simulation time. + * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise. + */ +GeoJsonDataSource.prototype.update = function (time) { + return true; +}; + function load(that, geoJson, options, sourceUri) { var name; if (defined(sourceUri)) { diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 63833fb6a62f..3a0d357dc78b 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -3865,8 +3865,7 @@ function getNetworkLinkUpdateCallback( var entitiesToIgnore = new AssociativeArray(); /** - * Updates any NetworkLink that require updating - * @function + * Updates any NetworkLink that require updating. * * @param {JulianDate} time The simulation time. * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise. From fbb66eb04bfef02b87708bcfa019f71026a56c75 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 15:45:27 -0400 Subject: [PATCH 06/36] JSDoc fixes to GregorianDate and TimeIntervalCollection --- Source/Core/GregorianDate.js | 9 +++++++++ Source/Core/TimeIntervalCollection.js | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/Core/GregorianDate.js b/Source/Core/GregorianDate.js index 72fe1beac700..cd4c53c1d1a3 100644 --- a/Source/Core/GregorianDate.js +++ b/Source/Core/GregorianDate.js @@ -4,6 +4,15 @@ * @alias GregorianDate * @constructor * + * @param {Number} [year] The year as a whole number. + * @param {Number} [month] The month as a whole number with range [1, 12]. + * @param {Number} [day] The day of the month as a whole number starting at 1. + * @param {Number} [hour] The hour as a whole number with range [0, 23]. + * @param {Number} [minute] The minute of the hour as a whole number with range [0, 59]. + * @param {Number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second. + * @param {Number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0). + * @param {Boolean} [isLeapSecond] Whether this time is during a leap second. + * * @see JulianDate#toGregorianDate */ function GregorianDate( diff --git a/Source/Core/TimeIntervalCollection.js b/Source/Core/TimeIntervalCollection.js index f4e1d135a576..ba087ab14838 100644 --- a/Source/Core/TimeIntervalCollection.js +++ b/Source/Core/TimeIntervalCollection.js @@ -157,7 +157,7 @@ TimeIntervalCollection.prototype.equals = function (right, dataComparer) { * Gets the interval at the specified index. * * @param {Number} index The index of the interval to retrieve. - * @returns {TimeInterval} The interval at the specified index, or undefined if no interval exists as that index. + * @returns {TimeInterval|undefined} The interval at the specified index, or undefined if no interval exists as that index. */ TimeIntervalCollection.prototype.get = function (index) { //>>includeStart('debug', pragmas.debug); @@ -274,7 +274,7 @@ TimeIntervalCollection.prototype.indexOf = function (date) { * @param {JulianDate} [options.stop] The stop time of the interval. * @param {Boolean} [options.isStartIncluded] true if options.start is included in the interval, false otherwise. * @param {Boolean} [options.isStopIncluded] true if options.stop is included in the interval, false otherwise. - * @returns {TimeInterval} The first interval in the collection that matches the specified parameters. + * @returns {TimeInterval|undefined} The first interval in the collection that matches the specified parameters. */ TimeIntervalCollection.prototype.findInterval = function (options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); From 0ad8cbd7fc27d1ecc31d162d846e623ea037f81b Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 15:57:47 -0400 Subject: [PATCH 07/36] Fix JSDoc for exportKml --- Source/DataSources/exportKml.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index bcb9ce080dc8..ec8a19258cf2 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -222,6 +222,19 @@ IdManager.prototype.get = function (id) { return id.toString() + "-" + ++ids[id]; }; +/** + * @typedef exportKmlResultKml + * @type {Object} + * @property {String} kml The generated KML. + * @property {Object.} externalFiles An object dictionary of external files + */ + +/** + * @typedef exportKmlResultKmz + * @type {Object} + * @property {Blob} kmz The generated kmz file. + */ + /** * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For @@ -243,7 +256,7 @@ IdManager.prototype.get = function (id) { * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. * @param {Boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file. * - * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. + * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. * @demo {@link https://sandcastle.cesium.com/index.html?src=Export%20KML.html|Cesium Sandcastle KML Export Demo} * @example * Cesium.exportKml({ From eb22bf367e01295998f565f329f882b9bcaf8e66 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 18:08:19 -0400 Subject: [PATCH 08/36] Additional JSDoc/TypeScript fixes. --- Source/DataSources/exportKml.js | 2 +- .../Scene/ArcGisMapServerImageryProvider.js | 68 ++++++++++++++++ Source/Scene/BingMapsImageryProvider.js | 78 ++++++++++++++++--- .../GoogleEarthEnterpriseImageryProvider.js | 68 ++++++++++++++++ .../GoogleEarthEnterpriseMapsProvider.js | 78 ++++++++++++++++--- Source/Scene/GridImageryProvider.js | 68 ++++++++++++++++ Source/Scene/ImageryProvider.js | 22 ++++-- Source/Scene/MapboxImageryProvider.js | 68 ++++++++++++++++ Source/Scene/MapboxStyleImageryProvider.js | 68 ++++++++++++++++ Source/Scene/OpenStreetMapImageryProvider.js | 1 + Source/Scene/SingleTileImageryProvider.js | 68 ++++++++++++++++ .../Scene/TileCoordinatesImageryProvider.js | 68 ++++++++++++++++ Source/Scene/TileMapServiceImageryProvider.js | 1 + Source/Scene/UrlTemplateImageryProvider.js | 68 ++++++++++++++++ Source/Scene/WebMapServiceImageryProvider.js | 68 ++++++++++++++++ .../Scene/WebMapTileServiceImageryProvider.js | 68 ++++++++++++++++ 16 files changed, 835 insertions(+), 27 deletions(-) diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index ec8a19258cf2..46c1fa16de9e 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -226,7 +226,7 @@ IdManager.prototype.get = function (id) { * @typedef exportKmlResultKml * @type {Object} * @property {String} kml The generated KML. - * @property {Object.} externalFiles An object dictionary of external files + * @property {Object.} externalFiles An object dictionary of external files */ /** diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 1a2131d7dfce..9ee092a137e2 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -90,6 +90,74 @@ function ArcGisMapServerImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded(options.url); resource.appendForwardSlash(); diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index dc85a634a6a2..059f45d18510 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -69,6 +69,74 @@ function BingMapsImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default 1.0 + */ + this.defaultGamma = 1.0; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + this._key = BingMapsApi.getKey(options.key); this._resource = Resource.createIfNeeded(options.url); this._resource.appendForwardSlash(); @@ -88,16 +156,6 @@ function BingMapsImageryProvider(options) { '" title="Bing Imagery"/>' ); - /** - * The default {@link ImageryLayer#gamma} to use for imagery layers created for this provider. - * Changing this value after creating an {@link ImageryLayer} for this provider will have - * no effect. Instead, set the layer's {@link ImageryLayer#gamma} property. - * - * @type {Number} - * @default 1.0 - */ - this.defaultGamma = 1.0; - this._tilingScheme = new WebMercatorTilingScheme({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 2, diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index ea2a89505a7c..a179b0b5a136 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -89,6 +89,74 @@ function GoogleEarthEnterpriseImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var metadata; if (defined(options.metadata)) { metadata = options.metadata; diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index 0e7db70310d4..f32f24ca16ab 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -94,6 +94,74 @@ function GoogleEarthEnterpriseMapsProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default 1.9 + */ + this.defaultGamma = 1.9; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var url = options.url; var path = defaultValue(options.path, "/default_map"); @@ -116,16 +184,6 @@ function GoogleEarthEnterpriseMapsProvider(options) { '" title="Google Imagery"/>' ); - /** - * The default {@link ImageryLayer#gamma} to use for imagery layers created for this provider. - * By default, this is set to 1.9. Changing this value after creating an {@link ImageryLayer} for this provider will have - * no effect. Instead, set the layer's {@link ImageryLayer#gamma} property. - * - * @type {Number} - * @default 1.9 - */ - this.defaultGamma = 1.9; - this._tilingScheme = undefined; this._version = undefined; diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index 1e875dbae900..bd6210a13d88 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -33,6 +33,74 @@ var defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2); function GridImageryProvider(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + this._tilingScheme = defined(options.tilingScheme) ? options.tilingScheme : new GeographicTilingScheme({ ellipsoid: options.ellipsoid }); diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js index d694a7c424af..3e140c3f7ccf 100644 --- a/Source/Scene/ImageryProvider.js +++ b/Source/Scene/ImageryProvider.js @@ -19,6 +19,7 @@ import Resource from "../Core/Resource.js"; * @see GoogleEarthEnterpriseImageryProvider * @see GoogleEarthEnterpriseMapsProvider * @see GridImageryProvider + * @see IonImageryProvider * @see MapboxImageryProvider * @see MapboxStyleImageryProvider * @see SingleTileImageryProvider @@ -257,7 +258,6 @@ Object.defineProperties(ImageryProvider.prototype, { /** * Gets the credits to be displayed when a given tile is displayed. - * @function * * @param {Number} x The tile X coordinate. * @param {Number} y The tile Y coordinate. @@ -266,13 +266,13 @@ Object.defineProperties(ImageryProvider.prototype, { * * @exception {DeveloperError} getTileCredits must not be called before the imagery provider is ready. */ -ImageryProvider.prototype.getTileCredits = - DeveloperError.throwInstantiationError; +ImageryProvider.prototype.getTileCredits = function (x, y, level) { + DeveloperError.throwInstantiationError(); +}; /** * Requests the image for a given tile. This function should * not be called before {@link ImageryProvider#ready} returns true. - * @function * * @param {Number} x The tile X coordinate. * @param {Number} y The tile Y coordinate. @@ -285,7 +285,9 @@ ImageryProvider.prototype.getTileCredits = * * @exception {DeveloperError} requestImage must not be called before the imagery provider is ready. */ -ImageryProvider.prototype.requestImage = DeveloperError.throwInstantiationError; +ImageryProvider.prototype.requestImage = function (x, y, level, request) { + DeveloperError.throwInstantiationError(); +}; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within @@ -306,7 +308,15 @@ ImageryProvider.prototype.requestImage = DeveloperError.throwInstantiationError; * * @exception {DeveloperError} pickFeatures must not be called before the imagery provider is ready. */ -ImageryProvider.prototype.pickFeatures = DeveloperError.throwInstantiationError; +ImageryProvider.prototype.pickFeatures = function ( + x, + y, + level, + longitude, + latitude +) { + DeveloperError.throwInstantiationError(); +}; var ktxRegex = /\.ktx$/i; var crnRegex = /\.crn$/i; diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index a402e29ac4b4..d090fa4919d1 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -50,6 +50,74 @@ function MapboxImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded( defaultValue(options.url, "https://{s}.tiles.mapbox.com/v4/") ); diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index b0735ac01947..6881d92e8b74 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -52,6 +52,74 @@ function MapboxStyleImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded( defaultValue(options.url, "https://api.mapbox.com/styles/v1/") ); diff --git a/Source/Scene/OpenStreetMapImageryProvider.js b/Source/Scene/OpenStreetMapImageryProvider.js index 7f869ee5cae4..27e2dca57804 100644 --- a/Source/Scene/OpenStreetMapImageryProvider.js +++ b/Source/Scene/OpenStreetMapImageryProvider.js @@ -19,6 +19,7 @@ var defaultCredit = new Credit( * * @alias OpenStreetMapImageryProvider * @constructor + * @extends UrlTemplateImageryProvider * * @param {Object} [options] Object with the following properties: * @param {String} [options.url='https://a.tile.openstreetmap.org'] The OpenStreetMap server url. diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 4a6ceaa73007..1eb7cd9a3bff 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -41,6 +41,74 @@ function SingleTileImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded(options.url); var rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE); diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index 2bbda41ac915..796d1bcb3872 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -33,6 +33,74 @@ function TileCoordinatesImageryProvider(options) { this._tileWidth = defaultValue(options.tileWidth, 256); this._tileHeight = defaultValue(options.tileHeight, 256); this._readyPromise = when.resolve(true); + + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; } Object.defineProperties(TileCoordinatesImageryProvider.prototype, { diff --git a/Source/Scene/TileMapServiceImageryProvider.js b/Source/Scene/TileMapServiceImageryProvider.js index 9f16e1e8392d..9e2aaa9ce9ff 100644 --- a/Source/Scene/TileMapServiceImageryProvider.js +++ b/Source/Scene/TileMapServiceImageryProvider.js @@ -19,6 +19,7 @@ import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; * * @alias TileMapServiceImageryProvider * @constructor + * @extends UrlTemplateImageryProvider * * @param {Object} [options] Object with the following properties: * @param {Resource|String|Promise|Promise} [options.url='.'] Path to image tiles on server. diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index a51727bbbaa3..ae164767d243 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -209,6 +209,74 @@ function UrlTemplateImageryProvider(options) { this._tags = undefined; this._pickFeaturesTags = undefined; + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will * request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 0532f40846e3..53c4a280dcab 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -87,6 +87,74 @@ function WebMapServiceImageryProvider(options) { ); } + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded(options.url); var pickFeatureResource = resource.clone(); diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 093f958d02de..401c5ba56012 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -130,6 +130,74 @@ function WebMapTileServiceImageryProvider(options) { } //>>includeEnd('debug'); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + * 1.0 representing fully opaque. + * + * @type {Number} + * @default undefined + */ + this.defaultAlpha = undefined; + + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + * makes the imagery darker while greater than 1.0 makes it brighter. + * + * @type {Number} + * @default undefined + */ + this.defaultBrightness = undefined; + + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + * the contrast while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultContrast = undefined; + + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultHue = undefined; + + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + * saturation while greater than 1.0 increases it. + * + * @type {Number} + * @default undefined + */ + this.defaultSaturation = undefined; + + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + * + * @type {Number} + * @default undefined + */ + this.defaultGamma = undefined; + + /** + * The default texture minification filter to apply to this provider. + * + * @type {TextureMinificationFilter} + * @default undefined + */ + this.defaultMinificationFilter = undefined; + + /** + * The default texture magnification filter to apply to this provider. + * + * @type {TextureMagnificationFilter} + * @default undefined + */ + this.defaultMagnificationFilter = undefined; + var resource = Resource.createIfNeeded(options.url); var style = options.style; From 5c346ed29098b538f9658adfb01989f38c8ca197 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 18:17:30 -0400 Subject: [PATCH 09/36] Make IonImageryProvider actually implement all ImageryProvider properties --- Source/Scene/IonImageryProvider.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index 0a636594c1a1..45da7ec8cab7 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -420,6 +420,19 @@ Object.defineProperties(IonImageryProvider.prototype, { //>>includeEnd('debug'); return this._imageryProvider.hasAlphaChannel; }, + + /** + * Gets the proxy used by this provider. + * @memberof IonImageryProvider.prototype + * @type {Proxy} + * @readonly + * @default undefined + */ + proxy: { + get: function () { + return undefined; + }, + }, }, }); From 6185b189a8e9ccfeed5f2cd5859400cceb383473 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 19:04:55 -0400 Subject: [PATCH 10/36] More TypeScript fixes 1. Make Matrix 2/3/4 ArrayLike objects 2. Make PropertyBag include a string indexor so that it is a dictionary like object. We do this by making up a new private interface and defining it only in the definition file. JSDoc ignores it in the HTML output. --- Source/Core/Matrix2.js | 1 + Source/Core/Matrix3.js | 1 + Source/Core/Matrix4.js | 1 + Source/DataSources/PropertyBag.js | 1 + gulpfile.cjs | 14 ++++++++++++-- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js index 1e617774f9e6..e3a91145ab99 100644 --- a/Source/Core/Matrix2.js +++ b/Source/Core/Matrix2.js @@ -8,6 +8,7 @@ import defined from "./defined.js"; * Constructor parameters are in row-major order for code readability. * @alias Matrix2 * @constructor + * @implements {ArrayLike} * * @param {Number} [column0Row0=0.0] The value for column 0, row 0. * @param {Number} [column1Row0=0.0] The value for column 1, row 0. diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index e6b21a51dd61..f01c549fc61c 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -10,6 +10,7 @@ import CesiumMath from "./Math.js"; * Constructor parameters are in row-major order for code readability. * @alias Matrix3 * @constructor + * @implements {ArrayLike} * * @param {Number} [column0Row0=0.0] The value for column 0, row 0. * @param {Number} [column1Row0=0.0] The value for column 1, row 0. diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js index 16b264197116..1d9d53620814 100644 --- a/Source/Core/Matrix4.js +++ b/Source/Core/Matrix4.js @@ -12,6 +12,7 @@ import RuntimeError from "./RuntimeError.js"; * Constructor parameters are in row-major order for code readability. * @alias Matrix4 * @constructor + * @implements {ArrayLike} * * @param {Number} [column0Row0=0.0] The value for column 0, row 0. * @param {Number} [column1Row0=0.0] The value for column 1, row 0. diff --git a/Source/DataSources/PropertyBag.js b/Source/DataSources/PropertyBag.js index 4d356a462df2..688053f4c7ae 100644 --- a/Source/DataSources/PropertyBag.js +++ b/Source/DataSources/PropertyBag.js @@ -11,6 +11,7 @@ import Property from "./Property.js"; * * @alias PropertyBag * @constructor + * @implements {DictionaryLike} * * @param {Object} [value] An object, containing key-value mapping of property names to properties. * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property. diff --git a/gulpfile.cjs b/gulpfile.cjs index 6af5edf42c0d..37962b42b762 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1563,8 +1563,18 @@ function createTypeScriptDefinitions() { (match, p1) => `= WebGLConstants.${p1}` ); - // Wrap the source to actually be inside of a declared cesium module. - source = 'declare module "cesium" {\n' + source + "}\n"; + // Wrap the source to actually be inside of a declared cesium module + // and any any workaround and private utility types. + source = `declare module "cesium" { +/** + * Private interface to support PropertyBag being a dictionary-like object. + */ +interface DictionaryLike { + [index: string]: Property; +} + +${source} +}`; // Map individual modules back to their source file so that TS still works // when importing individual files instead of the entire cesium module. From 16924c3749b5ac76fbc1bbf89db8deea6e8b82e9 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 19:10:34 -0400 Subject: [PATCH 11/36] Update CHANGES Fix bad commit. --- CHANGES.md | 6 ++++++ gulpfile.cjs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4a5c3a43d161..ccff77ac2fb3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,12 @@ ### 1.70.0 - 2020-06-01 +##### Major Announcements :loudspeaker: + +- Cesium now ships with official TypeScript type definitions! + - If you import Cesium as a module, the new definitions will automatically be used by TypeScript and related tooling. + - If you import individual Cesium source files directly, you'll need to add `"types": ["cesium"]` in your tsconfig.json in order for the definitions to be used. + ##### Additions :tada: - Added support for rendering the globe with translucency. [#8726](https://github.com/CesiumGS/cesium/pull/8726) diff --git a/gulpfile.cjs b/gulpfile.cjs index 37962b42b762..5a7aba9030f0 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1570,7 +1570,7 @@ function createTypeScriptDefinitions() { * Private interface to support PropertyBag being a dictionary-like object. */ interface DictionaryLike { - [index: string]: Property; + [index: string]: any; } ${source} From 4d32df1df5ec09c635eb333621df8f268bca2bc9 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 19:28:24 -0400 Subject: [PATCH 12/36] Number[] -> number[] in TS definition Add workaround for https://github.com/englercj/tsd-jsdoc/issues/117 --- gulpfile.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/gulpfile.cjs b/gulpfile.cjs index 5a7aba9030f0..9275d3c722c6 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1558,6 +1558,7 @@ function createTypeScriptDefinitions() { source = source .replace(/^declare /gm, "export ") .replace(/CesiumMath/gm, "Math") + .replace(/Number\[]/gm, "number[]") // Workaround https://github.com/englercj/tsd-jsdoc/issues/117 .replace( /= "WebGLConstants\.(.+)"/gm, (match, p1) => `= WebGLConstants.${p1}` From c231dc4b7a5f8c717edd1110f293dd05669a6962 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 19:54:40 -0400 Subject: [PATCH 13/36] Fix Event.raiseEvent TS generation. --- Source/Core/Event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 32d0919cc9b4..99001dc5fce5 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -119,7 +119,7 @@ function compareNumber(a, b) { /** * Raises the event by calling each registered listener with all supplied arguments. * - * @param {*} arguments This method takes any number of parameters and passes them through to the listener functions. + * @param {...Object} arguments This method takes any number of parameters and passes them through to the listener functions. * * @see Event#addEventListener * @see Event#removeEventListener From 60d46107453fe00b54cc9cb9d796c6d9a200f21e Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 22:30:07 -0400 Subject: [PATCH 14/36] Add missing availability property to TerrainProvider classes. --- Source/Core/EllipsoidTerrainProvider.js | 13 +++++++++++++ Source/Core/VRTheWorldTerrainProvider.js | 13 +++++++++++++ Source/Scene/ArcGisMapServerImageryProvider.js | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/Source/Core/EllipsoidTerrainProvider.js b/Source/Core/EllipsoidTerrainProvider.js index d22b4f58f63d..91b71b9c3064 100644 --- a/Source/Core/EllipsoidTerrainProvider.js +++ b/Source/Core/EllipsoidTerrainProvider.js @@ -132,6 +132,19 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, { return false; }, }, + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link TerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof EllipsoidTerrainProvider.prototype + * @type {TileAvailability} + */ + availability: { + get: function () { + return undefined; + }, + }, }); /** diff --git a/Source/Core/VRTheWorldTerrainProvider.js b/Source/Core/VRTheWorldTerrainProvider.js index dd54dd1ca541..fc75acc64ce8 100644 --- a/Source/Core/VRTheWorldTerrainProvider.js +++ b/Source/Core/VRTheWorldTerrainProvider.js @@ -245,6 +245,19 @@ Object.defineProperties(VRTheWorldTerrainProvider.prototype, { return false; }, }, + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link TerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof VRTheWorldTerrainProvider.prototype + * @type {TileAvailability} + */ + availability: { + get: function () { + return undefined; + }, + }, }); /** diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 9ee092a137e2..36679a82cff2 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -717,6 +717,19 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { return this._layers; }, }, + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link TerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof ArcGisMapServerImageryProvider.prototype + * @type {TileAvailability} + */ + availability: { + get: function () { + return undefined; + }, + }, }); /** From ce5b33e9eba54ed5c906e5a5b920032ac17d6c1f Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 22:35:00 -0400 Subject: [PATCH 15/36] Whoops --- Source/Core/ArcGISTiledElevationTerrainProvider.js | 13 +++++++++++++ Source/Scene/ArcGisMapServerImageryProvider.js | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Core/ArcGISTiledElevationTerrainProvider.js b/Source/Core/ArcGISTiledElevationTerrainProvider.js index 5284fa54226d..19058e16cd03 100644 --- a/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -294,6 +294,19 @@ Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, { return false; }, }, + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link TerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof ArcGISTiledElevationTerrainProvider.prototype + * @type {TileAvailability} + */ + availability: { + get: function () { + return undefined; + }, + }, }); /** diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 36679a82cff2..9ee092a137e2 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -717,19 +717,6 @@ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, { return this._layers; }, }, - /** - * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link TerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. - * @memberof ArcGisMapServerImageryProvider.prototype - * @type {TileAvailability} - */ - availability: { - get: function () { - return undefined; - }, - }, }); /** From e360dfcb4ec4af352de6230c760a320b74a8d581 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 22:45:18 -0400 Subject: [PATCH 16/36] More JSDoc fixes and TS improvements 1. Resource has incorrect return types. 2. Improve formatting of TS definition file. --- Source/Core/Resource.js | 36 ++++++++++++++++++------------------ gulpfile.cjs | 5 ++++- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index 404701e8f31f..c3fea4c508a6 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -1111,7 +1111,7 @@ Resource.fetchText = function (options) { * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not * already specified. * - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1156,7 +1156,7 @@ Resource.prototype.fetchJson = function () { * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.fetchJson = function (options) { var resource = new Resource(options); @@ -1216,7 +1216,7 @@ Resource.fetchXML = function (options) { * Requests a resource using JSONP. * * @param {String} [callbackParameterName='callback'] The callback parameter name that the server expects. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1309,7 +1309,7 @@ function fetchJsonp(resource, callbackParameterName, functionName) { * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.fetchJsonp = function (options) { var resource = new Resource(options); @@ -1441,7 +1441,7 @@ function decodeDataUri(dataUriRegexResult, responseType) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1476,7 +1476,7 @@ Resource.prototype.fetch = function (options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.fetch = function (options) { var resource = new Resource(options); @@ -1497,7 +1497,7 @@ Resource.fetch = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1533,7 +1533,7 @@ Resource.prototype.delete = function (options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.delete = function (options) { var resource = new Resource(options); @@ -1555,7 +1555,7 @@ Resource.delete = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1590,7 +1590,7 @@ Resource.prototype.head = function (options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.head = function (options) { var resource = new Resource(options); @@ -1611,7 +1611,7 @@ Resource.head = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1646,7 +1646,7 @@ Resource.prototype.options = function (options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.options = function (options) { var resource = new Resource(options); @@ -1669,7 +1669,7 @@ Resource.options = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1708,7 +1708,7 @@ Resource.prototype.post = function (data, options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.post = function (options) { var resource = new Resource(options); @@ -1730,7 +1730,7 @@ Resource.post = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1769,7 +1769,7 @@ Resource.prototype.put = function (data, options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.put = function (options) { var resource = new Resource(options); @@ -1791,7 +1791,7 @@ Resource.put = function (options) { * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. * * * @example @@ -1830,7 +1830,7 @@ Resource.prototype.patch = function (data, options) { * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * @param {String} [options.responseType] The type of response. This controls the type of item returned. * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server. - * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ Resource.patch = function (options) { var resource = new Resource(options); diff --git a/gulpfile.cjs b/gulpfile.cjs index 9275d3c722c6..8192733597a3 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1567,6 +1567,7 @@ function createTypeScriptDefinitions() { // Wrap the source to actually be inside of a declared cesium module // and any any workaround and private utility types. source = `declare module "cesium" { + /** * Private interface to support PropertyBag being a dictionary-like object. */ @@ -1575,7 +1576,9 @@ interface DictionaryLike { } ${source} -}`; +} + +`; // Map individual modules back to their source file so that TS still works // when importing individual files instead of the entire cesium module. From c2bd092c778aa385a433093e02e4d269ae647c68 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Wed, 27 May 2020 22:58:30 -0400 Subject: [PATCH 17/36] Don't abuse EllipsoidTerrainProvider. --- Specs/MockTerrainProvider.js | 1 + Specs/Scene/computeFlyToLocationForRectangleSpec.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Specs/MockTerrainProvider.js b/Specs/MockTerrainProvider.js index c44d2d4d0471..3688a8b39663 100644 --- a/Specs/MockTerrainProvider.js +++ b/Specs/MockTerrainProvider.js @@ -16,6 +16,7 @@ function MockTerrainProvider() { this.tilingScheme.getNumberOfXTilesAtLevel(0) ); this.ready = true; + this.readyPromise = when.resolve(); this.hasWaterMask = true; this._tileDataAvailable = {}; diff --git a/Specs/Scene/computeFlyToLocationForRectangleSpec.js b/Specs/Scene/computeFlyToLocationForRectangleSpec.js index 24c4069c14ab..872c84c1a628 100644 --- a/Specs/Scene/computeFlyToLocationForRectangleSpec.js +++ b/Specs/Scene/computeFlyToLocationForRectangleSpec.js @@ -1,10 +1,10 @@ -import { EllipsoidTerrainProvider } from "../../Source/Cesium.js"; import { Rectangle } from "../../Source/Cesium.js"; import { computeFlyToLocationForRectangle } from "../../Source/Cesium.js"; import { Globe } from "../../Source/Cesium.js"; import { SceneMode } from "../../Source/Cesium.js"; import createScene from "../createScene.js"; import { when } from "../../Source/Cesium.js"; +import MockTerrainProvider from "../MockTerrainProvider.js"; describe("Scene/computeFlyToLocationForRectangle", function () { var scene; @@ -19,7 +19,7 @@ describe("Scene/computeFlyToLocationForRectangle", function () { function sampleTest(sceneMode) { //Pretend we have terrain with availability. - var terrainProvider = new EllipsoidTerrainProvider(); + var terrainProvider = new MockTerrainProvider(); terrainProvider.availability = {}; scene.globe = new Globe(); @@ -86,7 +86,7 @@ describe("Scene/computeFlyToLocationForRectangle", function () { }); it("returns height above ellipsoid when in 2D", function () { - var terrainProvider = new EllipsoidTerrainProvider(); + var terrainProvider = new MockTerrainProvider(); terrainProvider.availability = {}; scene.globe = new Globe(); @@ -111,7 +111,7 @@ describe("Scene/computeFlyToLocationForRectangle", function () { it("returns height above ellipsoid when terrain not available", function () { scene.globe = new Globe(); - scene.terrainProvider = new EllipsoidTerrainProvider(); + scene.terrainProvider = new MockTerrainProvider(); var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); @@ -130,7 +130,7 @@ describe("Scene/computeFlyToLocationForRectangle", function () { }); it("waits for terrain to become ready", function () { - var terrainProvider = new EllipsoidTerrainProvider(); + var terrainProvider = new MockTerrainProvider(); spyOn(terrainProvider.readyPromise, "then").and.callThrough(); scene.globe = new Globe(); From 890aaaecbe3e75ede2d098de737f26b6734702a6 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 28 May 2020 21:43:54 +1000 Subject: [PATCH 18/36] Lots of small changes to improve the typescript definitions. --- Source/Core/BingMapsApi.js | 6 + Source/DataSources/BillboardGraphics.js | 40 +++--- Source/DataSources/BoxGraphics.js | 18 +-- Source/DataSources/Cesium3DTilesetGraphics.js | 6 +- Source/DataSources/CorridorGraphics.js | 36 ++--- Source/DataSources/CylinderGraphics.js | 28 ++-- Source/DataSources/EllipseGraphics.js | 40 +++--- Source/DataSources/EllipsoidGraphics.js | 34 ++--- Source/DataSources/Entity.js | 52 +++---- Source/DataSources/KmlDataSource.js | 2 +- Source/DataSources/LabelGraphics.js | 42 +++--- Source/DataSources/ModelGraphics.js | 38 ++--- Source/DataSources/PathGraphics.js | 12 +- Source/DataSources/PlaneGraphics.js | 18 +-- Source/DataSources/PointGraphics.js | 20 +-- Source/DataSources/PolygonGraphics.js | 40 +++--- Source/DataSources/PolylineGraphics.js | 20 +-- Source/DataSources/PolylineVolumeGraphics.js | 22 +-- Source/DataSources/RectangleGraphics.js | 34 ++--- Source/DataSources/WallGraphics.js | 22 +-- Source/Scene/Axis.js | 134 +++++++++--------- Source/Scene/Cesium3DTileFeature.js | 2 +- Source/Scene/Cesium3DTilePointFeature.js | 2 +- Source/Scene/Cesium3DTileset.js | 2 +- Source/Scene/ImageryLayerFeatureInfo.js | 10 +- Source/Scene/Scene.js | 7 +- gulpfile.cjs | 3 + 27 files changed, 349 insertions(+), 341 deletions(-) diff --git a/Source/Core/BingMapsApi.js b/Source/Core/BingMapsApi.js index 6b2cbad640b2..4b8ce8feaa5b 100644 --- a/Source/Core/BingMapsApi.js +++ b/Source/Core/BingMapsApi.js @@ -19,6 +19,12 @@ var BingMapsApi = {}; */ BingMapsApi.defaultKey = undefined; +/** + * Gets the key to use to access the Bing Maps API. If the provided + * key is defined, it is returned. Otherwise, returns {@link BingMapsApi.defaultKey}. + * @param {string|null|undefined} providedKey The provided key to use if defined. + * @returns {string|undefined} The Bing Maps API key to use. + */ BingMapsApi.getKey = function (providedKey) { if (defined(providedKey)) { return providedKey; diff --git a/Source/DataSources/BillboardGraphics.js b/Source/DataSources/BillboardGraphics.js index e6cb06452cd9..e96da59d0f90 100644 --- a/Source/DataSources/BillboardGraphics.js +++ b/Source/DataSources/BillboardGraphics.js @@ -103,7 +103,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the billboard. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -111,7 +111,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ image: createPropertyDescriptor("image"), @@ -125,7 +125,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * *

    * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ scale: createPropertyDescriptor("scale"), @@ -145,7 +145,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * *

    * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cartesian2.ZERO */ pixelOffset: createPropertyDescriptor("pixelOffset"), @@ -170,7 +170,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * *

    * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cartesian3.ZERO */ eyeOffset: createPropertyDescriptor("eyeOffset"), @@ -178,7 +178,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HorizontalOrigin}. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HorizontalOrigin.CENTER */ horizontalOrigin: createPropertyDescriptor("horizontalOrigin"), @@ -186,7 +186,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the Property specifying the {@link VerticalOrigin}. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default VerticalOrigin.CENTER */ verticalOrigin: createPropertyDescriptor("verticalOrigin"), @@ -194,7 +194,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -214,7 +214,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * *

    * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.WHITE */ color: createPropertyDescriptor("color"), @@ -223,7 +223,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * Gets or sets the numeric Property specifying the rotation of the image * counter clockwise from the alignedAxis. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ rotation: createPropertyDescriptor("rotation"), @@ -232,7 +232,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cartesian3.ZERO */ alignedAxis: createPropertyDescriptor("alignedAxis"), @@ -240,7 +240,7 @@ Object.defineProperties(BillboardGraphics.prototype, { /** * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ sizeInMeters: createPropertyDescriptor("sizeInMeters"), @@ -249,7 +249,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * Gets or sets the numeric Property specifying the width of the billboard in pixels. * When undefined, the native width is used. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ width: createPropertyDescriptor("width"), @@ -257,7 +257,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * Gets or sets the numeric Property specifying the height of the billboard in pixels. * When undefined, the native height is used. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ height: createPropertyDescriptor("height"), @@ -268,7 +268,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ scaleByDistance: createPropertyDescriptor("scaleByDistance"), @@ -279,7 +279,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ translucencyByDistance: createPropertyDescriptor("translucencyByDistance"), @@ -290,7 +290,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ pixelOffsetScaleByDistance: createPropertyDescriptor( "pixelOffsetScaleByDistance" @@ -301,14 +301,14 @@ Object.defineProperties(BillboardGraphics.prototype, { * sub-region of the image to use for the billboard, rather than the entire image, * measured in pixels from the bottom-left. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ imageSubRegion: createPropertyDescriptor("imageSubRegion"), /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -318,7 +318,7 @@ Object.defineProperties(BillboardGraphics.prototype, { * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. * @memberof BillboardGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( "disableDepthTestDistance" diff --git a/Source/DataSources/BoxGraphics.js b/Source/DataSources/BoxGraphics.js index 981782d7d6fa..db4c4dc2a6d1 100644 --- a/Source/DataSources/BoxGraphics.js +++ b/Source/DataSources/BoxGraphics.js @@ -67,7 +67,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the box. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -82,7 +82,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -90,7 +90,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the box is filled with the provided material. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -98,7 +98,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the material used to fill the box. * @memberof BoxGraphics.prototype - * @type {MaterialProperty} + * @type {MaterialProperty|undefined} * @default Color.WHITE */ material: createMaterialPropertyDescriptor("material"), @@ -106,7 +106,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the Property specifying whether the box is outlined. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -114,7 +114,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -122,7 +122,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -131,7 +131,7 @@ Object.defineProperties(BoxGraphics.prototype, { * Get or sets the enum Property specifying whether the box * casts or receives shadows from light sources. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -139,7 +139,7 @@ Object.defineProperties(BoxGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed. * @memberof BoxGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/Cesium3DTilesetGraphics.js b/Source/DataSources/Cesium3DTilesetGraphics.js index 9a76ece06a0e..c826ea25757e 100644 --- a/Source/DataSources/Cesium3DTilesetGraphics.js +++ b/Source/DataSources/Cesium3DTilesetGraphics.js @@ -45,7 +45,7 @@ Object.defineProperties(Cesium3DTilesetGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the model. * @memberof Cesium3DTilesetGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -53,14 +53,14 @@ Object.defineProperties(Cesium3DTilesetGraphics.prototype, { /** * Gets or sets the string Property specifying the URI of the glTF asset. * @memberof Cesium3DTilesetGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ uri: createPropertyDescriptor("uri"), /** * Gets or sets the maximum screen space error used to drive level of detail refinement. * @memberof Cesium3DTilesetGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ maximumScreenSpaceError: createPropertyDescriptor("maximumScreenSpaceError"), }); diff --git a/Source/DataSources/CorridorGraphics.js b/Source/DataSources/CorridorGraphics.js index bf529b5a75a8..b19f77448e28 100644 --- a/Source/DataSources/CorridorGraphics.js +++ b/Source/DataSources/CorridorGraphics.js @@ -94,7 +94,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the corridor. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -102,21 +102,21 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ positions: createPropertyDescriptor("positions"), /** * Gets or sets the numeric Property specifying the width of the corridor. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ width: createPropertyDescriptor("width"), /** * Gets or sets the numeric Property specifying the altitude of the corridor. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ height: createPropertyDescriptor("height"), @@ -124,7 +124,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -134,14 +134,14 @@ Object.defineProperties(CorridorGraphics.prototype, { * Setting this property creates a corridor shaped volume starting at height and ending * at this altitude. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ extrudedHeight: createPropertyDescriptor("extrudedHeight"), /** * Gets or sets the Property specifying the extruded {@link HeightReference}. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ extrudedHeightReference: createPropertyDescriptor("extrudedHeightReference"), @@ -149,7 +149,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the {@link CornerType} Property specifying how corners are styled. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default CornerType.ROUNDED */ cornerType: createPropertyDescriptor("cornerType"), @@ -157,7 +157,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -165,7 +165,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -173,7 +173,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the Property specifying the material used to fill the corridor. * @memberof CorridorGraphics.prototype - * @type {MaterialProperty} + * @type {MaterialProperty|undefined} * @default Color.WHITE */ material: createMaterialPropertyDescriptor("material"), @@ -181,7 +181,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the Property specifying whether the corridor is outlined. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -189,7 +189,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -197,7 +197,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -206,7 +206,7 @@ Object.defineProperties(CorridorGraphics.prototype, { * Get or sets the enum Property specifying whether the corridor * casts or receives shadows from light sources. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -214,7 +214,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -223,7 +223,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. * @memberof CorridorGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ClassificationType.BOTH */ classificationType: createPropertyDescriptor("classificationType"), @@ -231,7 +231,7 @@ Object.defineProperties(CorridorGraphics.prototype, { /** * Gets or sets the zIndex Property specifying the ordering of the corridor. Only has an effect if the coridor is static and neither height or exturdedHeight are specified. * @memberof CorridorGraphics.prototype - * @type {ConstantProperty} + * @type {ConstantProperty|undefined} * @default 0 */ zIndex: createPropertyDescriptor("zIndex"), diff --git a/Source/DataSources/CylinderGraphics.js b/Source/DataSources/CylinderGraphics.js index 0e9733b5ae8e..2972fb4221ca 100644 --- a/Source/DataSources/CylinderGraphics.js +++ b/Source/DataSources/CylinderGraphics.js @@ -79,7 +79,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the cylinder. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -87,28 +87,28 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the numeric Property specifying the length of the cylinder. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ length: createPropertyDescriptor("length"), /** * Gets or sets the numeric Property specifying the radius of the top of the cylinder. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ topRadius: createPropertyDescriptor("topRadius"), /** * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ bottomRadius: createPropertyDescriptor("bottomRadius"), /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -116,7 +116,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -124,7 +124,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the Property specifying the material used to fill the cylinder. * @memberof CylinderGraphics.prototype - * @type {MaterialProperty} + * @type {MaterialProperty|undefined} * @default Color.WHITE */ material: createMaterialPropertyDescriptor("material"), @@ -132,7 +132,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the cylinder is outlined. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -140,7 +140,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -148,7 +148,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -156,7 +156,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 16 */ numberOfVerticalLines: createPropertyDescriptor("numberOfVerticalLines"), @@ -164,7 +164,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 128 */ slices: createPropertyDescriptor("slices"), @@ -173,7 +173,7 @@ Object.defineProperties(CylinderGraphics.prototype, { * Get or sets the enum Property specifying whether the cylinder * casts or receives shadows from light sources. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -181,7 +181,7 @@ Object.defineProperties(CylinderGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed. * @memberof CylinderGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/EllipseGraphics.js b/Source/DataSources/EllipseGraphics.js index 56c64aa94697..bb4ccaa45ed8 100644 --- a/Source/DataSources/EllipseGraphics.js +++ b/Source/DataSources/EllipseGraphics.js @@ -101,7 +101,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the ellipse. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -109,21 +109,21 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric Property specifying the semi-major axis. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ semiMajorAxis: createPropertyDescriptor("semiMajorAxis"), /** * Gets or sets the numeric Property specifying the semi-minor axis. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ semiMinorAxis: createPropertyDescriptor("semiMinorAxis"), /** * Gets or sets the numeric Property specifying the altitude of the ellipse. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ height: createPropertyDescriptor("height"), @@ -131,7 +131,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -140,14 +140,14 @@ Object.defineProperties(EllipseGraphics.prototype, { * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion. * Setting this property creates volume starting at height and ending at this altitude. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ extrudedHeight: createPropertyDescriptor("extrudedHeight"), /** * Gets or sets the Property specifying the extruded {@link HeightReference}. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ extrudedHeightReference: createPropertyDescriptor("extrudedHeightReference"), @@ -155,7 +155,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric property specifying the rotation of the ellipse clockwise from north. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ rotation: createPropertyDescriptor("rotation"), @@ -163,7 +163,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ stRotation: createPropertyDescriptor("stRotation"), @@ -171,7 +171,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric Property specifying the angular distance between points on the ellipse. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -179,7 +179,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -187,7 +187,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the Property specifying the material used to fill the ellipse. * @memberof EllipseGraphics.prototype - * @type {MaterialProperty} + * @type {MaterialProperty|undefined} * @default Color.WHITE */ material: createMaterialPropertyDescriptor("material"), @@ -195,7 +195,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the Property specifying whether the ellipse is outlined. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -203,7 +203,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -211,7 +211,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -219,7 +219,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 16 */ numberOfVerticalLines: createPropertyDescriptor("numberOfVerticalLines"), @@ -228,7 +228,7 @@ Object.defineProperties(EllipseGraphics.prototype, { * Get or sets the enum Property specifying whether the ellipse * casts or receives shadows from light sources. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -236,7 +236,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -245,7 +245,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. * @memberof EllipseGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ClassificationType.BOTH */ classificationType: createPropertyDescriptor("classificationType"), @@ -253,7 +253,7 @@ Object.defineProperties(EllipseGraphics.prototype, { /** * Gets or sets the zIndex Property specifying the ellipse ordering. Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified * @memberof EllipseGraphics.prototype - * @type {ConstantProperty} + * @type {ConstantProperty|undefined} * @default 0 */ zIndex: createPropertyDescriptor("zIndex"), diff --git a/Source/DataSources/EllipsoidGraphics.js b/Source/DataSources/EllipsoidGraphics.js index 262f65c0cea1..ef2ad391be52 100644 --- a/Source/DataSources/EllipsoidGraphics.js +++ b/Source/DataSources/EllipsoidGraphics.js @@ -92,7 +92,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -100,14 +100,14 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ radii: createPropertyDescriptor("radii"), /** * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default radii */ innerRadii: createPropertyDescriptor("innerRadii"), @@ -115,7 +115,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the minimum clock angle of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ minimumClock: createPropertyDescriptor("minimumClock"), @@ -123,7 +123,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the maximum clock angle of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 2*PI */ maximumClock: createPropertyDescriptor("maximumClock"), @@ -131,7 +131,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the minimum cone angle of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ minimumCone: createPropertyDescriptor("minimumCone"), @@ -139,7 +139,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the maximum cone angle of the ellipsoid. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default PI */ maximumCone: createPropertyDescriptor("maximumCone"), @@ -147,7 +147,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -155,7 +155,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -171,7 +171,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying whether the ellipsoid is outlined. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -179,7 +179,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -187,7 +187,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -195,7 +195,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the number of stacks. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 64 */ stackPartitions: createPropertyDescriptor("stackPartitions"), @@ -203,7 +203,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the number of radial slices per 360 degrees. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 64 */ slicePartitions: createPropertyDescriptor("slicePartitions"), @@ -211,7 +211,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 128 */ subdivisions: createPropertyDescriptor("subdivisions"), @@ -220,7 +220,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { * Get or sets the enum Property specifying whether the ellipsoid * casts or receives shadows from light sources. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -228,7 +228,7 @@ Object.defineProperties(EllipsoidGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed. * @memberof EllipsoidGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js index 119711736bce..c0a8097b1ea0 100644 --- a/Source/DataSources/Entity.js +++ b/Source/DataSources/Entity.js @@ -220,7 +220,7 @@ Object.defineProperties(Entity.prototype, { * If availability exists, the objects other properties will only * provide valid data if queried within the given interval. * @memberof Entity.prototype - * @type {TimeIntervalCollection} + * @type {TimeIntervalCollection|undefined} */ availability: createRawPropertyDescriptor("availability"), /** @@ -249,7 +249,7 @@ Object.defineProperties(Entity.prototype, { * Gets or sets the name of the object. The name is intended for end-user * consumption and does not need to be unique. * @memberof Entity.prototype - * @type {String} + * @type {String|undefined} */ name: createRawPropertyDescriptor("name"), /** @@ -302,7 +302,7 @@ Object.defineProperties(Entity.prototype, { /** * Gets or sets the parent object. * @memberof Entity.prototype - * @type {Entity} + * @type {Entity|undefined} */ parent: { get: function () { @@ -338,7 +338,7 @@ Object.defineProperties(Entity.prototype, { /** * Gets the names of all properties registered on this instance. * @memberof Entity.prototype - * @type {Array} + * @type {string[]} */ propertyNames: { get: function () { @@ -348,103 +348,103 @@ Object.defineProperties(Entity.prototype, { /** * Gets or sets the billboard. * @memberof Entity.prototype - * @type {BillboardGraphics} + * @type {BillboardGraphics|undefined} */ billboard: createPropertyTypeDescriptor("billboard", BillboardGraphics), /** * Gets or sets the box. * @memberof Entity.prototype - * @type {BoxGraphics} + * @type {BoxGraphics|undefined} */ box: createPropertyTypeDescriptor("box", BoxGraphics), /** * Gets or sets the corridor. * @memberof Entity.prototype - * @type {CorridorGraphics} + * @type {CorridorGraphics|undefined} */ corridor: createPropertyTypeDescriptor("corridor", CorridorGraphics), /** * Gets or sets the cylinder. * @memberof Entity.prototype - * @type {CylinderGraphics} + * @type {CylinderGraphics|undefined} */ cylinder: createPropertyTypeDescriptor("cylinder", CylinderGraphics), /** * Gets or sets the description. * @memberof Entity.prototype - * @type {Property} + * @type {Property|undefined} */ description: createPropertyDescriptor("description"), /** * Gets or sets the ellipse. * @memberof Entity.prototype - * @type {EllipseGraphics} + * @type {EllipseGraphics|undefined} */ ellipse: createPropertyTypeDescriptor("ellipse", EllipseGraphics), /** * Gets or sets the ellipsoid. * @memberof Entity.prototype - * @type {EllipsoidGraphics} + * @type {EllipsoidGraphics|undefined} */ ellipsoid: createPropertyTypeDescriptor("ellipsoid", EllipsoidGraphics), /** * Gets or sets the label. * @memberof Entity.prototype - * @type {LabelGraphics} + * @type {LabelGraphics|undefined} */ label: createPropertyTypeDescriptor("label", LabelGraphics), /** * Gets or sets the model. * @memberof Entity.prototype - * @type {ModelGraphics} + * @type {ModelGraphics|undefined} */ model: createPropertyTypeDescriptor("model", ModelGraphics), /** * Gets or sets the tileset. * @memberof Entity.prototype - * @type {Cesium3DTilesetGraphics} + * @type {Cesium3DTilesetGraphics|undefined} */ tileset: createPropertyTypeDescriptor("tileset", Cesium3DTilesetGraphics), /** * Gets or sets the orientation. * @memberof Entity.prototype - * @type {Property} + * @type {Property|undefined} */ orientation: createPropertyDescriptor("orientation"), /** * Gets or sets the path. * @memberof Entity.prototype - * @type {PathGraphics} + * @type {PathGraphics|undefined} */ path: createPropertyTypeDescriptor("path", PathGraphics), /** * Gets or sets the plane. * @memberof Entity.prototype - * @type {PlaneGraphics} + * @type {PlaneGraphics|undefined} */ plane: createPropertyTypeDescriptor("plane", PlaneGraphics), /** * Gets or sets the point graphic. * @memberof Entity.prototype - * @type {PointGraphics} + * @type {PointGraphics|undefined} */ point: createPropertyTypeDescriptor("point", PointGraphics), /** * Gets or sets the polygon. * @memberof Entity.prototype - * @type {PolygonGraphics} + * @type {PolygonGraphics|undefined} */ polygon: createPropertyTypeDescriptor("polygon", PolygonGraphics), /** * Gets or sets the polyline. * @memberof Entity.prototype - * @type {PolylineGraphics} + * @type {PolylineGraphics|undefined} */ polyline: createPropertyTypeDescriptor("polyline", PolylineGraphics), /** * Gets or sets the polyline volume. * @memberof Entity.prototype - * @type {PolylineVolumeGraphics} + * @type {PolylineVolumeGraphics|undefined} */ polylineVolume: createPropertyTypeDescriptor( "polylineVolume", @@ -453,19 +453,19 @@ Object.defineProperties(Entity.prototype, { /** * Gets or sets the bag of arbitrary properties associated with this entity. * @memberof Entity.prototype - * @type {PropertyBag} + * @type {PropertyBag|undefined} */ properties: createPropertyTypeDescriptor("properties", PropertyBag), /** * Gets or sets the position. * @memberof Entity.prototype - * @type {PositionProperty} + * @type {PositionProperty|undefined} */ position: createPositionPropertyDescriptor("position"), /** * Gets or sets the rectangle. * @memberof Entity.prototype - * @type {RectangleGraphics} + * @type {RectangleGraphics|undefined} */ rectangle: createPropertyTypeDescriptor("rectangle", RectangleGraphics), /** @@ -473,13 +473,13 @@ Object.defineProperties(Entity.prototype, { * The offset is typically defined in the east-north-up reference frame, * but may be another frame depending on the object's velocity. * @memberof Entity.prototype - * @type {Property} + * @type {Property|undefined} */ viewFrom: createPropertyDescriptor("viewFrom"), /** * Gets or sets the wall. * @memberof Entity.prototype - * @type {WallGraphics} + * @type {WallGraphics|undefined} */ wall: createPropertyTypeDescriptor("wall", WallGraphics), }); diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 3a0d357dc78b..7cecb01405b4 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -3434,7 +3434,7 @@ function KmlDataSource(options) { * Creates a Promise to a new instance loaded with the provided KML data. * * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. - * @param {Object} options An object with the following properties: + * @param {Object} [options] An object with the following properties: * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links and other KML network features. diff --git a/Source/DataSources/LabelGraphics.js b/Source/DataSources/LabelGraphics.js index 0684a8e9f1b0..18502e83b813 100644 --- a/Source/DataSources/LabelGraphics.js +++ b/Source/DataSources/LabelGraphics.js @@ -106,7 +106,7 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the label. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ show: createPropertyDescriptor("show"), @@ -114,14 +114,14 @@ Object.defineProperties(LabelGraphics.prototype, { * Gets or sets the string Property specifying the text of the label. * Explicit newlines '\n' are supported. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ text: createPropertyDescriptor("text"), /** * Gets or sets the string Property specifying the font in CSS syntax. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/font|CSS font on MDN} */ font: createPropertyDescriptor("font"), @@ -129,7 +129,7 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the Property specifying the {@link LabelStyle}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ style: createPropertyDescriptor("style"), @@ -144,7 +144,7 @@ Object.defineProperties(LabelGraphics.prototype, { * *

    * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ scale: createPropertyDescriptor("scale"), @@ -152,7 +152,7 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the background behind the label. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ showBackground: createPropertyDescriptor("showBackground"), @@ -160,7 +160,7 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the Property specifying the background {@link Color}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default new Color(0.165, 0.165, 0.165, 0.8) */ backgroundColor: createPropertyDescriptor("backgroundColor"), @@ -169,7 +169,7 @@ Object.defineProperties(LabelGraphics.prototype, { * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical * background padding in pixels. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default new Cartesian2(7, 5) */ backgroundPadding: createPropertyDescriptor("backgroundPadding"), @@ -189,7 +189,7 @@ Object.defineProperties(LabelGraphics.prototype, { * *

    * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cartesian2.ZERO */ pixelOffset: createPropertyDescriptor("pixelOffset"), @@ -214,7 +214,7 @@ Object.defineProperties(LabelGraphics.prototype, { * *

    * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cartesian3.ZERO */ eyeOffset: createPropertyDescriptor("eyeOffset"), @@ -222,21 +222,21 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HorizontalOrigin}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ horizontalOrigin: createPropertyDescriptor("horizontalOrigin"), /** * Gets or sets the Property specifying the {@link VerticalOrigin}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ verticalOrigin: createPropertyDescriptor("verticalOrigin"), /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -244,21 +244,21 @@ Object.defineProperties(LabelGraphics.prototype, { /** * Gets or sets the Property specifying the fill {@link Color}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ fillColor: createPropertyDescriptor("fillColor"), /** * Gets or sets the Property specifying the outline {@link Color}. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ outlineColor: createPropertyDescriptor("outlineColor"), /** * Gets or sets the numeric Property specifying the outline width. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -269,7 +269,7 @@ Object.defineProperties(LabelGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's translucency remains clamped to the nearest bound. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ translucencyByDistance: createPropertyDescriptor("translucencyByDistance"), @@ -280,7 +280,7 @@ Object.defineProperties(LabelGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ pixelOffsetScaleByDistance: createPropertyDescriptor( "pixelOffsetScaleByDistance" @@ -294,14 +294,14 @@ Object.defineProperties(LabelGraphics.prototype, { * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, * scaleByDistance will be disabled. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ scaleByDistance: createPropertyDescriptor("scaleByDistance"), /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -311,7 +311,7 @@ Object.defineProperties(LabelGraphics.prototype, { * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. * @memberof LabelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( "disableDepthTestDistance" diff --git a/Source/DataSources/ModelGraphics.js b/Source/DataSources/ModelGraphics.js index 94a52176a947..feb714d52cbb 100644 --- a/Source/DataSources/ModelGraphics.js +++ b/Source/DataSources/ModelGraphics.js @@ -119,7 +119,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the model. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -127,7 +127,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the string Property specifying the URI of the glTF asset. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ uri: createPropertyDescriptor("uri"), @@ -136,7 +136,7 @@ Object.defineProperties(ModelGraphics.prototype, { * for this model. Values greater than 1.0 increase the size of the model while * values less than 1.0 decrease it. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ scale: createPropertyDescriptor("scale"), @@ -147,7 +147,7 @@ Object.defineProperties(ModelGraphics.prototype, { * a model is visible even when the viewer zooms out. When 0.0, * no minimum size is enforced. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ minimumPixelSize: createPropertyDescriptor("minimumPixelSize"), @@ -157,7 +157,7 @@ Object.defineProperties(ModelGraphics.prototype, { * size of a model. This property is used as an upper limit for * {@link ModelGraphics#minimumPixelSize}. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ maximumScale: createPropertyDescriptor("maximumScale"), @@ -165,7 +165,7 @@ Object.defineProperties(ModelGraphics.prototype, { * Get or sets the boolean Property specifying whether textures * may continue to stream in after the model is loaded. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ incrementallyLoadTextures: createPropertyDescriptor( "incrementallyLoadTextures" @@ -174,7 +174,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the boolean Property specifying if glTF animations should be run. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ runAnimations: createPropertyDescriptor("runAnimations"), @@ -182,7 +182,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ clampAnimations: createPropertyDescriptor("clampAnimations"), @@ -191,7 +191,7 @@ Object.defineProperties(ModelGraphics.prototype, { * Get or sets the enum Property specifying whether the model * casts or receives shadows from light sources. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.ENABLED */ shadows: createPropertyDescriptor("shadows"), @@ -199,7 +199,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -207,7 +207,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the silhouette. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.RED */ silhouetteColor: createPropertyDescriptor("silhouetteColor"), @@ -215,7 +215,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the numeric Property specifying the size of the silhouette in pixels. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ silhouetteSize: createPropertyDescriptor("silhouetteSize"), @@ -223,7 +223,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.WHITE */ color: createPropertyDescriptor("color"), @@ -231,7 +231,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * Gets or sets the enum Property specifying how the color blends with the model. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ColorBlendMode.HIGHLIGHT */ colorBlendMode: createPropertyDescriptor("colorBlendMode"), @@ -241,7 +241,7 @@ Object.defineProperties(ModelGraphics.prototype, { * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with * any value in-between resulting in a mix of the two. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.5 */ colorBlendAmount: createPropertyDescriptor("colorBlendAmount"), @@ -249,7 +249,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ imageBasedLightingFactor: createPropertyDescriptor( "imageBasedLightingFactor" @@ -258,14 +258,14 @@ Object.defineProperties(ModelGraphics.prototype, { /** * A property specifying the {@link Cartesian3} light color when shading the model. When undefined the scene's light color is used instead. * @memberOf ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ lightColor: createPropertyDescriptor("lightColor"), /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -299,7 +299,7 @@ Object.defineProperties(ModelGraphics.prototype, { /** * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. * @memberof ModelGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ clippingPlanes: createPropertyDescriptor("clippingPlanes"), }); diff --git a/Source/DataSources/PathGraphics.js b/Source/DataSources/PathGraphics.js index b2d36c1ba7c5..ba377b917498 100644 --- a/Source/DataSources/PathGraphics.js +++ b/Source/DataSources/PathGraphics.js @@ -56,7 +56,7 @@ Object.defineProperties(PathGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the path. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -64,21 +64,21 @@ Object.defineProperties(PathGraphics.prototype, { /** * Gets or sets the Property specifying the number of seconds in front of the object to show. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ leadTime: createPropertyDescriptor("leadTime"), /** * Gets or sets the Property specifying the number of seconds behind the object to show. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ trailTime: createPropertyDescriptor("trailTime"), /** * Gets or sets the numeric Property specifying the width in pixels. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ width: createPropertyDescriptor("width"), @@ -86,7 +86,7 @@ Object.defineProperties(PathGraphics.prototype, { /** * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 60 */ resolution: createPropertyDescriptor("resolution"), @@ -102,7 +102,7 @@ Object.defineProperties(PathGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed. * @memberof PathGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/PlaneGraphics.js b/Source/DataSources/PlaneGraphics.js index 3cd6e2a33f54..610733a723b6 100644 --- a/Source/DataSources/PlaneGraphics.js +++ b/Source/DataSources/PlaneGraphics.js @@ -67,7 +67,7 @@ Object.defineProperties(PlaneGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the plane. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -76,7 +76,7 @@ Object.defineProperties(PlaneGraphics.prototype, { * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane. * * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ plane: createPropertyDescriptor("plane"), @@ -84,14 +84,14 @@ Object.defineProperties(PlaneGraphics.prototype, { * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane. * * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ dimensions: createPropertyDescriptor("dimensions"), /** * Gets or sets the boolean Property specifying whether the plane is filled with the provided material. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -107,7 +107,7 @@ Object.defineProperties(PlaneGraphics.prototype, { /** * Gets or sets the Property specifying whether the plane is outlined. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -115,7 +115,7 @@ Object.defineProperties(PlaneGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -123,7 +123,7 @@ Object.defineProperties(PlaneGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -132,7 +132,7 @@ Object.defineProperties(PlaneGraphics.prototype, { * Get or sets the enum Property specifying whether the plane * casts or receives shadows from light sources. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -140,7 +140,7 @@ Object.defineProperties(PlaneGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed. * @memberof PlaneGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/PointGraphics.js b/Source/DataSources/PointGraphics.js index 04404e86a8a6..eff6d916eeec 100644 --- a/Source/DataSources/PointGraphics.js +++ b/Source/DataSources/PointGraphics.js @@ -65,7 +65,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the point. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -73,7 +73,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the numeric Property specifying the size in pixels. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1 */ pixelSize: createPropertyDescriptor("pixelSize"), @@ -81,7 +81,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -89,7 +89,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the point. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.WHITE */ color: createPropertyDescriptor("color"), @@ -97,7 +97,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -105,7 +105,7 @@ Object.defineProperties(PointGraphics.prototype, { /** * Gets or sets the numeric Property specifying the the outline width in pixels. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -114,7 +114,7 @@ Object.defineProperties(PointGraphics.prototype, { * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance. * If undefined, a constant size is used. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ scaleByDistance: createPropertyDescriptor("scaleByDistance"), @@ -125,14 +125,14 @@ Object.defineProperties(PointGraphics.prototype, { * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. * Outside of these ranges the points's translucency remains clamped to the nearest bound. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ translucencyByDistance: createPropertyDescriptor("translucencyByDistance"), /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -142,7 +142,7 @@ Object.defineProperties(PointGraphics.prototype, { * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. * @memberof PointGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ disableDepthTestDistance: createPropertyDescriptor( "disableDepthTestDistance" diff --git a/Source/DataSources/PolygonGraphics.js b/Source/DataSources/PolygonGraphics.js index 72f3d8a88751..c3fb0b10d854 100644 --- a/Source/DataSources/PolygonGraphics.js +++ b/Source/DataSources/PolygonGraphics.js @@ -114,7 +114,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the polygon. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -122,7 +122,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the Property specifying the {@link PolygonHierarchy}. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ hierarchy: createPropertyDescriptor( "hierarchy", @@ -133,7 +133,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the numeric Property specifying the constant altitude of the polygon. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ height: createPropertyDescriptor("height"), @@ -141,7 +141,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -151,14 +151,14 @@ Object.defineProperties(PolygonGraphics.prototype, { * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ extrudedHeight: createPropertyDescriptor("extrudedHeight"), /** * Gets or sets the Property specifying the extruded {@link HeightReference}. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ extrudedHeightReference: createPropertyDescriptor("extrudedHeightReference"), @@ -166,7 +166,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ stRotation: createPropertyDescriptor("stRotation"), @@ -174,7 +174,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the numeric Property specifying the angular distance between points on the polygon. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -182,7 +182,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -198,7 +198,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the Property specifying whether the polygon is outlined. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -206,7 +206,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -214,7 +214,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -224,28 +224,28 @@ Object.defineProperties(PolygonGraphics.prototype, { * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ perPositionHeight: createPropertyDescriptor("perPositionHeight"), /** * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ closeTop: createPropertyDescriptor("closeTop"), /** * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ closeBottom: createPropertyDescriptor("closeBottom"), /** * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ArcType.GEODESIC */ arcType: createPropertyDescriptor("arcType"), @@ -254,7 +254,7 @@ Object.defineProperties(PolygonGraphics.prototype, { * Get or sets the enum Property specifying whether the polygon * casts or receives shadows from light sources. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -262,7 +262,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -271,7 +271,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. * @memberof PolygonGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ClassificationType.BOTH */ classificationType: createPropertyDescriptor("classificationType"), @@ -279,7 +279,7 @@ Object.defineProperties(PolygonGraphics.prototype, { /** * Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. * @memberof PolygonGraphics.prototype - * @type {ConstantProperty} + * @type {ConstantProperty|undefined} * @default 0 */ zIndex: createPropertyDescriptor("zIndex"), diff --git a/Source/DataSources/PolylineGraphics.js b/Source/DataSources/PolylineGraphics.js index 11338241b749..2096a57ec31b 100644 --- a/Source/DataSources/PolylineGraphics.js +++ b/Source/DataSources/PolylineGraphics.js @@ -77,7 +77,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the polyline. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -86,14 +86,14 @@ Object.defineProperties(PolylineGraphics.prototype, { * Gets or sets the Property specifying the array of {@link Cartesian3} * positions that define the line strip. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ positions: createPropertyDescriptor("positions"), /** * Gets or sets the numeric Property specifying the width in pixels. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ width: createPropertyDescriptor("width"), @@ -101,7 +101,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Cesium.Math.RADIANS_PER_DEGREE */ granularity: createPropertyDescriptor("granularity"), @@ -129,7 +129,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ArcType.GEODESIC */ arcType: createPropertyDescriptor("arcType"), @@ -138,7 +138,7 @@ Object.defineProperties(PolylineGraphics.prototype, { * Gets or sets the boolean Property specifying whether the polyline * should be clamped to the ground. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ clampToGround: createPropertyDescriptor("clampToGround"), @@ -147,7 +147,7 @@ Object.defineProperties(PolylineGraphics.prototype, { * Get or sets the enum Property specifying whether the polyline * casts or receives shadows from light sources. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -155,7 +155,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -164,7 +164,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. * @memberof PolylineGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ClassificationType.BOTH */ classificationType: createPropertyDescriptor("classificationType"), @@ -172,7 +172,7 @@ Object.defineProperties(PolylineGraphics.prototype, { /** * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported. * @memberof PolylineGraphics.prototype - * @type {ConstantProperty} + * @type {ConstantProperty|undefined} * @default 0 */ zIndex: createPropertyDescriptor("zIndex"), diff --git a/Source/DataSources/PolylineVolumeGraphics.js b/Source/DataSources/PolylineVolumeGraphics.js index 541e5b8892b7..bbc4dda8fdbd 100644 --- a/Source/DataSources/PolylineVolumeGraphics.js +++ b/Source/DataSources/PolylineVolumeGraphics.js @@ -76,7 +76,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the volume. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -84,21 +84,21 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ positions: createPropertyDescriptor("positions"), /** * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ shape: createPropertyDescriptor("shape"), /** * Gets or sets the {@link CornerType} Property specifying the style of the corners. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default CornerType.ROUNDED */ cornerType: createPropertyDescriptor("cornerType"), @@ -106,7 +106,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the numeric Property specifying the angular distance between points on the volume. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -114,7 +114,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the volume is filled with the provided material. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -130,7 +130,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the Property specifying whether the volume is outlined. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -138,7 +138,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -146,7 +146,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -155,7 +155,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { * Get or sets the enum Property specifying whether the volume * casts or receives shadows from light sources. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -163,7 +163,7 @@ Object.defineProperties(PolylineVolumeGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed. * @memberof PolylineVolumeGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/DataSources/RectangleGraphics.js b/Source/DataSources/RectangleGraphics.js index fa553282f7d2..1c36248a7635 100644 --- a/Source/DataSources/RectangleGraphics.js +++ b/Source/DataSources/RectangleGraphics.js @@ -95,7 +95,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the rectangle. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -103,14 +103,14 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Rectangle}. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ coordinates: createPropertyDescriptor("coordinates"), /** * Gets or sets the numeric Property specifying the altitude of the rectangle. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0.0 */ height: createPropertyDescriptor("height"), @@ -118,7 +118,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the Property specifying the {@link HeightReference}. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ heightReference: createPropertyDescriptor("heightReference"), @@ -127,14 +127,14 @@ Object.defineProperties(RectangleGraphics.prototype, { * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion. * Setting this property creates volume starting at height and ending at this altitude. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ extrudedHeight: createPropertyDescriptor("extrudedHeight"), /** * Gets or sets the Property specifying the extruded {@link HeightReference}. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default HeightReference.NONE */ extrudedHeightReference: createPropertyDescriptor("extrudedHeightReference"), @@ -142,7 +142,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ rotation: createPropertyDescriptor("rotation"), @@ -150,7 +150,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 0 */ stRotation: createPropertyDescriptor("stRotation"), @@ -158,7 +158,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the numeric Property specifying the angular distance between points on the rectangle. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -166,7 +166,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -182,7 +182,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the Property specifying whether the rectangle is outlined. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -190,7 +190,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -198,7 +198,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -207,7 +207,7 @@ Object.defineProperties(RectangleGraphics.prototype, { * Get or sets the enum Property specifying whether the rectangle * casts or receives shadows from light sources. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -215,7 +215,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" @@ -224,7 +224,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. * @memberof RectangleGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ClassificationType.BOTH */ classificationType: createPropertyDescriptor("classificationType"), @@ -232,7 +232,7 @@ Object.defineProperties(RectangleGraphics.prototype, { /** * Gets or sets the zIndex Property specifying the ordering of the rectangle. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. * @memberof RectangleGraphics.prototype - * @type {ConstantProperty} + * @type {ConstantProperty|undefined} * @default 0 */ zIndex: createPropertyDescriptor("zIndex"), diff --git a/Source/DataSources/WallGraphics.js b/Source/DataSources/WallGraphics.js index d0ce102b0a16..8ddb921b59b2 100644 --- a/Source/DataSources/WallGraphics.js +++ b/Source/DataSources/WallGraphics.js @@ -76,7 +76,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the boolean Property specifying the visibility of the wall. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ show: createPropertyDescriptor("show"), @@ -84,7 +84,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ positions: createPropertyDescriptor("positions"), @@ -92,7 +92,7 @@ Object.defineProperties(WallGraphics.prototype, { * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe. * If defined, the array must be the same length as {@link Wall#positions}. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ minimumHeights: createPropertyDescriptor("minimumHeights"), @@ -100,14 +100,14 @@ Object.defineProperties(WallGraphics.prototype, { * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position. * If defined, the array must be the same length as {@link Wall#positions}. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ maximumHeights: createPropertyDescriptor("maximumHeights"), /** * Gets or sets the numeric Property specifying the angular distance between points on the wall. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default {CesiumMath.RADIANS_PER_DEGREE} */ granularity: createPropertyDescriptor("granularity"), @@ -115,7 +115,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the boolean Property specifying whether the wall is filled with the provided material. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default true */ fill: createPropertyDescriptor("fill"), @@ -131,7 +131,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the Property specifying whether the wall is outlined. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default false */ outline: createPropertyDescriptor("outline"), @@ -139,7 +139,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the Property specifying the {@link Color} of the outline. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default Color.BLACK */ outlineColor: createPropertyDescriptor("outlineColor"), @@ -147,7 +147,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the numeric Property specifying the width of the outline. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default 1.0 */ outlineWidth: createPropertyDescriptor("outlineWidth"), @@ -156,7 +156,7 @@ Object.defineProperties(WallGraphics.prototype, { * Get or sets the enum Property specifying whether the wall * casts or receives shadows from light sources. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} * @default ShadowMode.DISABLED */ shadows: createPropertyDescriptor("shadows"), @@ -164,7 +164,7 @@ Object.defineProperties(WallGraphics.prototype, { /** * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed. * @memberof WallGraphics.prototype - * @type {Property} + * @type {Property|undefined} */ distanceDisplayCondition: createPropertyDescriptor( "distanceDisplayCondition" diff --git a/Source/Scene/Axis.js b/Source/Scene/Axis.js index fb38e6e98332..1baeb4b8fcba 100644 --- a/Source/Scene/Axis.js +++ b/Source/Scene/Axis.js @@ -7,7 +7,6 @@ import Matrix4 from "../Core/Matrix4.js"; * An enum describing the x, y, and z axes and helper conversion functions. * * @enum {Number} - * @private */ var Axis = { /** @@ -33,79 +32,80 @@ var Axis = { * @constant */ Z: 2, +}; - /** - * Matrix used to convert from y-up to z-up - * - * @type {Matrix4} - * @constant - */ - Y_UP_TO_Z_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from y-up to z-up + * + * @type {Matrix4} + * @constant + */ +Axis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO) +); - /** - * Matrix used to convert from z-up to y-up - * - * @type {Matrix4} - * @constant - */ - Z_UP_TO_Y_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from z-up to y-up + * + * @type {Matrix4} + * @constant + */ +Axis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO) +); - /** - * Matrix used to convert from x-up to z-up - * - * @type {Matrix4} - * @constant - */ - X_UP_TO_Z_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from x-up to z-up + * + * @type {Matrix4} + * @constant + */ +Axis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO) +); - /** - * Matrix used to convert from z-up to x-up - * - * @type {Matrix4} - * @constant - */ - Z_UP_TO_X_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from z-up to x-up + * + * @type {Matrix4} + * @constant + */ +Axis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO) +); - /** - * Matrix used to convert from x-up to y-up - * - * @type {Matrix4} - * @constant - */ - X_UP_TO_Y_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from x-up to y-up + * + * @type {Matrix4} + * @constant + */ +Axis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO) +); - /** - * Matrix used to convert from y-up to x-up - * - * @type {Matrix4} - * @constant - */ - Y_UP_TO_X_UP: Matrix4.fromRotationTranslation( - Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO) - ), +/** + * Matrix used to convert from y-up to x-up + * + * @type {Matrix4} + * @constant + */ +Axis.Y_UP_TO_X_UP = Matrix4.fromRotationTranslation( + Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO) +); - /** - * Gets the axis by name - * - * @param {String} name The name of the axis. - * @returns {Number} The axis enum. - */ - fromName: function (name) { - //>>includeStart('debug', pragmas.debug); - Check.typeOf.string("name", name); - //>>includeEnd('debug'); +/** + * Gets the axis by name + * + * @param {String} name The name of the axis. + * @returns {Number} The axis enum. + */ +Axis.fromName = function (name) { + //>>includeStart('debug', pragmas.debug); + Check.typeOf.string("name", name); + //>>includeEnd('debug'); - return Axis[name]; - }, + return Axis[name]; }; + export default Object.freeze(Axis); diff --git a/Source/Scene/Cesium3DTileFeature.js b/Source/Scene/Cesium3DTileFeature.js index 2700ea5d3f82..a9d3436b2490 100644 --- a/Source/Scene/Cesium3DTileFeature.js +++ b/Source/Scene/Cesium3DTileFeature.js @@ -161,7 +161,7 @@ Cesium3DTileFeature.prototype.hasProperty = function (name) { * * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * - * @param {String[]} results An array into which to store the results. + * @param {String[]} [results] An array into which to store the results. * @returns {String[]} The names of the feature's properties. */ Cesium3DTileFeature.prototype.getPropertyNames = function (results) { diff --git a/Source/Scene/Cesium3DTilePointFeature.js b/Source/Scene/Cesium3DTilePointFeature.js index 5c8cb77300f1..79ee6de46456 100644 --- a/Source/Scene/Cesium3DTilePointFeature.js +++ b/Source/Scene/Cesium3DTilePointFeature.js @@ -731,7 +731,7 @@ Cesium3DTilePointFeature.prototype.hasProperty = function (name) { * * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy} * - * @param {String[]} results An array into which to store the results. + * @param {String[]} [results] An array into which to store the results. * @returns {String[]} The names of the feature's properties. */ Cesium3DTilePointFeature.prototype.getPropertyNames = function (results) { diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 305679733d89..45bfd2c01da9 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -1203,7 +1203,7 @@ Object.defineProperties(Cesium3DTileset.prototype, { * * @memberof Cesium3DTileset.prototype * - * @type {Cesium3DTileStyle} + * @type {Cesium3DTileStyle|undefined} * * @default undefined * diff --git a/Source/Scene/ImageryLayerFeatureInfo.js b/Source/Scene/ImageryLayerFeatureInfo.js index 90f89d3a485e..6536bcebd9ab 100644 --- a/Source/Scene/ImageryLayerFeatureInfo.js +++ b/Source/Scene/ImageryLayerFeatureInfo.js @@ -9,34 +9,34 @@ import defined from "../Core/defined.js"; function ImageryLayerFeatureInfo() { /** * Gets or sets the name of the feature. - * @type {String} + * @type {String|undefined} */ this.name = undefined; /** * Gets or sets an HTML description of the feature. The HTML is not trusted and should * be sanitized before display to the user. - * @type {String} + * @type {String|undefined} */ this.description = undefined; /** * Gets or sets the position of the feature, or undefined if the position is not known. * - * @type {Cartographic} + * @type {Cartographic|undefined} */ this.position = undefined; /** * Gets or sets the raw data describing the feature. The raw data may be in any * number of formats, such as GeoJSON, KML, etc. - * @type {Object} + * @type {Object|undefined} */ this.data = undefined; /** * Gets or sets the image layer of the feature. - * @type {Object} + * @type {Object|undefined} */ this.imageryLayer = undefined; } diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index e6f39dba5ac0..904029140495 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -3897,10 +3897,9 @@ function updateMostDetailedRayPicks(scene) { } /** - * Update and render the scene. + * Update and render the scene. It is usually not necessary to call this function + * directly because {@link CesiumWidget} or {@link Viewer} do it automatically. * @param {JulianDate} [time] The simulation time at which to render. - * - * @private */ Scene.prototype.render = function (time) { /** @@ -4112,7 +4111,7 @@ Scene.prototype.pickPosition = function (windowPosition, result) { * @param {Number} [limit] If supplied, stop drilling after collecting this many picks. * @param {Number} [width=3] Width of the pick rectangle. * @param {Number} [height=3] Height of the pick rectangle. - * @returns {Object[]} Array of objects, each containing 1 picked primitives. + * @returns {Array.<*>} Array of objects, each containing 1 picked primitives. * * @exception {DeveloperError} windowPosition is undefined. * diff --git a/gulpfile.cjs b/gulpfile.cjs index 8192733597a3..74c75f3153fd 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1559,6 +1559,9 @@ function createTypeScriptDefinitions() { .replace(/^declare /gm, "export ") .replace(/CesiumMath/gm, "Math") .replace(/Number\[]/gm, "number[]") // Workaround https://github.com/englercj/tsd-jsdoc/issues/117 + .replace(/String\[]/gm, "string[]") + .replace(/Boolean\[]/gm, "boolean[]") + .replace(/Object\[]/gm, "object[]") .replace( /= "WebGLConstants\.(.+)"/gm, (match, p1) => `= WebGLConstants.${p1}` From 3172bc4615e881895bdbd54c2984ff4f396c5b84 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 14:19:38 +0200 Subject: [PATCH 19/36] Give up on trying JSDoc tags for PropertyBag --- Source/DataSources/PropertyBag.js | 7 +------ gulpfile.cjs | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Source/DataSources/PropertyBag.js b/Source/DataSources/PropertyBag.js index 688053f4c7ae..24f95598a6be 100644 --- a/Source/DataSources/PropertyBag.js +++ b/Source/DataSources/PropertyBag.js @@ -9,12 +9,7 @@ import Property from "./Property.js"; /** * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties. * - * @alias PropertyBag - * @constructor - * @implements {DictionaryLike} - * - * @param {Object} [value] An object, containing key-value mapping of property names to properties. - * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property. + * @typedef {PropertyBagType} */ function PropertyBag(value, createPropertyCallback) { this._propertyNames = []; diff --git a/gulpfile.cjs b/gulpfile.cjs index 74c75f3153fd..b0c8debaa3ec 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1481,10 +1481,9 @@ function createCesiumJs() { function createTypeScriptDefinitions() { // Run jsdoc with tsd-jsdoc to generate an initial Cesium.d.ts file. - child_process.execSync( - "node_modules/.bin/jsdoc --configure Tools/jsdoc/ts-conf.json", - { stdio: "inherit" } - ); + child_process.execSync("npx jsdoc --configure Tools/jsdoc/ts-conf.json", { + stdio: "inherit", + }); var source = fs.readFileSync("Source/Cesium.d.ts").toString(); @@ -1568,15 +1567,25 @@ function createTypeScriptDefinitions() { ); // Wrap the source to actually be inside of a declared cesium module - // and any any workaround and private utility types. + // and add any workaround and private utility types. source = `declare module "cesium" { /** - * Private interface to support PropertyBag being a dictionary-like object. + * Private interfaces to support PropertyBag being a dictionary-like object. */ -interface DictionaryLike { - [index: string]: any; +interface PropertyDictionary { + [key: string]: Property | undefined; +} +class PropertyBagBase { + readonly propertyNames: string[]; + constructor(value?: object, createPropertyCallback?: Function); + addProperty(propertyName: string, value?: any, createPropertyCallback?: Function): void; + hasProperty(propertyName: string): boolean; + merge(source: Object, createPropertyCallback?: Function): void; + removeProperty(propertyName: string): void; } +/** This has to be in the workaround section because JSDoc doesn't support Intersection Types */ +type PropertyBagType = PropertyDictionary & Property & PropertyBagBase; ${source} } @@ -1602,7 +1611,7 @@ ${source} fs.writeFileSync("Source/Cesium.d.ts", source); // Use tsc to compile it and make sure it is valid - child_process.execSync("node_modules/.bin/tsc -p Tools/jsdoc/tsconfig.json", { + child_process.execSync("npx tsc -p Tools/jsdoc/tsconfig.json", { stdio: "inherit", }); From f30a9b023d7412935fc9bd5b30d0bae82bf478f7 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 14:20:21 +0200 Subject: [PATCH 20/36] Example of exporting ConstructorOptions interface --- Source/DataSources/BoxGraphics.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Source/DataSources/BoxGraphics.js b/Source/DataSources/BoxGraphics.js index db4c4dc2a6d1..2d5d73f6729c 100644 --- a/Source/DataSources/BoxGraphics.js +++ b/Source/DataSources/BoxGraphics.js @@ -5,23 +5,28 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} BoxGraphics.ConstructorOptions + * @property {Property|boolean} [show=true] A boolean Property specifying the visibility of the box. + * @property {Property|Cartesian3} [dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box. + * @property {Property|HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. + * @property {Property|boolean} [fill=true] A boolean Property specifying whether the box is filled with the provided material. + * @property {MaterialProperty|Color} [material=Color.WHITE] A Property specifying the material used to fill the box. + * @property {Property|boolean} [outline=false] A boolean Property specifying whether the box is outlined. + * @property {Property|Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property|number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property|ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources. + * @property {Property|DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed. + * + */ + /** * Describes a box. The center position and orientation are determined by the containing {@link Entity}. * * @alias BoxGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the box. - * @param {Property} [options.dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. - * @param {Property} [options.fill=true] A boolean Property specifying whether the box is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the box. - * @param {Property} [options.outline=false] A boolean Property specifying whether the box is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed. + * @param {BoxGraphics.ConstructorOptions} [options] Object with the following properties: * * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo} */ From 6dd9e0cd4f4faf14627cd0a2ef118e968a2dc635 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 16:12:25 +0200 Subject: [PATCH 21/36] Break out constructor options: Entity and Graphics --- .vscode/tasks.json | 32 --------- Source/DataSources/BillboardGraphics.js | 49 ++++++++------ Source/DataSources/BoxGraphics.js | 25 +++---- Source/DataSources/Cesium3DTilesetGraphics.js | 15 +++-- Source/DataSources/CorridorGraphics.js | 45 +++++++------ Source/DataSources/CylinderGraphics.js | 37 ++++++----- Source/DataSources/EllipseGraphics.js | 49 ++++++++------ Source/DataSources/EllipsoidGraphics.js | 45 +++++++------ Source/DataSources/Entity.js | 65 +++++++++++-------- Source/DataSources/EntityCollection.js | 2 +- Source/DataSources/LabelGraphics.js | 51 ++++++++------- Source/DataSources/ModelGraphics.js | 51 ++++++++------- Source/DataSources/PathGraphics.js | 23 ++++--- Source/DataSources/PlaneGraphics.js | 29 +++++---- Source/DataSources/PointGraphics.js | 29 +++++---- Source/DataSources/PolygonGraphics.js | 51 ++++++++------- Source/DataSources/PolylineGraphics.js | 36 ++++++---- Source/DataSources/PolylineVolumeGraphics.js | 33 ++++++---- Source/DataSources/RectangleGraphics.js | 45 +++++++------ Source/DataSources/WallGraphics.js | 33 ++++++---- 20 files changed, 420 insertions(+), 325 deletions(-) delete mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 4befb021f0ca..000000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "0.1.0", - "command": "gulp", - "isShellCommand": true, - "args": [ - "--no-color" - ], - "tasks": [ - { - "taskName": "build", - "args": [], - "isBuildCommand": true, - "isBackground": false, - "problemMatcher": [ - "$lessCompile", - "$tsc", - "$jshint" - ] - }, - { - "taskName": "test", - "args": [], - "isTestCommand": true - }, - { - "taskName": "build-watch", - "isBackground": true - } - ] -} diff --git a/Source/DataSources/BillboardGraphics.js b/Source/DataSources/BillboardGraphics.js index e96da59d0f90..fe5144eb4944 100644 --- a/Source/DataSources/BillboardGraphics.js +++ b/Source/DataSources/BillboardGraphics.js @@ -4,6 +4,33 @@ import DeveloperError from "../Core/DeveloperError.js"; import Event from "../Core/Event.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} BillboardGraphics.ConstructorOptions + * + * Initialization options for the BillboardGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the billboard. + * @property {Property | string | HTMLCanvasElement} [image] A Property specifying the Image, URI, or Canvas to use for the billboard. + * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the image size. + * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset. + * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset. + * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}. + * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | Color} [color=Color.WHITE] A Property specifying the tint {@link Color} of the image. + * @property {Property | number} [rotation=0] A numeric Property specifying the rotation about the alignedAxis. + * @property {Property | Cartesian3} [alignedAxis=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the unit vector axis of rotation. + * @property {Property | boolean} [sizeInMeters] A boolean Property specifying whether this billboard's size should be measured in meters. + * @property {Property | number} [width] A numeric Property specifying the width of the billboard in pixels, overriding the native size. + * @property {Property | number} [height] A numeric Property specifying the height of the billboard in pixels, overriding the native size. + * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance from the camera. + * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. + * @property {Property | BoundingRectangle} [imageSubRegion] A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this billboard will be displayed. + * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + */ + /** * Describes a two dimensional icon located at the position of the containing {@link Entity}. *

    @@ -16,27 +43,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias BillboardGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the billboard. - * @param {Property} [options.image] A Property specifying the Image, URI, or Canvas to use for the billboard. - * @param {Property} [options.scale=1.0] A numeric Property specifying the scale to apply to the image size. - * @param {Property} [options.pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset. - * @param {Property} [options.eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset. - * @param {Property} [options.horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}. - * @param {Property} [options.verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.color=Color.WHITE] A Property specifying the tint {@link Color} of the image. - * @param {Property} [options.rotation=0] A numeric Property specifying the rotation about the alignedAxis. - * @param {Property} [options.alignedAxis=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the unit vector axis of rotation. - * @param {Property} [options.sizeInMeters] A boolean Property specifying whether this billboard's size should be measured in meters. - * @param {Property} [options.width] A numeric Property specifying the width of the billboard in pixels, overriding the native size. - * @param {Property} [options.height] A numeric Property specifying the height of the billboard in pixels, overriding the native size. - * @param {Property} [options.scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance from the camera. - * @param {Property} [options.translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. - * @param {Property} [options.pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. - * @param {Property} [options.imageSubRegion] A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this billboard will be displayed. - * @param {Property} [options.disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + * @param {BillboardGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo} */ diff --git a/Source/DataSources/BoxGraphics.js b/Source/DataSources/BoxGraphics.js index 2d5d73f6729c..789ef0032113 100644 --- a/Source/DataSources/BoxGraphics.js +++ b/Source/DataSources/BoxGraphics.js @@ -7,16 +7,19 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; /** * @typedef {Object} BoxGraphics.ConstructorOptions - * @property {Property|boolean} [show=true] A boolean Property specifying the visibility of the box. - * @property {Property|Cartesian3} [dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box. - * @property {Property|HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. - * @property {Property|boolean} [fill=true] A boolean Property specifying whether the box is filled with the provided material. - * @property {MaterialProperty|Color} [material=Color.WHITE] A Property specifying the material used to fill the box. - * @property {Property|boolean} [outline=false] A boolean Property specifying whether the box is outlined. - * @property {Property|Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @property {Property|number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @property {Property|ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources. - * @property {Property|DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed. + * + * Initialization options for the BoxGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the box. + * @property {Property | Cartesian3} [dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the box is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the box. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the box is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed. * */ @@ -26,7 +29,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias BoxGraphics * @constructor * - * @param {BoxGraphics.ConstructorOptions} [options] Object with the following properties: + * @param {BoxGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo} */ diff --git a/Source/DataSources/Cesium3DTilesetGraphics.js b/Source/DataSources/Cesium3DTilesetGraphics.js index c826ea25757e..3caf31975b3f 100644 --- a/Source/DataSources/Cesium3DTilesetGraphics.js +++ b/Source/DataSources/Cesium3DTilesetGraphics.js @@ -4,6 +4,16 @@ import DeveloperError from "../Core/DeveloperError.js"; import Event from "../Core/Event.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} Cesium3DTilesetGraphics.ConstructorOptions + * + * Initialization options for the Cesium3DTilesetGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the tileset. + * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the tileset. + * @property {Property | number} [maximumScreenSpaceError] A number or Property specifying the maximum screen space error used to drive level of detail refinement. + */ + /** * A 3D Tiles tileset represented by an {@link Entity}. * The tileset modelMatrix is determined by the containing Entity position and orientation @@ -12,10 +22,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias Cesium3DTilesetGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the tileset. - * @param {Property} [options.uri] A string or Resource Property specifying the URI of the tileset. - * @param {Property} [options.maximumScreenSpaceError] A number or Property specifying the maximum screen space error used to drive level of detail refinement. + * @param {Cesium3DTilesetGraphics.ConstructorOptions} [options] Object describing initialization options */ function Cesium3DTilesetGraphics(options) { this._definitionChanged = new Event(); diff --git a/Source/DataSources/CorridorGraphics.js b/Source/DataSources/CorridorGraphics.js index b19f77448e28..eff199e367c2 100644 --- a/Source/DataSources/CorridorGraphics.js +++ b/Source/DataSources/CorridorGraphics.js @@ -5,6 +5,31 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} CorridorGraphics.ConstructorOptions + * + * Initialization options for the CorridorGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the corridor. + * @property {Property | Cartesian3} [positions] A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. + * @property {Property | number} [width] A numeric Property specifying the distance between the edges of the corridor. + * @property {Property | number} [height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface. + * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. + * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the corridor is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the corridor. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the corridor is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the corridor casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this corridor will be displayed. + * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. + * @property {ConstantProperty | number} [zIndex] A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static. + */ + /** * Describes a corridor, which is a shape defined by a centerline and width that * conforms to the curvature of the globe. It can be placed on the surface or at altitude @@ -13,25 +38,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias CorridorGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the corridor. - * @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. - * @param {Property} [options.width] A numeric Property specifying the distance between the edges of the corridor. - * @param {Property} [options.height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface. - * @param {Property} [options.extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. - * @param {Property} [options.cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude. - * @param {Property} [options.fill=true] A boolean Property specifying whether the corridor is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the corridor. - * @param {Property} [options.outline=false] A boolean Property specifying whether the corridor is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the corridor casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this corridor will be displayed. - * @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. - * @param {ConstantProperty} [options.zIndex] A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static. + * @param {CorridorGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo} diff --git a/Source/DataSources/CylinderGraphics.js b/Source/DataSources/CylinderGraphics.js index 2972fb4221ca..1f03e2a9931a 100644 --- a/Source/DataSources/CylinderGraphics.js +++ b/Source/DataSources/CylinderGraphics.js @@ -5,6 +5,27 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} CylinderGraphics.ConstructorOptions + * + * Initialization options for the CylinderGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the cylinder. + * @property {Property | number} [length] A numeric Property specifying the length of the cylinder. + * @property {Property | number} [topRadius] A numeric Property specifying the radius of the top of the cylinder. + * @property {Property | number} [bottomRadius] A numeric Property specifying the radius of the bottom of the cylinder. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the cylinder is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the cylinder. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the cylinder is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. + * @property {Property | number} [slices=128] The number of edges around the perimeter of the cylinder. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the cylinder casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this cylinder will be displayed. + */ + /** * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius. * The center position and orientation are determined by the containing {@link Entity}. @@ -12,21 +33,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias CylinderGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the cylinder. - * @param {Property} [options.length] A numeric Property specifying the length of the cylinder. - * @param {Property} [options.topRadius] A numeric Property specifying the radius of the top of the cylinder. - * @param {Property} [options.bottomRadius] A numeric Property specifying the radius of the bottom of the cylinder. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. - * @param {Property} [options.fill=true] A boolean Property specifying whether the cylinder is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the cylinder. - * @param {Property} [options.outline=false] A boolean Property specifying whether the cylinder is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. - * @param {Property} [options.slices=128] The number of edges around the perimeter of the cylinder. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the cylinder casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this cylinder will be displayed. + * @param {CylinderGraphics.ConstructorOptions} [options] Object describing initialization options */ function CylinderGraphics(options) { this._definitionChanged = new Event(); diff --git a/Source/DataSources/EllipseGraphics.js b/Source/DataSources/EllipseGraphics.js index bb4ccaa45ed8..fe34d15cce85 100644 --- a/Source/DataSources/EllipseGraphics.js +++ b/Source/DataSources/EllipseGraphics.js @@ -5,6 +5,33 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} EllipseGraphics.ConstructorOptions + * + * Initialization options for the EllipseGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipse. + * @property {Property | number} [semiMajorAxis] The numeric Property specifying the semi-major axis. + * @property {Property | number} [semiMinorAxis] The numeric Property specifying the semi-minor axis. + * @property {Property | number} [height=0] A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface. + * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. + * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north. + * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipse is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipse. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipse is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipse casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipse will be displayed. + * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. + * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified. + */ + /** * Describes an ellipse defined by a center point and semi-major and semi-minor axes. * The ellipse conforms to the curvature of the globe and can be placed on the surface or @@ -14,27 +41,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias EllipseGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the ellipse. - * @param {Property} [options.semiMajorAxis] The numeric Property specifying the semi-major axis. - * @param {Property} [options.semiMinorAxis] The numeric Property specifying the semi-minor axis. - * @param {Property} [options.height=0] A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface. - * @param {Property} [options.extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. - * @param {Property} [options.rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north. - * @param {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse. - * @param {Property} [options.fill=true] A boolean Property specifying whether the ellipse is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the ellipse. - * @param {Property} [options.outline=false] A boolean Property specifying whether the ellipse is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipse casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipse will be displayed. - * @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. - * @param {ConstantProperty} [options.zIndex=0] A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified. + * @param {EllipseGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Circles and Ellipses.html|Cesium Sandcastle Circles and Ellipses Demo} */ diff --git a/Source/DataSources/EllipsoidGraphics.js b/Source/DataSources/EllipsoidGraphics.js index ef2ad391be52..3c999eafda81 100644 --- a/Source/DataSources/EllipsoidGraphics.js +++ b/Source/DataSources/EllipsoidGraphics.js @@ -5,31 +5,38 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} EllipsoidGraphics.ConstructorOptions + * + * Initialization options for the EllipsoidGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipsoid. + * @property {Property | Cartesian3} [radii] A {@link Cartesian3} Property specifying the radii of the ellipsoid. + * @property {Property | Cartesian3} [innerRadii] A {@link Cartesian3} Property specifying the inner radii of the ellipsoid. + * @property {Property | number} [minimumClock=0.0] A Property specifying the minimum clock angle of the ellipsoid. + * @property {Property | number} [maximumClock=2*PI] A Property specifying the maximum clock angle of the ellipsoid. + * @property {Property | number} [minimumCone=0.0] A Property specifying the minimum cone angle of the ellipsoid. + * @property {Property | number} [maximumCone=PI] A Property specifying the maximum cone angle of the ellipsoid. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipsoid is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipsoid. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipsoid is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | number} [stackPartitions=64] A Property specifying the number of stacks. + * @property {Property | number} [slicePartitions=64] A Property specifying the number of radial slices. + * @property {Property | number} [subdivisions=128] A Property specifying the number of samples per outline ring, determining the granularity of the curvature. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipsoid casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipsoid will be displayed. + */ + /** * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}. * * @alias EllipsoidGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the ellipsoid. - * @param {Property} [options.radii] A {@link Cartesian3} Property specifying the radii of the ellipsoid. - * @param {Property} [options.innerRadii] A {@link Cartesian3} Property specifying the inner radii of the ellipsoid. - * @param {Property} [options.minimumClock=0.0] A Property specifying the minimum clock angle of the ellipsoid. - * @param {Property} [options.maximumClock=2*PI] A Property specifying the maximum clock angle of the ellipsoid. - * @param {Property} [options.minimumCone=0.0] A Property specifying the minimum cone angle of the ellipsoid. - * @param {Property} [options.maximumCone=PI] A Property specifying the maximum cone angle of the ellipsoid. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to. - * @param {Property} [options.fill=true] A boolean Property specifying whether the ellipsoid is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the ellipsoid. - * @param {Property} [options.outline=false] A boolean Property specifying whether the ellipsoid is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.stackPartitions=64] A Property specifying the number of stacks. - * @param {Property} [options.slicePartitions=64] A Property specifying the number of radial slices. - * @param {Property} [options.subdivisions=128] A Property specifying the number of samples per outline ring, determining the granularity of the curvature. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipsoid casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipsoid will be displayed. + * @param {EllipsoidGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Spheres%20and%20Ellipsoids.html|Cesium Sandcastle Spheres and Ellipsoids Demo} */ diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js index c0a8097b1ea0..e57a5161fa5f 100644 --- a/Source/DataSources/Entity.js +++ b/Source/DataSources/Entity.js @@ -60,6 +60,42 @@ function createPropertyTypeDescriptor(name, Type) { }); } +/** + * @typedef {Object} Entity.ConstructorOptions + * + * Initialization options for the Entity constructor + * + * @property {String} [id] A unique identifier for this object. If none is provided, a GUID is generated. + * @property {String} [name] A human readable name to display to users. It does not have to be unique. + * @property {TimeIntervalCollection} [availability] The availability, if any, associated with this object. + * @property {Boolean} [show] A boolean value indicating if the entity and its children are displayed. + * @property {Property | string} [description] A string Property specifying an HTML description for this entity. + * @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position. + * **** TODO **** + * @property {Property} [orientation] A Property specifying the entity orientation. + * **** TODO **** + * @property {Property} [viewFrom] A suggested initial offset for viewing this object. + * @property {Entity} [parent] A parent entity to associate with this entity. + * @property {BillboardGraphics | BillboardGraphics.ConstructorOptions} [billboard] A billboard to associate with this entity. + * @property {BoxGraphics | BoxGraphics.ConstructorOptions} [box] A box to associate with this entity. + * @property {CorridorGraphics | CorridorGraphics.ConstructorOptions} [corridor] A corridor to associate with this entity. + * @property {CylinderGraphics | CylinderGraphics.ConstructorOptions} [cylinder] A cylinder to associate with this entity. + * @property {EllipseGraphics | EllipseGraphics.ConstructorOptions} [ellipse] A ellipse to associate with this entity. + * @property {EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions} [ellipsoid] A ellipsoid to associate with this entity. + * @property {LabelGraphics | LabelGraphics.ConstructorOptions} [label] A options.label to associate with this entity. + * @property {ModelGraphics | ModelGraphics.ConstructorOptions} [model] A model to associate with this entity. + * @property {Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions} [tileset] A 3D Tiles tileset to associate with this entity. + * @property {PathGraphics | PathGraphics.ConstructorOptions} [path] A path to associate with this entity. + * @property {PlaneGraphics | PlaneGraphics.ConstructorOptions} [plane] A plane to associate with this entity. + * @property {PointGraphics | PointGraphics.ConstructorOptions} [point] A point to associate with this entity. + * @property {PolygonGraphics | PolygonGraphics.ConstructorOptions} [polygon] A polygon to associate with this entity. + * @property {PolylineGraphics | PolylineGraphics.ConstructorOptions} [polyline] A polyline to associate with this entity. + * @property {PropertyBag | Object.} [properties] Arbitrary properties to associate with this entity. + * @property {PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions} [polylineVolume] A polylineVolume to associate with this entity. + * @property {RectangleGraphics | RectangleGraphics.ConstructorOptions} [rectangle] A rectangle to associate with this entity. + * @property {WallGraphics | WallGraphics.ConstructorOptions} [wall] A wall to associate with this entity. + */ + /** * Entity instances aggregate multiple forms of visualization into a single high-level object. * They can be created manually and added to {@link Viewer#entities} or be produced by @@ -67,34 +103,7 @@ function createPropertyTypeDescriptor(name, Type) { * @alias Entity * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {String} [options.id] A unique identifier for this object. If none is provided, a GUID is generated. - * @param {String} [options.name] A human readable name to display to users. It does not have to be unique. - * @param {TimeIntervalCollection} [options.availability] The availability, if any, associated with this object. - * @param {Boolean} [options.show] A boolean value indicating if the entity and its children are displayed. - * @param {Property} [options.description] A string Property specifying an HTML description for this entity. - * @param {PositionProperty} [options.position] A Property specifying the entity position. - * @param {Property} [options.orientation] A Property specifying the entity orientation. - * @param {Property} [options.viewFrom] A suggested initial offset for viewing this object. - * @param {Entity} [options.parent] A parent entity to associate with this entity. - * @param {BillboardGraphics} [options.billboard] A billboard to associate with this entity. - * @param {BoxGraphics} [options.box] A box to associate with this entity. - * @param {CorridorGraphics} [options.corridor] A corridor to associate with this entity. - * @param {CylinderGraphics} [options.cylinder] A cylinder to associate with this entity. - * @param {EllipseGraphics} [options.ellipse] A ellipse to associate with this entity. - * @param {EllipsoidGraphics} [options.ellipsoid] A ellipsoid to associate with this entity. - * @param {LabelGraphics} [options.label] A options.label to associate with this entity. - * @param {ModelGraphics} [options.model] A model to associate with this entity. - * @param {Cesium3DTilesetGraphics} [options.tileset] A 3D Tiles tileset to associate with this entity. - * @param {PathGraphics} [options.path] A path to associate with this entity. - * @param {PlaneGraphics} [options.plane] A plane to associate with this entity. - * @param {PointGraphics} [options.point] A point to associate with this entity. - * @param {PolygonGraphics} [options.polygon] A polygon to associate with this entity. - * @param {PolylineGraphics} [options.polyline] A polyline to associate with this entity. - * @param {PropertyBag} [options.properties] Arbitrary properties to associate with this entity. - * @param {PolylineVolumeGraphics} [options.polylineVolume] A polylineVolume to associate with this entity. - * @param {RectangleGraphics} [options.rectangle] A rectangle to associate with this entity. - * @param {WallGraphics} [options.wall] A wall to associate with this entity. + * @param {Entity.ConstructorOptions} [options] Object describing initialization options * * @see {@link https://cesium.com/docs/tutorials/creating-entities/|Creating Entities} */ diff --git a/Source/DataSources/EntityCollection.js b/Source/DataSources/EntityCollection.js index c28ce12c4f6a..9bd630ab63ec 100644 --- a/Source/DataSources/EntityCollection.js +++ b/Source/DataSources/EntityCollection.js @@ -264,7 +264,7 @@ EntityCollection.prototype.computeAvailability = function () { /** * Add an entity to the collection. * - * @param {Entity} entity The entity to be added. + * @param {Entity | Entity.ConstructorOptions} entity The entity to be added. * @returns {Entity} The entity that was added. * @exception {DeveloperError} An entity with already exists in this collection. */ diff --git a/Source/DataSources/LabelGraphics.js b/Source/DataSources/LabelGraphics.js index 18502e83b813..3495a7e88e08 100644 --- a/Source/DataSources/LabelGraphics.js +++ b/Source/DataSources/LabelGraphics.js @@ -4,6 +4,34 @@ import DeveloperError from "../Core/DeveloperError.js"; import Event from "../Core/Event.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} LabelGraphics.ConstructorOptions + * + * Initialization options for the LabelGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the label. + * @property {Property | string} [text] A Property specifying the text. Explicit newlines '\n' are supported. + * @property {Property | string} [font='30px sans-serif'] A Property specifying the CSS font. + * @property {Property | LabelStyle} [style=LabelStyle.FILL] A Property specifying the {@link LabelStyle}. + * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the text. + * @property {Property | boolean} [showBackground=false] A boolean Property specifying the visibility of the background behind the label. + * @property {Property | Color} [backgroundColor=new Color(0.165, 0.165, 0.165, 0.8)] A Property specifying the background {@link Color}. + * @property {Property | Cartesian2} [backgroundPadding=new Cartesian2(7, 5)] A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels. + * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset. + * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset. + * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}. + * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | Color} [fillColor=Color.WHITE] A Property specifying the fill {@link Color}. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the outline {@link Color}. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the outline width. + * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. + * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to set scale based on distance from the camera. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this label will be displayed. + * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + */ + /** * Describes a two dimensional label located at the position of the containing {@link Entity}. *

    @@ -16,28 +44,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias LabelGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the label. - * @param {Property} [options.text] A Property specifying the text. Explicit newlines '\n' are supported. - * @param {Property} [options.font='30px sans-serif'] A Property specifying the CSS font. - * @param {Property} [options.style=LabelStyle.FILL] A Property specifying the {@link LabelStyle}. - * @param {Property} [options.scale=1.0] A numeric Property specifying the scale to apply to the text. - * @param {Property} [options.showBackground=false] A boolean Property specifying the visibility of the background behind the label. - * @param {Property} [options.backgroundColor=new Color(0.165, 0.165, 0.165, 0.8)] A Property specifying the background {@link Color}. - * @param {Property} [options.backgroundPadding=new Cartesian2(7, 5)] A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels. - * @param {Property} [options.pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset. - * @param {Property} [options.eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset. - * @param {Property} [options.horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}. - * @param {Property} [options.verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.fillColor=Color.WHITE] A Property specifying the fill {@link Color}. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the outline {@link Color}. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the outline width. - * @param {Property} [options.translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. - * @param {Property} [options.pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. - * @param {Property} [options.scaleByDistance] A {@link NearFarScalar} Property used to set scale based on distance from the camera. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this label will be displayed. - * @param {Property} [options.disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + * @param {LabelGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo} */ diff --git a/Source/DataSources/ModelGraphics.js b/Source/DataSources/ModelGraphics.js index feb714d52cbb..a30b00954c88 100644 --- a/Source/DataSources/ModelGraphics.js +++ b/Source/DataSources/ModelGraphics.js @@ -18,6 +18,34 @@ function createArticulationStagePropertyBag(value) { return new PropertyBag(value); } +/** + * @typedef {Object} ModelGraphics.ConstructorOptions + * + * Initialization options for the ModelGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the model. + * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the glTF asset. + * @property {Property | number} [scale=1.0] A numeric Property specifying a uniform linear scale. + * @property {Property | number} [minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom. + * @property {Property | number} [maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize. + * @property {Property | boolean} [incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded. + * @property {Property | boolean} [runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started. + * @property {Property | boolean} [clampAnimations=true] A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. + * @property {Property | ShadowMode} [shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from light sources. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | Color} [silhouetteColor=Color.RED] A Property specifying the {@link Color} of the silhouette. + * @property {Property | number} [silhouetteSize=0.0] A numeric Property specifying the size of the silhouette in pixels. + * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color. + * @property {Property | ColorBlendMode} [colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model. + * @property {Property | number} [colorBlendAmount=0.5] A numeric Property specifying the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. + * @property {Property | Cartesian2} [imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting. + * @property {Property | Color} [lightColor] A property specifying the light color when shading the model. When undefined the scene's light color is used instead. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed. + * @property {PropertyBag | Object.} [nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. + * @property {PropertyBag | Object.} [articulations] An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties. + * @property {Property | ClippingPlaneCollection} [clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. + */ + /** * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL. * The position and orientation of the model is determined by the containing {@link Entity}. @@ -29,28 +57,7 @@ function createArticulationStagePropertyBag(value) { * @alias ModelGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the model. - * @param {Property} [options.uri] A string or Resource Property specifying the URI of the glTF asset. - * @param {Property} [options.scale=1.0] A numeric Property specifying a uniform linear scale. - * @param {Property} [options.minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom. - * @param {Property} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize. - * @param {Property} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded. - * @param {Property} [options.runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started. - * @param {Property} [options.clampAnimations=true] A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. - * @param {Property} [options.shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from light sources. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.silhouetteColor=Color.RED] A Property specifying the {@link Color} of the silhouette. - * @param {Property} [options.silhouetteSize=0.0] A numeric Property specifying the size of the silhouette in pixels. - * @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color. - * @param {Property} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model. - * @param {Property} [options.colorBlendAmount=0.5] A numeric Property specifying the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. - * @param {Property} [options.imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting. - * @param {Property} [options.lightColor] A property specifying the light color when shading the model. When undefined the scene's light color is used instead. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed. - * @param {PropertyBag} [options.nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. - * @param {PropertyBag} [options.articulations] An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties. - * @param {Property} [options.clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. + * @param {ModelGraphics.ConstructorOptions} [options] Object describing initialization options * * @see {@link https://cesium.com/docs/tutorials/3d-models/|3D Models Tutorial} * @demo {@link https://sandcastle.cesium.com/index.html?src=3D%20Models.html|Cesium Sandcastle 3D Models Demo} diff --git a/Source/DataSources/PathGraphics.js b/Source/DataSources/PathGraphics.js index ba377b917498..4e95e18792de 100644 --- a/Source/DataSources/PathGraphics.js +++ b/Source/DataSources/PathGraphics.js @@ -5,20 +5,27 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} PathGraphics.ConstructorOptions + * + * Initialization options for the PathGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the path. + * @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show. + * @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show. + * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels. + * @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed. + */ + /** * Describes a polyline defined as the path made by an {@link Entity} as it moves over time. * * @alias PathGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the path. - * @param {Property} [options.leadTime] A Property specifying the number of seconds in front the object to show. - * @param {Property} [options.trailTime] A Property specifying the number of seconds behind of the object to show. - * @param {Property} [options.width=1.0] A numeric Property specifying the width in pixels. - * @param {Property} [options.resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to draw the path. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed. + * @param {PathGraphics.ConstructorOptions} [options] Object describing initialization options */ function PathGraphics(options) { this._definitionChanged = new Event(); diff --git a/Source/DataSources/PlaneGraphics.js b/Source/DataSources/PlaneGraphics.js index 610733a723b6..2745da6a6661 100644 --- a/Source/DataSources/PlaneGraphics.js +++ b/Source/DataSources/PlaneGraphics.js @@ -5,23 +5,30 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} PlaneGraphics.ConstructorOptions + * + * Initialization options for the PlaneGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the plane. + * @property {Property | Plane} [plane] A {@link Plane} Property specifying the normal and distance for the plane. + * @property {Property | Cartesian2} [dimensions] A {@link Cartesian2} Property specifying the width and height of the plane. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the plane is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the plane. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the plane is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the plane casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this plane will be displayed. + */ + /** * Describes a plane. The center position and orientation are determined by the containing {@link Entity}. * * @alias PlaneGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the plane. - * @param {Property} [options.plane] A {@link Plane} Property specifying the normal and distance for the plane. - * @param {Property} [options.dimensions] A {@link Cartesian2} Property specifying the width and height of the plane. - * @param {Property} [options.fill=true] A boolean Property specifying whether the plane is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the plane. - * @param {Property} [options.outline=false] A boolean Property specifying whether the plane is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the plane casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this plane will be displayed. + * @param {PlaneGraphics.ConstructorOptions} [options] Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Plane.html|Cesium Sandcastle Plane Demo} */ diff --git a/Source/DataSources/PointGraphics.js b/Source/DataSources/PointGraphics.js index eff6d916eeec..982d86906ff8 100644 --- a/Source/DataSources/PointGraphics.js +++ b/Source/DataSources/PointGraphics.js @@ -4,23 +4,30 @@ import DeveloperError from "../Core/DeveloperError.js"; import Event from "../Core/Event.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} PointGraphics.ConstructorOptions + * + * Initialization options for the PointGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the point. + * @property {Property | number} [pixelSize=1] A numeric Property specifying the size in pixels. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} of the point. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=0] A numeric Property specifying the the outline width in pixels. + * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance. + * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this point will be displayed. + * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + */ + /** * Describes a graphical point located at the position of the containing {@link Entity}. * * @alias PointGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the point. - * @param {Property} [options.pixelSize=1] A numeric Property specifying the size in pixels. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} of the point. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=0] A numeric Property specifying the the outline width in pixels. - * @param {Property} [options.scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance. - * @param {Property} [options.translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this point will be displayed. - * @param {Property} [options.disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to. + * @param {PointGraphics.ConstructorOptions} [options] Object describing initialization options */ function PointGraphics(options) { this._definitionChanged = new Event(); diff --git a/Source/DataSources/PolygonGraphics.js b/Source/DataSources/PolygonGraphics.js index c3fb0b10d854..fb813e568dca 100644 --- a/Source/DataSources/PolygonGraphics.js +++ b/Source/DataSources/PolygonGraphics.js @@ -15,6 +15,34 @@ function createPolygonHierarchyProperty(value) { return new ConstantProperty(value); } +/** + * @typedef {Object} PolygonGraphics.ConstructorOptions + * + * Initialization options for the PolygonGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polygon. + * @property {Property | PolygonHierarchy} [hierarchy] A Property specifying the {@link PolygonHierarchy}. + * @property {Property | number} [height=0] A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface. + * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. + * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the polygon texture counter-clockwise from north. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the polygon is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the polygon. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the polygon is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | boolean} [perPositionHeight=false] A boolean specifying whether or not the height of each position is used. + * @property {Boolean | boolean} [closeTop=true] When false, leaves off the top of an extruded polygon open. + * @property {Boolean | boolean} [closeBottom=true] When false, leaves off the bottom of an extruded polygon open. + * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polygon casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polygon will be displayed. + * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. + * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. + */ + /** * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes. * The polygon conforms to the curvature of the globe and can be placed on the surface or @@ -23,28 +51,7 @@ function createPolygonHierarchyProperty(value) { * @alias PolygonGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the polygon. - * @param {Property} [options.hierarchy] A Property specifying the {@link PolygonHierarchy}. - * @param {Property} [options.height=0] A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface. - * @param {Property} [options.extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. - * @param {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the polygon texture counter-clockwise from north. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. - * @param {Property} [options.fill=true] A boolean Property specifying whether the polygon is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the polygon. - * @param {Property} [options.outline=false] A boolean Property specifying whether the polygon is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.perPositionHeight=false] A boolean specifying whether or not the height of each position is used. - * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open. - * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open. - * @param {Property} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the polygon casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this polygon will be displayed. - * @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. - * @param {ConstantProperty} [options.zIndex=0] A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. + * @param {PolygonGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo} diff --git a/Source/DataSources/PolylineGraphics.js b/Source/DataSources/PolylineGraphics.js index 2096a57ec31b..1230a1565490 100644 --- a/Source/DataSources/PolylineGraphics.js +++ b/Source/DataSources/PolylineGraphics.js @@ -5,6 +5,28 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} PolylineGraphics.ConstructorOptions + * + * Initialization options for the PolylineGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polyline. + * @property {Property | Array} [positions] A Property specifying the array of {@link Cartesian3} positions that define the line strip. + * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the polyline. + * @property {MaterialProperty | Color} [depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain. + * + * **** TODO **** this was originally only ArcType, not a Property (!) -- pretty sure that was wrong? + * + * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. + * @property {Property | boolean} [clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polyline will be displayed. + * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. + * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported. + */ + /** * Describes a polyline. The first two positions define a line segment, * and each additional position defines a line segment from the previous position. The segments @@ -13,19 +35,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias PolylineGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the polyline. - * @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions that define the line strip. - * @param {Property} [options.width=1.0] A numeric Property specifying the width in pixels. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to draw the polyline. - * @param {MaterialProperty} [options.depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain. - * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. - * @param {Property} [options.clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this polyline will be displayed. - * @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. - * @param {Property} [options.zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported. + * @param {PolylineGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo} diff --git a/Source/DataSources/PolylineVolumeGraphics.js b/Source/DataSources/PolylineVolumeGraphics.js index bbc4dda8fdbd..103da05c7dad 100644 --- a/Source/DataSources/PolylineVolumeGraphics.js +++ b/Source/DataSources/PolylineVolumeGraphics.js @@ -5,6 +5,25 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} PolylineVolumeGraphics.ConstructorOptions + * + * Initialization options for the PolylineVolumeGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the volume. + * @property {Property | Array} [positions] A Property specifying the array of {@link Cartesian3} positions which define the line strip. + * @property {Property | Array} [shape] A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. + * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the volume is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the volume. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the volume is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the volume casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this volume will be displayed. + */ + /** * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it. * The resulting volume conforms to the curvature of the globe. @@ -12,19 +31,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias PolylineVolumeGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the volume. - * @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions which define the line strip. - * @param {Property} [options.shape] A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. - * @param {Property} [options.cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. - * @param {Property} [options.fill=true] A boolean Property specifying whether the volume is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the volume. - * @param {Property} [options.outline=false] A boolean Property specifying whether the volume is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the volume casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this volume will be displayed. + * @param {PolylineVolumeGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo} diff --git a/Source/DataSources/RectangleGraphics.js b/Source/DataSources/RectangleGraphics.js index 1c36248a7635..d5423e713b87 100644 --- a/Source/DataSources/RectangleGraphics.js +++ b/Source/DataSources/RectangleGraphics.js @@ -5,6 +5,31 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} RectangleGraphics.ConstructorOptions + * + * Initialization options for the RectangleGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the rectangle. + * @property {Property | Rectangle} [coordinates] The Property specifying the {@link Rectangle}. + * @property {Property | number} [height=0] A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. + * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to. + * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. + * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. + * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the rectangle clockwise from north. + * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the rectangle. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the rectangle is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the rectangle. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the rectangle is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the rectangle casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this rectangle will be displayed. + * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. + * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. + */ + /** * Describes graphics for a {@link Rectangle}. * The rectangle conforms to the curvature of the globe and can be placed on the surface or @@ -13,25 +38,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias RectangleGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the rectangle. - * @param {Property} [options.coordinates] The Property specifying the {@link Rectangle}. - * @param {Property} [options.height=0] A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. - * @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to. - * @param {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. - * @param {Property} [options.extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to. - * @param {Property} [options.rotation=0.0] A numeric property specifying the rotation of the rectangle clockwise from north. - * @param {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the rectangle. - * @param {Property} [options.fill=true] A boolean Property specifying whether the rectangle is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the rectangle. - * @param {Property} [options.outline=false] A boolean Property specifying whether the rectangle is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the rectangle casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this rectangle will be displayed. - * @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. - * @param {Property} [options.zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. + * @param {RectangleGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo} diff --git a/Source/DataSources/WallGraphics.js b/Source/DataSources/WallGraphics.js index 8ddb921b59b2..8ad9f13bcf8b 100644 --- a/Source/DataSources/WallGraphics.js +++ b/Source/DataSources/WallGraphics.js @@ -5,6 +5,25 @@ import Event from "../Core/Event.js"; import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js"; import createPropertyDescriptor from "./createPropertyDescriptor.js"; +/** + * @typedef {Object} WallGraphics.ConstructorOptions + * + * Initialization options for the WallGraphics constructor + * + * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the wall. + * @property {Property | Array} [positions] A Property specifying the array of {@link Cartesian3} positions which define the top of the wall. + * @property {Property | Array} [minimumHeights] A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface. + * @property {Property | Array} [maximumHeights] A Property specifying an array of heights to be used for the top of the wall instead of the height of each position. + * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. + * @property {Property | boolean} [fill=true] A boolean Property specifying whether the wall is filled with the provided material. + * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the wall. + * @property {Property | boolean} [outline=false] A boolean Property specifying whether the wall is outlined. + * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. + * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline. + * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the wall casts or receives shadows from light sources. + * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this wall will be displayed. + */ + /** * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights. * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude. @@ -12,19 +31,7 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @alias WallGraphics * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {Property} [options.show=true] A boolean Property specifying the visibility of the wall. - * @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions which define the top of the wall. - * @param {Property} [options.minimumHeights] A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface. - * @param {Property} [options.maximumHeights] A Property specifying an array of heights to be used for the top of the wall instead of the height of each position. - * @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point. - * @param {Property} [options.fill=true] A boolean Property specifying whether the wall is filled with the provided material. - * @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the wall. - * @param {Property} [options.outline=false] A boolean Property specifying whether the wall is outlined. - * @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline. - * @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline. - * @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the wall casts or receives shadows from light sources. - * @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this wall will be displayed. + * @param {WallGraphics.ConstructorOptions} [options] Object describing initialization options * * @see Entity * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo} From ca986af4afa972f33a0f75b146a4c003a3d1889c Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 16:32:23 +0200 Subject: [PATCH 22/36] Various small type fixes --- Source/Core/Math.js | 3 --- Source/DataSources/Entity.js | 2 +- Source/Scene/Camera.js | 5 +++-- Source/Widgets/CesiumWidget/CesiumWidget.js | 4 ++-- Source/Widgets/Viewer/Viewer.js | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/Math.js b/Source/Core/Math.js index 83fa3d985703..7e94e525ccc3 100644 --- a/Source/Core/Math.js +++ b/Source/Core/Math.js @@ -411,7 +411,6 @@ CesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI); * * @type {Number} * @constant - * @default Math.PI / 180.0 */ CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0; @@ -420,7 +419,6 @@ CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0; * * @type {Number} * @constant - * @default 180.0 / Math.PI */ CesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI; @@ -429,7 +427,6 @@ CesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI; * * @type {Number} * @constant - * @default {@link CesiumMath.RADIANS_PER_DEGREE} / 3600.0 */ CesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0; diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js index e57a5161fa5f..80493ed55ab4 100644 --- a/Source/DataSources/Entity.js +++ b/Source/DataSources/Entity.js @@ -70,7 +70,7 @@ function createPropertyTypeDescriptor(name, Type) { * @property {TimeIntervalCollection} [availability] The availability, if any, associated with this object. * @property {Boolean} [show] A boolean value indicating if the entity and its children are displayed. * @property {Property | string} [description] A string Property specifying an HTML description for this entity. - * @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position. + * @property {PositionProperty | CallbackProperty | Cartesian3} [position] A Property specifying the entity position. * **** TODO **** * @property {Property} [orientation] A Property specifying the entity orientation. * **** TODO **** diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index 167e2631b10e..fc964c53d5a0 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -2804,8 +2804,9 @@ function pickMapColumbusView(camera, windowPosition, projection, result) { * @param {Cartesian2} windowPosition The x and y coordinates of a pixel. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to pick. * @param {Cartesian3} [result] The object onto which to store the result. - * @returns {Cartesian3} If the ellipsoid or map was picked, returns the point on the surface of the ellipsoid or map - * in world coordinates. If the ellipsoid or map was not picked, returns undefined. + * @returns {Cartesian3 | undefined} If the ellipsoid or map was picked, + * returns the point on the surface of the ellipsoid or map in world + * coordinates. If the ellipsoid or map was not picked, returns undefined. * * @example * var canvas = viewer.scene.canvas; diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index b008161b2030..fdc1c2559d1b 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -128,8 +128,8 @@ function configureCameraFrustum(widget) { * @param {Clock} [options.clock=new Clock()] The clock to use to control current time. * @param {ImageryProvider} [options.imageryProvider=createWorldImagery()] The imagery provider to serve as the base layer. If set to false, no imagery provider will be added. * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider. - * @param {SkyBox} [options.skyBox] The skybox used to render the stars. When undefined, the default stars are used. If set to false, no skyBox, Sun, or Moon will be added. - * @param {SkyAtmosphere} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. + * @param {SkyBox| false} [options.skyBox] The skybox used to render the stars. When undefined, the default stars are used. If set to false, no skyBox, Sun, or Moon will be added. + * @param {SkyAtmosphere | false} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode. * @param {Boolean} [options.scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory. * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index 6e27585a1813..9cc153afabc0 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -1967,7 +1967,7 @@ Viewer.prototype.zoomTo = function (target, offset) { * @param {Number} [options.duration=3.0] The duration of the flight in seconds. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target. - * @returns {Promise.} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions + * @returns {Promise.} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions */ Viewer.prototype.flyTo = function (target, options) { return zoomToOrFly(this, target, options, true); From 9678a43b58f15961a729ffbcbade1019780b5188 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 17:14:47 +0200 Subject: [PATCH 23/36] Selected/tracked entity can be undefined --- Source/Widgets/Viewer/Viewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index 9cc153afabc0..ef35e2c61d3d 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -1321,7 +1321,7 @@ Object.defineProperties(Viewer.prototype, { /** * Gets or sets the Entity instance currently being tracked by the camera. * @memberof Viewer.prototype - * @type {Entity} + * @type {Entity | undefined} */ trackedEntity: { get: function () { @@ -1370,7 +1370,7 @@ Object.defineProperties(Viewer.prototype, { /** * Gets or sets the object instance for which to display a selection indicator. * @memberof Viewer.prototype - * @type {Entity} + * @type {Entity | undefined} */ selectedEntity: { get: function () { From 14c5ec14e80b42c64b54a6750f89e199a3570bbe Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 17:40:58 +0200 Subject: [PATCH 24/36] First pass at generic Events --- Source/Core/Event.js | 5 +++-- Source/DataSources/DataSource.js | 4 ++-- Source/DataSources/EntityCluster.js | 5 +++-- gulpfile.cjs | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 99001dc5fce5..8becdbdbb9eb 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -7,6 +7,7 @@ import defined from "./defined.js"; * exposed as a property for others to subscribe to. * * @alias Event + * @template Listener the function call signature for this event's listeners * @constructor * @example * MyObject.prototype.myListener = function(arg1, arg2) { @@ -46,7 +47,7 @@ Object.defineProperties(Event.prototype, { * An optional scope can be provided to serve as the this pointer * in which the function will execute. * - * @param {Function} listener The function to be executed when the event is raised. + * @param {Listener} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked. @@ -71,7 +72,7 @@ Event.prototype.addEventListener = function (listener, scope) { /** * Unregisters a previously registered callback. * - * @param {Function} listener The function to be unregistered. + * @param {Listener} listener The function to be unregistered. * @param {Object} [scope] The scope that was originally passed to addEventListener. * @returns {Boolean} true if the listener was removed; false if the listener and scope are not registered with the event. * diff --git a/Source/DataSources/DataSource.js b/Source/DataSources/DataSource.js index 182dac7602bf..4ac760371721 100644 --- a/Source/DataSources/DataSource.js +++ b/Source/DataSources/DataSource.js @@ -58,7 +58,7 @@ Object.defineProperties(DataSource.prototype, { /** * Gets an event that will be raised if an error is encountered during processing. * @memberof DataSource.prototype - * @type {Event} + * @type {Event} */ errorEvent: { get: DeveloperError.throwInstantiationError, @@ -66,7 +66,7 @@ Object.defineProperties(DataSource.prototype, { /** * Gets an event that will be raised when the value of isLoading changes. * @memberof DataSource.prototype - * @type {Event} + * @type {Event} */ loadingEvent: { get: DeveloperError.throwInstantiationError, diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 2779deb12142..cee9319edec1 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -549,7 +549,7 @@ Object.defineProperties(EntityCluster.prototype, { /** * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. * @memberof EntityCluster.prototype - * @type {Event} + * @type {Event} */ clusterEvent: { get: function () { @@ -963,7 +963,8 @@ EntityCluster.prototype.destroy = function () { * @callback EntityCluster.newClusterCallback * * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster. - * @param {Object} cluster An object containing billboard, label, and point properties. The values are the same as + * @param {{billboard: Billboard, label: Label, point: PointPrimitive}} cluster An object + * containing billboard, label, and point properties. The values are the same as * billboard, label and point entities, but must be the values of the ConstantProperty. * * @example diff --git a/gulpfile.cjs b/gulpfile.cjs index b0c8debaa3ec..691253302c9a 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1561,6 +1561,11 @@ function createTypeScriptDefinitions() { .replace(/String\[]/gm, "string[]") .replace(/Boolean\[]/gm, "boolean[]") .replace(/Object\[]/gm, "object[]") + // This is an ugly hack but @template doesn't actually seem to work + .replace( + /export class Event {/gm, + "export class Event {" + ) .replace( /= "WebGLConstants\.(.+)"/gm, (match, p1) => `= WebGLConstants.${p1}` From 2b91930281002c6a4e9d00751ba6feb914eb7a8d Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 17:56:17 +0200 Subject: [PATCH 25/36] Constructor interfaces for ImageryProviders --- .../Scene/ArcGisMapServerImageryProvider.js | 43 ++++++++------- .../GoogleEarthEnterpriseImageryProvider.js | 23 +++++--- .../GoogleEarthEnterpriseMapsProvider.js | 51 ++++++++++-------- Source/Scene/WebMapServiceImageryProvider.js | 53 +++++++++++-------- .../Scene/WebMapTileServiceImageryProvider.js | 49 +++++++++-------- 5 files changed, 127 insertions(+), 92 deletions(-) diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 9ee092a137e2..0f7c34c6049c 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -21,16 +21,13 @@ import ImageryLayerFeatureInfo from "./ImageryLayerFeatureInfo.js"; import ImageryProvider from "./ImageryProvider.js"; /** - * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are - * used, if available. + * @typedef {Object} ArcGisMapServerImageryProvider.ConstructorOptions * - * @alias ArcGisMapServerImageryProvider - * @constructor + * Initialization options for the ArcGisMapServerImageryProvider constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The URL of the ArcGIS MapServer service. - * @param {String} [options.token] The ArcGIS token used to authenticate with the ArcGIS MapServer service. - * @param {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile + * @property {Resource|String} url The URL of the ArcGIS MapServer service. + * @property {String} [token] The ArcGIS token used to authenticate with the ArcGIS MapServer service. + * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile * is invalid and should be discarded. If this value is not specified, a default * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case, @@ -41,27 +38,37 @@ import ImageryProvider from "./ImageryProvider.js"; * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this * parameter. - * @param {Boolean} [options.usePreCachedTilesIfAvailable=true] If true, the server's pre-cached + * @property {Boolean} [usePreCachedTilesIfAvailable=true] If true, the server's pre-cached * tiles are used if they are available. If false, any pre-cached tiles are ignored and the * 'export' service is used. - * @param {String} [options.layers] A comma-separated list of the layers to show, or undefined if all layers should be shown. - * @param {Boolean} [options.enablePickFeatures=true] If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke + * @property {String} [layers] A comma-separated list of the layers to show, or undefined if all layers should be shown. + * @property {Boolean} [enablePickFeatures=true] If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke * the Identify service on the MapServer and return the features included in the response. If false, * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. Set this property to false if you don't want this provider's features to * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. This parameter is ignored when accessing + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. This parameter is ignored when accessing * a tiled layer. - * @param {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles. + * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles. * This parameter is ignored when accessing a tiled server. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified and used, + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified and used, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. - * @param {Number} [options.tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server. - * @param {Number} [options.tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server. - * @param {Number} [options.maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing + * @property {Credit|String} credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. + * @property {Number} [tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server. + * @property {Number} [tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server. + * @property {Number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing * a tiled server. + */ + +/** + * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are + * used, if available. + * + * @alias ArcGisMapServerImageryProvider + * @constructor + * + * @param {ArcGisMapServerImageryProvider.ConstructorOptions} options Object describing initialization options * * @see BingMapsImageryProvider * @see GoogleEarthEnterpriseMapsProvider diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js index a179b0b5a136..ed6054161d42 100644 --- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js @@ -43,6 +43,20 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function ( return image === this._image; }; +/** + * @typedef {Object} GoogleEarthEnterpriseImageryProvider.ConstructorOptions + * + * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor + * + * @property {Resource|String} url The url of the Google Earth Enterprise server hosting the imagery. + * @property {GoogleEarthEnterpriseMetadata} metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile + * is invalid and should be discarded. If this value is not specified, a default + * is to discard tiles that fail to download. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + */ + /** * Provides tiled imagery using the Google Earth Enterprise REST API. * @@ -52,14 +66,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function ( * @alias GoogleEarthEnterpriseImageryProvider * @constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The url of the Google Earth Enterprise server hosting the imagery. - * @param {GoogleEarthEnterpriseMetadata} options.metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile - * is invalid and should be discarded. If this value is not specified, a default - * is to discard tiles that fail to download. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @param {GoogleEarthEnterpriseImageryProvider.ConstructorOptions} options Object describing initialization options * * @see GoogleEarthEnterpriseTerrainProvider * @see ArcGisMapServerImageryProvider diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js index f32f24ca16ab..4f3150017bc4 100644 --- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js @@ -15,26 +15,12 @@ import when from "../ThirdParty/when.js"; import ImageryProvider from "./ImageryProvider.js"; /** - * Provides tiled imagery using the Google Earth Imagery API. - * - * Notes: This imagery provider does not work with the public Google Earth servers. It works with the - * Google Earth Enterprise Server. - * - * By default the Google Earth Enterprise server does not set the - * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either - * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf - * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and - * '<Directory "/opt/google/gehttpd/htdocs">' directives. + * @typedef {Object} GoogleEarthEnterpriseMapsProvider.ConstructorOptions * - * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it - * is necessary to use {@link GoogleEarthEnterpriseImageryProvider} + * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor * - * @alias GoogleEarthEnterpriseMapsProvider - * @constructor - * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The url of the Google Earth server hosting the imagery. - * @param {Number} options.channel The channel (id) to be used when requesting data from the server. + * @property {Resource|String} url The url of the Google Earth server hosting the imagery. + * @property {Number} channel The channel (id) to be used when requesting data from the server. * The channel number can be found by looking at the json file located at: * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that @@ -52,13 +38,34 @@ import ImageryProvider from "./ImageryProvider.js"; * } * ] * } - * @param {String} [options.path="/default_map"] The path of the Google Earth server hosting the imagery. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the Google Earth + * @property {String} [path="/default_map"] The path of the Google Earth server hosting the imagery. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the Google Earth * Enterprise server, or undefined if there is no limit. - * @param {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile + * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass * a {@link NeverTileDiscardPolicy} for this parameter. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + */ + +/** + * Provides tiled imagery using the Google Earth Imagery API. + * + * Notes: This imagery provider does not work with the public Google Earth servers. It works with the + * Google Earth Enterprise Server. + * + * By default the Google Earth Enterprise server does not set the + * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either + * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf + * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and + * '<Directory "/opt/google/gehttpd/htdocs">' directives. + * + * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it + * is necessary to use {@link GoogleEarthEnterpriseImageryProvider} + * + * @alias GoogleEarthEnterpriseMapsProvider + * @constructor + * + * @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} options Object describing initialization options * * @exception {RuntimeError} Could not find layer with channel (id) of options.channel. * @exception {RuntimeError} Could not find a version in channel (id) options.channel. diff --git a/Source/Scene/WebMapServiceImageryProvider.js b/Source/Scene/WebMapServiceImageryProvider.js index 53c4a280dcab..617aa081fcd8 100644 --- a/Source/Scene/WebMapServiceImageryProvider.js +++ b/Source/Scene/WebMapServiceImageryProvider.js @@ -9,44 +9,51 @@ import TimeDynamicImagery from "./TimeDynamicImagery.js"; import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; /** - * Provides tiled imagery hosted by a Web Map Service (WMS) server. + * @typedef {Object} WebMapServiceImageryProvider.ConstructorOptions * - * @alias WebMapServiceImageryProvider - * @constructor + * Initialization options for the WebMapServiceImageryProvider constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}. - * @param {String} options.layers The layers to include, separated by commas. - * @param {Object} [options.parameters=WebMapServiceImageryProvider.DefaultParameters] Additional parameters to pass to the WMS server in the GetMap URL. - * @param {Object} [options.getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL. - * @param {Boolean} [options.enablePickFeatures=true] If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke + * @property {Resource|String} url The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}. + * @property {String} layers The layers to include, separated by commas. + * @property {Object} [parameters=WebMapServiceImageryProvider.DefaultParameters] Additional parameters to pass to the WMS server in the GetMap URL. + * @property {Object} [getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL. + * @property {Boolean} [enablePickFeatures=true] If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) * without communicating with the server. Set this property to false if you know your WMS server does not support * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. - * @param {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats + * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats * in which to try WMS GetFeatureInfo requests. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. - * @param {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. + * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @param {Number} [options.tileWidth=256] The width of each tile in pixels. - * @param {Number} [options.tileHeight=256] The height of each tile in pixels. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when + * @property {Number} [tileWidth=256] The width of each tile in pixels. + * @property {Number} [tileHeight=256] The height of each tile in pixels. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is * likely to result in rendering problems. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * If not specified, there is no limit. - * @param {String} [options.crs] CRS specification, for use with WMS specification >= 1.3.0. - * @param {String} [options.srs] SRS specification, for use with WMS specification 1.1.0 or 1.1.1 - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. - * @param {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. + * @property {String} [crs] CRS specification, for use with WMS specification >= 1.3.0. + * @property {String} [srs] SRS specification, for use with WMS specification 1.1.0 or 1.1.1 + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + * @property {String|String[]} [subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. - * @param {Clock} [options.clock] A Clock instance that is used when determining the value for the time dimension. Required when options.times is specified. - * @param {TimeIntervalCollection} [options.times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. + * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. + * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. + */ + +/** + * Provides tiled imagery hosted by a Web Map Service (WMS) server. + * + * @alias WebMapServiceImageryProvider + * @constructor + * + * @param {WebMapServiceImageryProvider.ConstructorOptions} options Object describing initialization options * * @see ArcGisMapServerImageryProvider * @see BingMapsImageryProvider diff --git a/Source/Scene/WebMapTileServiceImageryProvider.js b/Source/Scene/WebMapTileServiceImageryProvider.js index 401c5ba56012..3f95803b98cb 100644 --- a/Source/Scene/WebMapTileServiceImageryProvider.js +++ b/Source/Scene/WebMapTileServiceImageryProvider.js @@ -17,6 +17,33 @@ var defaultParameters = Object.freeze({ request: "GetTile", }); +/** + * @typedef {Object} WebMapTileServiceImageryProvider.ConstructorOptions + * + * Initialization options for the WebMapTileServiceImageryProvider constructor + * + * @property {Resource|String} url The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains. + * @property {String} [format='image/jpeg'] The MIME type for images to retrieve from the server. + * @property {String} layer The layer name for WMTS requests. + * @property {String} style The style name for WMTS requests. + * @property {String} tileMatrixSetID The identifier of the TileMatrixSet to use for WMTS requests. + * @property {Array} [tileMatrixLabels] A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level. + * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. + * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. + * @property {Object} [dimensions] A object containing static dimensions and their values. + * @property {Number} [tileWidth=256] The tile width in pixels. + * @property {Number} [tileHeight=256] The tile height in pixels. + * @property {TilingScheme} [tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + * @property {String|String[]} [subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. + * If this parameter is a single string, each character in the string is a subdomain. If it is + * an array, each element in the array is a subdomain. + */ + /** * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding. @@ -24,27 +51,7 @@ var defaultParameters = Object.freeze({ * @alias WebMapTileServiceImageryProvider * @constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains. - * @param {String} [options.format='image/jpeg'] The MIME type for images to retrieve from the server. - * @param {String} options.layer The layer name for WMTS requests. - * @param {String} options.style The style name for WMTS requests. - * @param {String} options.tileMatrixSetID The identifier of the TileMatrixSet to use for WMTS requests. - * @param {Array} [options.tileMatrixLabels] A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level. - * @param {Clock} [options.clock] A Clock instance that is used when determining the value for the time dimension. Required when options.times is specified. - * @param {TimeIntervalCollection} [options.times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. - * @param {Object} [options.dimensions] A object containing static dimensions and their values. - * @param {Number} [options.tileWidth=256] The tile width in pixels. - * @param {Number} [options.tileHeight=256] The tile height in pixels. - * @param {TilingScheme} [options.tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. - * @param {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. - * If this parameter is a single string, each character in the string is a subdomain. If it is - * an array, each element in the array is a subdomain. + * @param {WebMapTileServiceImageryProvider.ConstructorOptions} options Object describing initialization options * * @demo {@link https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html|Cesium Sandcastle Web Map Tile Service with Time Demo} * From 1b16c9a92c875cd5edcd673c9a4636ea6dd86644 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 18:16:23 +0200 Subject: [PATCH 26/36] Load-method option interfaces for some DataSources --- Source/DataSources/CzmlDataSource.js | 19 +++++++++++------ Source/DataSources/GeoJsonDataSource.js | 27 ++++++++++++++++--------- Source/DataSources/KmlDataSource.js | 21 ++++++++++++------- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index dd14ca4c8a5d..b3517530ab20 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -4648,6 +4648,15 @@ function DocumentPacket() { this.clock = undefined; } +/** + * @typedef {Object} CzmlDataSource.LoadOptions + * + * Initialization options for the `load` method. + * + * @property {Resource|string} [sourceUri] Overrides the url to use for resolving relative links. + * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas. + */ + /** * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}. * @alias CzmlDataSource @@ -4676,9 +4685,8 @@ function CzmlDataSource(name) { * Creates a Promise to a new instance loaded with the provided CZML data. * * @param {Resource|String|Object} czml A url or CZML object to be processed. - * @param {Object} [options] An object with the following properties: - * @param {Resource|String} [options.sourceUri] Overrides the url to use for resolving relative links. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options + * * @returns {Promise.} A promise that resolves to the new instance once the data is processed. */ CzmlDataSource.load = function (czml, options) { @@ -4849,9 +4857,8 @@ CzmlDataSource.prototype.process = function (czml, options) { * Loads the provided url or CZML object, replacing any existing data. * * @param {Resource|String|Object} czml A url or CZML object to be processed. - * @param {Object} [options] An object with the following properties: - * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options + * @returns {Promise.} A promise that resolves to this instances once the data is processed. */ CzmlDataSource.prototype.load = function (czml, options) { diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js index c194705cb096..56fda5ed7da0 100644 --- a/Source/DataSources/GeoJsonDataSource.js +++ b/Source/DataSources/GeoJsonDataSource.js @@ -557,6 +557,22 @@ function processTopology(dataSource, geoJson, geometry, crsFunction, options) { } } +/** + * @typedef {Object} GeoJsonDataSource.LoadOptions + * + * Initialization options for the `load` method. + * + * @property {String} [sourceUri] Overrides the url to use for resolving relative links. + * @property {Number} [markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels. + * @property {String} [markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point. + * @property {Color} [markerColor=GeoJsonDataSource.markerColor] The default color of the map pin created for each point. + * @property {Color} [stroke=GeoJsonDataSource.stroke] The default color of polylines and polygon outlines. + * @property {Number} [strokeWidth=GeoJsonDataSource.strokeWidth] The default width of polylines and polygon outlines. + * @property {Color} [fill=GeoJsonDataSource.fill] The default color for polygon interiors. + * @property {Boolean} [clampToGround=GeoJsonDataSource.clampToGround] true if we want the geometry features (polygons or linestrings) clamped to the ground. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + */ + /** * A {@link DataSource} which processes both * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data. @@ -599,16 +615,7 @@ function GeoJsonDataSource(name) { * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data. * * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded. - * @param {Object} [options] An object with the following properties: - * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links. - * @param {Number} [options.markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels. - * @param {String} [options.markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point. - * @param {Color} [options.markerColor=GeoJsonDataSource.markerColor] The default color of the map pin created for each point. - * @param {Color} [options.stroke=GeoJsonDataSource.stroke] The default color of polylines and polygon outlines. - * @param {Number} [options.strokeWidth=GeoJsonDataSource.strokeWidth] The default width of polylines and polygon outlines. - * @param {Color} [options.fill=GeoJsonDataSource.fill] The default color for polygon interiors. - * @param {Boolean} [options.clampToGround=GeoJsonDataSource.clampToGround] true if we want the geometry features (polygons or linestrings) clamped to the ground. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options * * @returns {Promise.} A promise that will resolve when the data is loaded. */ diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 7cecb01405b4..592e951fa0f7 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -3338,6 +3338,19 @@ function load(dataSource, entityCollection, data, options) { }); } +/** + * @typedef {Object} KmlDataSource.LoadOptions + * + * Initialization options for the `load` method. + * + * @property {Camera} camera The camera that is used for viewRefreshModes and sending camera properties to network links. + * @property {HTMLCanvasElement} canvas The canvas that is used for sending viewer properties to network links. + * @property {String} [sourceUri] Overrides the url to use for resolving relative links and other KML network features. + * @property {Boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. + * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + */ + /** * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML). *

    @@ -3434,13 +3447,7 @@ function KmlDataSource(options) { * Creates a Promise to a new instance loaded with the provided KML data. * * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. - * @param {Object} [options] An object with the following properties: - * @param {Camera} options.camera The camera that is used for viewRefreshModes and sending camera properties to network links. - * @param {HTMLCanvasElement} options.canvas The canvas that is used for sending viewer properties to network links. - * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links and other KML network features. - * @param {Boolean} [options.clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. - * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @param {KmlDataSource.LoadOptions} [options] An object specifying configuration options * * @returns {Promise.} A promise that will resolve to a new KmlDataSource instance once the KML is loaded. */ From a89f7c9d4aedefe6e1d17184e4df0b134dfaf930 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Thu, 28 May 2020 18:29:56 +0200 Subject: [PATCH 27/36] Options interfaces for Viewer, Resource --- Source/Core/Resource.js | 31 +++++++---- Source/Widgets/Viewer/Viewer.js | 99 ++++++++++++++++++--------------- 2 files changed, 74 insertions(+), 56 deletions(-) diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index c3fea4c508a6..c45cd1fc8ed1 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -212,21 +212,32 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { return result; } +// QueryParameters must be a one-deep object whose values are a primtive or array thereof +/** @typedef {string | number | boolean} QueryValue */ +/** @typedef {Object.} Resource.QueryParameters */ + +/** + * @typedef {Object} Resource.ConstructorOptions + * + * Initialization options for the Resource constructor + * + * @property {String} url The url of the resource. + * @property {Resource.QueryParameters} [queryParameters] An object containing query parameters that will be sent when retrieving the resource. + * @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}). + * @property {Object} [headers={}] Additional HTTP headers that will be sent. + * @property {Proxy} [proxy] A proxy to be used when loading the resource. + * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up. + * @property {Request} [request] A Request object that will be used. Intended for internal use only. + */ + /** * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests. * * @alias Resource * @constructor * - * @param {String|Object} options A url or an object with the following properties - * @param {String} options.url The url of the resource. - * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. - * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). - * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. - * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. - * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. - * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. - * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. + * @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options * * @example * function refreshTokenRetryCallback(resource, error) { @@ -564,7 +575,7 @@ Resource.prototype.getUrlComponent = function (query, proxy) { * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. * - * @param {Object} params The query parameters + * @param {Resource.QueryParameters} params The query parameters * @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined. */ Resource.prototype.setQueryParameters = function (params, useAsDefault) { diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index ef35e2c61d3d..9decdb30f3e4 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -209,6 +209,58 @@ function enableVRUI(viewer, enabled) { } } +/** + * @typedef {Object} Viewer.ConstructorOptions + * + * Initialization options for the Viewer constructor + * + * @property {Boolean} [animation=true] If set to false, the Animation widget will not be created. + * @property {Boolean} [baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created. + * @property {Boolean} [fullscreenButton=true] If set to false, the FullscreenButton widget will not be created. + * @property {Boolean} [vrButton=false] If set to true, the VRButton widget will be created. + * @property {Boolean|GeocoderService[]} [geocoder=true] If set to false, the Geocoder widget will not be created. + * @property {Boolean} [homeButton=true] If set to false, the HomeButton widget will not be created. + * @property {Boolean} [infoBox=true] If set to false, the InfoBox widget will not be created. + * @property {Boolean} [sceneModePicker=true] If set to false, the SceneModePicker widget will not be created. + * @property {Boolean} [selectionIndicator=true] If set to false, the SelectionIndicator widget will not be created. + * @property {Boolean} [timeline=true] If set to false, the Timeline widget will not be created. + * @property {Boolean} [navigationHelpButton=true] If set to false, the navigation help button will not be created. + * @property {Boolean} [navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button. + * @property {Boolean} [scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory. + * @property {Boolean} [shouldAnimate=false] true if the clock should attempt to advance simulation time by default, false otherwise. This option takes precedence over setting {@link Viewer#clockViewModel}. + * @property {ClockViewModel} [clockViewModel=new ClockViewModel(clock)] The clock view model to use to control current time. + * @property {ProviderViewModel} [selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true. + * @property {ProviderViewModel[]} [imageryProviderViewModels=createDefaultImageryProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true. + * @property {ProviderViewModel} [selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true. + * @property {ProviderViewModel[]} [terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true. + * @property {ImageryProvider} [imageryProvider=createWorldImagery()] The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false. + * @property {TerrainProvider} [terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use + * @property {SkyBox} [skyBox] The skybox used to render the stars. When undefined, the default stars are used. + * @property {SkyAtmosphere} [skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. + * @property {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed. + * @property {Boolean} [useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise. + * @property {Number} [targetFrameRate] The target frame rate when using the default render loop. + * @property {Boolean} [showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. + * @property {Boolean} [useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore window.devicePixelRatio. + * @property {Boolean} [automaticallyTrackDataSourceClocks=true] If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently. + * @property {Object} [contextOptions] Context and WebGL creation properties corresponding to options passed to {@link Scene}. + * @property {SceneMode} [sceneMode=SceneMode.SCENE3D] The initial scene mode. + * @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. + * @property {Globe} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to false, no globe will be added. + * @property {Boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. + * @property {Element|String} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. + * @property {Element|String} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. + * @property {DataSourceCollection} [dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget. If this parameter is provided, + * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. + * @property {Number} [terrainExaggeration=1.0] A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. + * @property {Boolean} [shadows=false] Determines if shadows are cast by light sources. + * @property {ShadowMode} [terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources. + * @property {MapMode2D} [mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. + * @property {Boolean} [projectionPicker=false] If set to true, the ProjectionPicker widget will be created. + * @property {Boolean} [requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + * @property {Number} [maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + */ + /** * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package. * The widget can always be extended by using mixins, which add functionality useful for a variety of applications. @@ -217,52 +269,7 @@ function enableVRUI(viewer, enabled) { * @constructor * * @param {Element|String} container The DOM element or ID that will contain the widget. - * @param {Object} [options] Object with the following properties: - * @param {Boolean} [options.animation=true] If set to false, the Animation widget will not be created. - * @param {Boolean} [options.baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created. - * @param {Boolean} [options.fullscreenButton=true] If set to false, the FullscreenButton widget will not be created. - * @param {Boolean} [options.vrButton=false] If set to true, the VRButton widget will be created. - * @param {Boolean|GeocoderService[]} [options.geocoder=true] If set to false, the Geocoder widget will not be created. - * @param {Boolean} [options.homeButton=true] If set to false, the HomeButton widget will not be created. - * @param {Boolean} [options.infoBox=true] If set to false, the InfoBox widget will not be created. - * @param {Boolean} [options.sceneModePicker=true] If set to false, the SceneModePicker widget will not be created. - * @param {Boolean} [options.selectionIndicator=true] If set to false, the SelectionIndicator widget will not be created. - * @param {Boolean} [options.timeline=true] If set to false, the Timeline widget will not be created. - * @param {Boolean} [options.navigationHelpButton=true] If set to false, the navigation help button will not be created. - * @param {Boolean} [options.navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button. - * @param {Boolean} [options.scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory. - * @param {Boolean} [options.shouldAnimate=false] true if the clock should attempt to advance simulation time by default, false otherwise. This option takes precedence over setting {@link Viewer#clockViewModel}. - * @param {ClockViewModel} [options.clockViewModel=new ClockViewModel(options.clock)] The clock view model to use to control current time. - * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true. - * @param {ProviderViewModel[]} [options.imageryProviderViewModels=createDefaultImageryProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true. - * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true. - * @param {ProviderViewModel[]} [options.terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true. - * @param {ImageryProvider} [options.imageryProvider=createWorldImagery()] The imagery provider to use. This value is only valid if options.baseLayerPicker is set to false. - * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use - * @param {SkyBox} [options.skyBox] The skybox used to render the stars. When undefined, the default stars are used. - * @param {SkyAtmosphere} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. - * @param {Element|String} [options.fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed. - * @param {Boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise. - * @param {Number} [options.targetFrameRate] The target frame rate when using the default render loop. - * @param {Boolean} [options.showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. - * @param {Boolean} [options.useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore window.devicePixelRatio. - * @param {Boolean} [options.automaticallyTrackDataSourceClocks=true] If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently. - * @param {Object} [options.contextOptions] Context and WebGL creation properties corresponding to options passed to {@link Scene}. - * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode. - * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. - * @param {Globe} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to false, no globe will be added. - * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. - * @param {Element|String} [options.creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. - * @param {Element|String} [options.creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. - * @param {DataSourceCollection} [options.dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget. If this parameter is provided, - * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. - * @param {Number} [options.terrainExaggeration=1.0] A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. - * @param {Boolean} [options.shadows=false] Determines if shadows are cast by light sources. - * @param {ShadowMode} [options.terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources. - * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. - * @param {Boolean} [options.projectionPicker=false] If set to true, the ProjectionPicker widget will be created. - * @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. - * @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + * @param {Viewer.ConstructorOptions} options Object describing initialization options * * @exception {DeveloperError} Element with id "container" does not exist in the document. * @exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.imageryProvider instead. From e18535fefb9b861e82e25f5a11c987536b8c5039 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 29 May 2020 10:40:43 +0200 Subject: [PATCH 28/36] Add CONTRIBUTORS entry --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 56a2e370dffe..7aac9d733c78 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -256,3 +256,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [SungHo Lim](https://github.com/SambaLim) - [Michael Fink](https://github.com/vividos) - [Jakub Vrana](https://github.com/vrana) +- [James Bromwell](https://github.com/thw0rted) From d3cf0ac00a2e7c6892b257a00f85f963a32da06e Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 29 May 2020 11:58:02 +0200 Subject: [PATCH 29/36] Use function overloading for exportKml --- Source/DataSources/exportKml.js | 76 ++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index 46c1fa16de9e..0d8a17d4b3c2 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -221,6 +221,33 @@ IdManager.prototype.get = function (id) { return id.toString() + "-" + ++ids[id]; }; +/** + * @variation 2 KML return + * @param {Object} options An object with the following properties: + * @param {EntityCollection} options.entities The EntityCollection to export as KML. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. + * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. + * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. + * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. + * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. + * @param {false} [options.kmz=false] If false or unset, returns the KML file and referenced resources individually + * + * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file Blobs + * + * @example + * Cesium.exportKml({ + * entities: entityCollection + * }) + * .then(function(result) { + * // The XML string is in result.kml + * + * var externalFiles = result.externalFiles + * for(var file in externalFiles) { + * // file is the name of the file used in the KML document as the href + * // externalFiles[file] is a Blob with the contents of the file + * } + * }); + */ /** * @typedef exportKmlResultKml @@ -236,17 +263,22 @@ IdManager.prototype.get = function (id) { */ /** - * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries - * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For - * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at - * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties - * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using - * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported - * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary - * color is used. Canvas objects are exported as PNG images. + * Exports an EntityCollection as a KML document or KMZ archive. + * + * Only Point, Billboard, Model, Path, Polygon, Polyline geometries will be exported. + * Note that there is not a 1 to 1 mapping of Entity properties to KML Feature + * properties. For example, entity properties that are time dynamic but cannot + * be dynamic in KML are exported with their values at `options.time` or the + * beginning of the EntityCollection's time interval if not specified. For + * time-dynamic properties that are supported in KML, we use the samples if it + * is a {@link SampledProperty}, otherwise we sample the value using the + * `options.sampleDuration`. Point, Billboard, Model and Path geometries with + * time-dynamic positions will be exported as gx:Track Features. * - * @function exportKml + * Not all Materials are representable in KML, so for more advanced Materials + * just the primary color is used. Canvas objects are exported as PNG images. * + * @variation 1 KMZ return * @param {Object} options An object with the following properties: * @param {EntityCollection} options.entities The EntityCollection to export as KML. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. @@ -254,26 +286,20 @@ IdManager.prototype.get = function (id) { * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. - * @param {Boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file. + * @param {true} options.kmz If true, KML and external files will be compressed into a single KMZ file. + * + * @returns {Promise} A promise that resolves to a KMZ file as a Blob. * - * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. * @demo {@link https://sandcastle.cesium.com/index.html?src=Export%20KML.html|Cesium Sandcastle KML Export Demo} * @example * Cesium.exportKml({ - * entities: entityCollection - * }) - * .then(function(result) { - * // The XML string is in result.kml - * - * var externalFiles = result.externalFiles - * for(var file in externalFiles) { - * // file is the name of the file used in the KML document as the href - * // externalFiles[file] is a blob with the contents of the file - * } - * }); - * - */ -function exportKml(options) { + * entities: entityCollection, + * options: { kmz: true } + * }) + * .then(function(result) { + * downloadFile(result.kmz); + * }); + */ function exportKml(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var entities = options.entities; var kmz = defaultValue(options.kmz, false); From d734c832a3aa004a565ca254bfb8630c1c413420 Mon Sep 17 00:00:00 2001 From: James Bromwell <943160+thw0rted@users.noreply.github.com> Date: Fri, 29 May 2020 17:32:16 +0200 Subject: [PATCH 30/36] Spell out docs for Resource.QueryParameter --- Source/Core/Resource.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index c45cd1fc8ed1..1afe7f7ab6b4 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -212,9 +212,12 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { return result; } -// QueryParameters must be a one-deep object whose values are a primtive or array thereof /** @typedef {string | number | boolean} QueryValue */ -/** @typedef {Object.} Resource.QueryParameters */ +/** + * @typedef {Object.} Resource.QueryParameters + * QueryParameters must be an object whose keys are parameter names and whose + * values are a primitive (string, number, boolean) or an array thereof. + * */ /** * @typedef {Object} Resource.ConstructorOptions From a38104e1910594eb05ab341f6d6f53cee10644fa Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Fri, 29 May 2020 17:13:31 -0400 Subject: [PATCH 31/36] Undo some changes --- Source/Core/Event.js | 5 +- Source/Core/Resource.js | 34 ++++-------- Source/DataSources/DataSource.js | 4 +- Source/DataSources/Entity.js | 4 +- Source/DataSources/EntityCluster.js | 5 +- Source/DataSources/PolylineGraphics.js | 3 - Source/DataSources/PropertyBag.js | 7 ++- Source/DataSources/exportKml.js | 76 +++++++++----------------- Source/Widgets/Viewer/Viewer.js | 2 +- gulpfile.cjs | 32 ++++------- 10 files changed, 60 insertions(+), 112 deletions(-) diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 8becdbdbb9eb..99001dc5fce5 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -7,7 +7,6 @@ import defined from "./defined.js"; * exposed as a property for others to subscribe to. * * @alias Event - * @template Listener the function call signature for this event's listeners * @constructor * @example * MyObject.prototype.myListener = function(arg1, arg2) { @@ -47,7 +46,7 @@ Object.defineProperties(Event.prototype, { * An optional scope can be provided to serve as the this pointer * in which the function will execute. * - * @param {Listener} listener The function to be executed when the event is raised. + * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this * pointer in which the listener function will execute. * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked. @@ -72,7 +71,7 @@ Event.prototype.addEventListener = function (listener, scope) { /** * Unregisters a previously registered callback. * - * @param {Listener} listener The function to be unregistered. + * @param {Function} listener The function to be unregistered. * @param {Object} [scope] The scope that was originally passed to addEventListener. * @returns {Boolean} true if the listener was removed; false if the listener and scope are not registered with the event. * diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js index 1afe7f7ab6b4..c3fea4c508a6 100644 --- a/Source/Core/Resource.js +++ b/Source/Core/Resource.js @@ -212,35 +212,21 @@ function combineQueryParameters(q1, q2, preserveQueryParameters) { return result; } -/** @typedef {string | number | boolean} QueryValue */ -/** - * @typedef {Object.} Resource.QueryParameters - * QueryParameters must be an object whose keys are parameter names and whose - * values are a primitive (string, number, boolean) or an array thereof. - * */ - -/** - * @typedef {Object} Resource.ConstructorOptions - * - * Initialization options for the Resource constructor - * - * @property {String} url The url of the resource. - * @property {Resource.QueryParameters} [queryParameters] An object containing query parameters that will be sent when retrieving the resource. - * @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}). - * @property {Object} [headers={}] Additional HTTP headers that will be sent. - * @property {Proxy} [proxy] A proxy to be used when loading the resource. - * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. - * @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up. - * @property {Request} [request] A Request object that will be used. Intended for internal use only. - */ - /** * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests. * * @alias Resource * @constructor * - * @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options + * @param {String|Object} options A url or an object with the following properties + * @param {String} options.url The url of the resource. + * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource. + * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). + * @param {Object} [options.headers={}] Additional HTTP headers that will be sent. + * @param {Proxy} [options.proxy] A proxy to be used when loading the resource. + * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up. + * @param {Request} [options.request] A Request object that will be used. Intended for internal use only. * * @example * function refreshTokenRetryCallback(resource, error) { @@ -578,7 +564,7 @@ Resource.prototype.getUrlComponent = function (query, proxy) { * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. * - * @param {Resource.QueryParameters} params The query parameters + * @param {Object} params The query parameters * @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined. */ Resource.prototype.setQueryParameters = function (params, useAsDefault) { diff --git a/Source/DataSources/DataSource.js b/Source/DataSources/DataSource.js index 4ac760371721..182dac7602bf 100644 --- a/Source/DataSources/DataSource.js +++ b/Source/DataSources/DataSource.js @@ -58,7 +58,7 @@ Object.defineProperties(DataSource.prototype, { /** * Gets an event that will be raised if an error is encountered during processing. * @memberof DataSource.prototype - * @type {Event} + * @type {Event} */ errorEvent: { get: DeveloperError.throwInstantiationError, @@ -66,7 +66,7 @@ Object.defineProperties(DataSource.prototype, { /** * Gets an event that will be raised when the value of isLoading changes. * @memberof DataSource.prototype - * @type {Event} + * @type {Event} */ loadingEvent: { get: DeveloperError.throwInstantiationError, diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js index 80493ed55ab4..091ca47492df 100644 --- a/Source/DataSources/Entity.js +++ b/Source/DataSources/Entity.js @@ -70,10 +70,8 @@ function createPropertyTypeDescriptor(name, Type) { * @property {TimeIntervalCollection} [availability] The availability, if any, associated with this object. * @property {Boolean} [show] A boolean value indicating if the entity and its children are displayed. * @property {Property | string} [description] A string Property specifying an HTML description for this entity. - * @property {PositionProperty | CallbackProperty | Cartesian3} [position] A Property specifying the entity position. - * **** TODO **** + * @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position. * @property {Property} [orientation] A Property specifying the entity orientation. - * **** TODO **** * @property {Property} [viewFrom] A suggested initial offset for viewing this object. * @property {Entity} [parent] A parent entity to associate with this entity. * @property {BillboardGraphics | BillboardGraphics.ConstructorOptions} [billboard] A billboard to associate with this entity. diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index cee9319edec1..2779deb12142 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -549,7 +549,7 @@ Object.defineProperties(EntityCluster.prototype, { /** * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. * @memberof EntityCluster.prototype - * @type {Event} + * @type {Event} */ clusterEvent: { get: function () { @@ -963,8 +963,7 @@ EntityCluster.prototype.destroy = function () { * @callback EntityCluster.newClusterCallback * * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster. - * @param {{billboard: Billboard, label: Label, point: PointPrimitive}} cluster An object - * containing billboard, label, and point properties. The values are the same as + * @param {Object} cluster An object containing billboard, label, and point properties. The values are the same as * billboard, label and point entities, but must be the values of the ConstantProperty. * * @example diff --git a/Source/DataSources/PolylineGraphics.js b/Source/DataSources/PolylineGraphics.js index 1230a1565490..90566a523341 100644 --- a/Source/DataSources/PolylineGraphics.js +++ b/Source/DataSources/PolylineGraphics.js @@ -16,9 +16,6 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js"; * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE. * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the polyline. * @property {MaterialProperty | Color} [depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain. - * - * **** TODO **** this was originally only ArcType, not a Property (!) -- pretty sure that was wrong? - * * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. * @property {Property | boolean} [clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground. * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from light sources. diff --git a/Source/DataSources/PropertyBag.js b/Source/DataSources/PropertyBag.js index 24f95598a6be..688053f4c7ae 100644 --- a/Source/DataSources/PropertyBag.js +++ b/Source/DataSources/PropertyBag.js @@ -9,7 +9,12 @@ import Property from "./Property.js"; /** * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties. * - * @typedef {PropertyBagType} + * @alias PropertyBag + * @constructor + * @implements {DictionaryLike} + * + * @param {Object} [value] An object, containing key-value mapping of property names to properties. + * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property. */ function PropertyBag(value, createPropertyCallback) { this._propertyNames = []; diff --git a/Source/DataSources/exportKml.js b/Source/DataSources/exportKml.js index 0d8a17d4b3c2..46c1fa16de9e 100644 --- a/Source/DataSources/exportKml.js +++ b/Source/DataSources/exportKml.js @@ -221,33 +221,6 @@ IdManager.prototype.get = function (id) { return id.toString() + "-" + ++ids[id]; }; -/** - * @variation 2 KML return - * @param {Object} options An object with the following properties: - * @param {EntityCollection} options.entities The EntityCollection to export as KML. - * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. - * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. - * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. - * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. - * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. - * @param {false} [options.kmz=false] If false or unset, returns the KML file and referenced resources individually - * - * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file Blobs - * - * @example - * Cesium.exportKml({ - * entities: entityCollection - * }) - * .then(function(result) { - * // The XML string is in result.kml - * - * var externalFiles = result.externalFiles - * for(var file in externalFiles) { - * // file is the name of the file used in the KML document as the href - * // externalFiles[file] is a Blob with the contents of the file - * } - * }); - */ /** * @typedef exportKmlResultKml @@ -263,22 +236,17 @@ IdManager.prototype.get = function (id) { */ /** - * Exports an EntityCollection as a KML document or KMZ archive. - * - * Only Point, Billboard, Model, Path, Polygon, Polyline geometries will be exported. - * Note that there is not a 1 to 1 mapping of Entity properties to KML Feature - * properties. For example, entity properties that are time dynamic but cannot - * be dynamic in KML are exported with their values at `options.time` or the - * beginning of the EntityCollection's time interval if not specified. For - * time-dynamic properties that are supported in KML, we use the samples if it - * is a {@link SampledProperty}, otherwise we sample the value using the - * `options.sampleDuration`. Point, Billboard, Model and Path geometries with - * time-dynamic positions will be exported as gx:Track Features. + * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries + * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For + * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at + * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties + * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using + * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported + * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary + * color is used. Canvas objects are exported as PNG images. * - * Not all Materials are representable in KML, so for more advanced Materials - * just the primary color is used. Canvas objects are exported as PNG images. + * @function exportKml * - * @variation 1 KMZ return * @param {Object} options An object with the following properties: * @param {EntityCollection} options.entities The EntityCollection to export as KML. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file. @@ -286,20 +254,26 @@ IdManager.prototype.get = function (id) { * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML. * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability. * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML. - * @param {true} options.kmz If true, KML and external files will be compressed into a single KMZ file. - * - * @returns {Promise} A promise that resolves to a KMZ file as a Blob. + * @param {Boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file. * + * @returns {Promise} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. * @demo {@link https://sandcastle.cesium.com/index.html?src=Export%20KML.html|Cesium Sandcastle KML Export Demo} * @example * Cesium.exportKml({ - * entities: entityCollection, - * options: { kmz: true } - * }) - * .then(function(result) { - * downloadFile(result.kmz); - * }); - */ function exportKml(options) { + * entities: entityCollection + * }) + * .then(function(result) { + * // The XML string is in result.kml + * + * var externalFiles = result.externalFiles + * for(var file in externalFiles) { + * // file is the name of the file used in the KML document as the href + * // externalFiles[file] is a blob with the contents of the file + * } + * }); + * + */ +function exportKml(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var entities = options.entities; var kmz = defaultValue(options.kmz, false); diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index 9decdb30f3e4..c9d7b4e3c4af 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -1974,7 +1974,7 @@ Viewer.prototype.zoomTo = function (target, offset) { * @param {Number} [options.duration=3.0] The duration of the flight in seconds. * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight. * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target. - * @returns {Promise.} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions + * @returns {Promise.} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions */ Viewer.prototype.flyTo = function (target, options) { return zoomToOrFly(this, target, options, true); diff --git a/gulpfile.cjs b/gulpfile.cjs index 691253302c9a..ab3b4e7254ae 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1481,9 +1481,10 @@ function createCesiumJs() { function createTypeScriptDefinitions() { // Run jsdoc with tsd-jsdoc to generate an initial Cesium.d.ts file. - child_process.execSync("npx jsdoc --configure Tools/jsdoc/ts-conf.json", { - stdio: "inherit", - }); + child_process.execSync( + "node_modules/.bin/jsdoc --configure Tools/jsdoc/ts-conf.json", + { stdio: "inherit" } + ); var source = fs.readFileSync("Source/Cesium.d.ts").toString(); @@ -1561,11 +1562,10 @@ function createTypeScriptDefinitions() { .replace(/String\[]/gm, "string[]") .replace(/Boolean\[]/gm, "boolean[]") .replace(/Object\[]/gm, "object[]") - // This is an ugly hack but @template doesn't actually seem to work - .replace( - /export class Event {/gm, - "export class Event {" - ) + .replace(//gm, "") + .replace(//gm, "") + .replace(//gm, "") + .replace(//gm, "") .replace( /= "WebGLConstants\.(.+)"/gm, (match, p1) => `= WebGLConstants.${p1}` @@ -1578,19 +1578,9 @@ function createTypeScriptDefinitions() { /** * Private interfaces to support PropertyBag being a dictionary-like object. */ -interface PropertyDictionary { - [key: string]: Property | undefined; -} -class PropertyBagBase { - readonly propertyNames: string[]; - constructor(value?: object, createPropertyCallback?: Function); - addProperty(propertyName: string, value?: any, createPropertyCallback?: Function): void; - hasProperty(propertyName: string): boolean; - merge(source: Object, createPropertyCallback?: Function): void; - removeProperty(propertyName: string): void; +interface DictionaryLike { + [index: string]: any; } -/** This has to be in the workaround section because JSDoc doesn't support Intersection Types */ -type PropertyBagType = PropertyDictionary & Property & PropertyBagBase; ${source} } @@ -1616,7 +1606,7 @@ ${source} fs.writeFileSync("Source/Cesium.d.ts", source); // Use tsc to compile it and make sure it is valid - child_process.execSync("npx tsc -p Tools/jsdoc/tsconfig.json", { + child_process.execSync("node_modules/.bin/tsc -p Tools/jsdoc/tsconfig.json", { stdio: "inherit", }); From dca5c5847c0526eda7df3026b4d2043c3c643271 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sat, 30 May 2020 00:38:07 -0400 Subject: [PATCH 32/36] Add ConstructorOptions to the rest of the ImageryProviders --- Source/Scene/BingMapsImageryProvider.js | 29 +++++++----- Source/Scene/GridImageryProvider.js | 33 ++++++++----- Source/Scene/IonImageryProvider.js | 15 ++++-- Source/Scene/MapboxImageryProvider.js | 32 ++++++++----- Source/Scene/MapboxStyleImageryProvider.js | 36 ++++++++------ Source/Scene/OpenStreetMapImageryProvider.js | 26 +++++----- Source/Scene/SingleTileImageryProvider.js | 17 +++++-- .../Scene/TileCoordinatesImageryProvider.js | 23 +++++---- Source/Scene/TileMapServiceImageryProvider.js | 42 ++++++++++------- Source/Scene/UrlTemplateImageryProvider.js | 47 +++++++++++-------- Source/Widgets/CesiumWidget/CesiumWidget.js | 4 +- 11 files changed, 184 insertions(+), 120 deletions(-) diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index 059f45d18510..2e458a5f2e3c 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -18,27 +18,34 @@ import DiscardEmptyTilePolicy from "./DiscardEmptyTileImagePolicy.js"; import ImageryProvider from "./ImageryProvider.js"; /** - * Provides tiled imagery using the Bing Maps Imagery REST API. + * @typedef {Object} BingMapsImageryProvider.ConstructorOptions * - * @alias BingMapsImageryProvider - * @constructor + * Initialization options for the BingMapsImageryProvider constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The url of the Bing Maps server hosting the imagery. - * @param {String} [options.key] The Bing Maps key for your application, which can be + * @property {Resource|String} url The url of the Bing Maps server hosting the imagery. + * @property {String} [key] The Bing Maps key for your application, which can be * created at {@link https://www.bingmapsportal.com/}. * If this parameter is not provided, {@link BingMapsApi.defaultKey} is used, which is undefined by default. - * @param {String} [options.tileProtocol] The protocol to use when loading tiles, e.g. 'http' or 'https'. + * @property {String} [tileProtocol] The protocol to use when loading tiles, e.g. 'http' or 'https'. * By default, tiles are loaded using the same protocol as the page. - * @param {BingMapsStyle} [options.mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load. - * @param {String} [options.culture=''] The culture to use when requesting Bing Maps imagery. Not + * @property {BingMapsStyle} [mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load. + * @property {String} [culture=''] The culture to use when requesting Bing Maps imagery. Not * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} * for information on the supported cultures. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy} * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter. + */ + +/** + * Provides tiled imagery using the Bing Maps Imagery REST API. + * + * @alias BingMapsImageryProvider + * @constructor + * + * @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options * * @see ArcGisMapServerImageryProvider * @see GoogleEarthEnterpriseMapsProvider diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js index bd6210a13d88..875bc143f678 100644 --- a/Source/Scene/GridImageryProvider.js +++ b/Source/Scene/GridImageryProvider.js @@ -9,26 +9,33 @@ var defaultColor = new Color(1.0, 1.0, 1.0, 0.4); var defaultGlowColor = new Color(0.0, 1.0, 0.0, 0.05); var defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2); +/** + * @typedef {Object} GridImageryProvider.ConstructorOptions + * + * Initialization options for the GridImageryProvider constructor + * + * @param {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. + * @param {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, + * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + * parameter is specified, the WGS84 ellipsoid is used. + * @param {Number} [cells=8] The number of grids cells. + * @param {Color} [color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines. + * @param {Color} [glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines. + * @param {Number} [glowWidth=6] The width of lines used for rendering the line glow effect. + * @param {Color} [backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color. + * @param {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes. + * @param {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes. + * @param {Number} [canvasSize=256] The size of the canvas used for rendering. + */ + /** * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow. * May be useful for custom rendering effects or debugging terrain. * * @alias GridImageryProvider * @constructor + * @param {GridImageryProvider.ConstructorOptions} options Object describing initialization options * - * @param {Object} [options] Object with the following properties: - * @param {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. - * @param {Number} [options.cells=8] The number of grids cells. - * @param {Color} [options.color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines. - * @param {Color} [options.glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines. - * @param {Number} [options.glowWidth=6] The width of lines used for rendering the line glow effect. - * @param {Color} [options.backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color. - * @param {Number} [options.tileWidth=256] The width of the tile for level-of-detail selection purposes. - * @param {Number} [options.tileHeight=256] The height of the tile for level-of-detail selection purposes. - * @param {Number} [options.canvasSize=256] The size of the canvas used for rendering. */ function GridImageryProvider(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index 45da7ec8cab7..bea2963e3e50 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -36,16 +36,23 @@ var ImageryProviderMapping = { WMTS: createFactory(WebMapTileServiceImageryProvider), }; +/** + * @typedef {Object} IonImageryProvider.ConstructorOptions + * + * Initialization options for the TileMapServiceImageryProvider constructor + * + * @property {Number} assetId An ion imagery asset ID + * @property {String} [accessToken=Ion.defaultAccessToken] The access token to use. + * @property {String|Resource} [server=Ion.defaultServer] The resource to the Cesium ion API server. + */ + /** * Provides tiled imagery using the Cesium ion REST API. * * @alias IonImageryProvider * @constructor * - * @param {Object} options Object with the following properties: - * @param {Number} options.assetId An ion imagery asset ID; - * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use. - * @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server. + * @param {IonImageryProvider.ConstructorOptions} options Object describing initialization options * * @example * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 })); diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index d090fa4919d1..0ffa60334167 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -12,24 +12,30 @@ var defaultCredit = new Credit( ); /** - * Provides tiled imagery hosted by Mapbox. + * @typedef {Object} MapboxImageryProvider.ConstructorOptions * - * @alias MapboxImageryProvider - * @constructor + * Initialization options for the MapboxImageryProvider constructor * - * @param {Object} [options] Object with the following properties: - * @param {String} [options.url='https://api.mapbox.com/v4/'] The Mapbox server url. - * @param {String} options.mapId The Mapbox Map ID. - * @param {String} [options.accessToken] The public access token for the imagery. - * @param {String} [options.format='png'] The format of the image request. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying + * @property {String} [url='https://api.mapbox.com/v4/'] The Mapbox server url. + * @property {String} mapId The Mapbox Map ID. + * @property {String} [accessToken] The public access token for the imagery. + * @property {String} [format='png'] The format of the image request. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + */ + +/** + * Provides tiled imagery hosted by Mapbox. + * + * @alias MapboxImageryProvider + * @constructor * + * @param {MapboxImageryProvider.ConstructorOptions} options Object describing initialization options * * @example * // Mapbox tile provider diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index 6881d92e8b74..c1a063fe7c19 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -12,26 +12,32 @@ var defaultCredit = new Credit( ); /** - * Provides tiled imagery hosted by Mapbox. + * @typedef {Object} MapboxStyleImageryProvider.ConstructorOptions * - * @alias MapboxStyleImageryProvider - * @constructor + * Initialization options for the MapboxStyleImageryProvider constructor * - * @param {Object} [options] Object with the following properties: - * @param {Resource|String} [options.url='https://api.mapbox.com/styles/v1/'] The Mapbox server url. - * @param {String} [options.username='mapbox'] The username of the map account. - * @param {String} options.styleId The Mapbox Style ID. - * @param {String} [options.accessToken] The public access token for the imagery. - * @param {Number} [options.tilesize=512] The size of the image tiles. - * @param {Boolean} [options.scaleFactor] Determines if tiles are rendered at a @2x scale factor. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying + * @property {Resource|String} [url='https://api.mapbox.com/styles/v1/'] The Mapbox server url. + * @property {String} [username='mapbox'] The username of the map account. + * @property {String} styleId The Mapbox Style ID. + * @property {String} [accessToken] The public access token for the imagery. + * @property {Number} [tilesize=512] The size of the image tiles. + * @property {Boolean} [scaleFactor] Determines if tiles are rendered at a @2x scale factor. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + */ + +/** + * Provides tiled imagery hosted by Mapbox. + * + * @alias MapboxStyleImageryProvider + * @constructor * + * @param {MapboxStyleImageryProvider.ConstructorOptions} options Object describing initialization options * * @example * // Mapbox style provider diff --git a/Source/Scene/OpenStreetMapImageryProvider.js b/Source/Scene/OpenStreetMapImageryProvider.js index 27e2dca57804..f5ca4bbdbf5a 100644 --- a/Source/Scene/OpenStreetMapImageryProvider.js +++ b/Source/Scene/OpenStreetMapImageryProvider.js @@ -11,6 +11,20 @@ var defaultCredit = new Credit( "MapQuest, Open Street Map and contributors, CC-BY-SA" ); +/** + * @typedef {Object} OpenStreetMapImageryProvider.ConstructorOptions + * + * Initialization options for the OpenStreetMapImageryProvider constructor + * + * @property {String} [url='https://a.tile.openstreetmap.org'] The OpenStreetMap server url. + * @property {String} [fileExtension='png'] The file extension for images on the server. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property {Credit|String} [credit='MapQuest, Open Street Map and contributors, CC-BY-SA'] A credit for the data source, which is displayed on the canvas. + */ + /** * An imagery provider that provides tiled imagery hosted by OpenStreetMap * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run @@ -21,16 +35,7 @@ var defaultCredit = new Credit( * @constructor * @extends UrlTemplateImageryProvider * - * @param {Object} [options] Object with the following properties: - * @param {String} [options.url='https://a.tile.openstreetmap.org'] The OpenStreetMap server url. - * @param {String} [options.fileExtension='png'] The file extension for images on the server. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. - * @param {Credit|String} [options.credit='MapQuest, Open Street Map and contributors, CC-BY-SA'] A credit for the data source, which is displayed on the canvas. - * @returns {UrlTemplateImageryProvider} The imagery provider. - * + * @param {OpenStreetMapImageryProvider.ConstructorOptions} options Object describing initialization options * @exception {DeveloperError} The rectangle and minimumLevel indicate that there are more than four tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported. * * @see ArcGisMapServerImageryProvider @@ -42,7 +47,6 @@ var defaultCredit = new Credit( * @see WebMapTileServiceImageryProvider * @see UrlTemplateImageryProvider * - * * @example * var osm = new Cesium.OpenStreetMapImageryProvider({ * url : 'https://a.tile.openstreetmap.org/' diff --git a/Source/Scene/SingleTileImageryProvider.js b/Source/Scene/SingleTileImageryProvider.js index 1eb7cd9a3bff..070344f0452e 100644 --- a/Source/Scene/SingleTileImageryProvider.js +++ b/Source/Scene/SingleTileImageryProvider.js @@ -11,6 +11,17 @@ import TileProviderError from "../Core/TileProviderError.js"; import when from "../ThirdParty/when.js"; import ImageryProvider from "./ImageryProvider.js"; +/** + * @typedef {Object} SingleTileImageryProvider.ConstructorOptions + * + * Initialization options for the SingleTileImageryProvider constructor + * + * @property {Resource|String} url The url for the tile. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + */ + /** * Provides a single, top-level imagery tile. The single image is assumed to use a * {@link GeographicTilingScheme}. @@ -18,11 +29,7 @@ import ImageryProvider from "./ImageryProvider.js"; * @alias SingleTileImageryProvider * @constructor * - * @param {Object} options Object with the following properties: - * @param {Resource|String} options.url The url for the tile. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @param {SingleTileImageryProvider.ConstructorOptions} options Object describing initialization options * * @see ArcGisMapServerImageryProvider * @see BingMapsImageryProvider diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index 796d1bcb3872..01e3ce7c231f 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -5,6 +5,20 @@ import Event from "../Core/Event.js"; import GeographicTilingScheme from "../Core/GeographicTilingScheme.js"; import when from "../ThirdParty/when.js"; +/** + * @typedef {Object} TileCoordinatesImageryProvider.ConstructorOptions + * + * Initialization options for the TileCoordinatesImageryProvider constructor + * + * @param {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. + * @param {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, + * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + * parameter is specified, the WGS84 ellipsoid is used. + * @param {Color} [color=Color.YELLOW] The color to draw the tile box and label. + * @param {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes. + * @param {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes. + */ + /** * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for @@ -13,14 +27,7 @@ import when from "../ThirdParty/when.js"; * @alias TileCoordinatesImageryProvider * @constructor * - * @param {Object} [options] Object with the following properties: - * @param {TilingScheme} [options.tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. - * @param {Color} [options.color=Color.YELLOW] The color to draw the tile box and label. - * @param {Number} [options.tileWidth=256] The width of the tile for level-of-detail selection purposes. - * @param {Number} [options.tileHeight=256] The height of the tile for level-of-detail selection purposes. + * @param {TileCoordinatesImageryProvider.ConstructorOptions} options Object describing initialization options */ function TileCoordinatesImageryProvider(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); diff --git a/Source/Scene/TileMapServiceImageryProvider.js b/Source/Scene/TileMapServiceImageryProvider.js index 9e2aaa9ce9ff..2f27b2c8d964 100644 --- a/Source/Scene/TileMapServiceImageryProvider.js +++ b/Source/Scene/TileMapServiceImageryProvider.js @@ -14,33 +14,39 @@ import when from "../ThirdParty/when.js"; import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js"; /** - * An imagery provider that provides tiled imagery as generated by - * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. + * @typedef {Object} TileMapServiceImageryProvider.ConstructorOptions * - * @alias TileMapServiceImageryProvider - * @constructor - * @extends UrlTemplateImageryProvider + * Initialization options for the TileMapServiceImageryProvider constructor * - * @param {Object} [options] Object with the following properties: - * @param {Resource|String|Promise|Promise} [options.url='.'] Path to image tiles on server. - * @param {String} [options.fileExtension='png'] The file extension for images on the server. - * @param {Credit|String} [options.credit=''] A credit for the data source, which is displayed on the canvas. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying + * @property {Resource|String|Promise|Promise} [url='.'] Path to image tiles on server. + * @property {String} [fileExtension='png'] The file extension for images on the server. + * @property {Credit|String} [credit=''] A credit for the data source, which is displayed on the canvas. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {TilingScheme} [tilingScheme] The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} * is used. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @param {Number} [options.tileWidth=256] Pixel width of image tiles. - * @param {Number} [options.tileHeight=256] Pixel height of image tiles. - * @param {Boolean} [options.flipXY] Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. + * @property {Number} [tileWidth=256] Pixel width of image tiles. + * @property {Number} [tileHeight=256] Pixel height of image tiles. + * @property {Boolean} [flipXY] Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. * Specifying this option will do the same, allowing for loading of these incorrect tilesets. - * @returns {UrlTemplateImageryProvider} The imagery provider. + */ + +/** + * An imagery provider that provides tiled imagery as generated by + * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. + * + * @alias TileMapServiceImageryProvider + * @constructor + * @extends UrlTemplateImageryProvider + * + * @param {TileMapServiceImageryProvider.ConstructorOptions} options Object describing initialization options * * @see ArcGisMapServerImageryProvider * @see BingMapsImageryProvider diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index ae164767d243..b37e9799064e 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -50,13 +50,12 @@ var pickFeaturesTags = combine(tags, { }); /** - * Provides imagery by requesting tiles using a specified URL template. + * @typedef {Object} UrlTemplateImageryProvider.ConstructorOptions * - * @alias UrlTemplateImageryProvider - * @constructor + * Initialization options for the UrlTemplateImageryProvider constructor * - * @param {Promise.|Object} [options] Object with the following properties: - * @param {Resource|String} options.url The URL template to use to request tiles. It has the following keywords: + * @property {Promise.|Object} [options] Object with the following properties: + * @property {Resource|String} options.url The URL template to use to request tiles. It has the following keywords: *
      *
    • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
    • *
    • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
    • @@ -76,7 +75,7 @@ var pickFeaturesTags = combine(tags, { *
    • {width}: The width of each tile in pixels.
    • *
    • {height}: The height of each tile in pixels.
    • *
    - * @param {Resource|String} [options.pickFeaturesUrl] The URL template to use to pick features. If this property is not specified, + * @property {Resource|String} [options.pickFeaturesUrl] The URL template to use to pick features. If this property is not specified, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no * features picked. The URL template supports all of the keywords supported by the url * parameter, plus the following: @@ -91,7 +90,7 @@ var pickFeaturesTags = combine(tags, { *
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • *
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • * - * @param {Object} [options.urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where + * @property {Object} [options.urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: * urlSchemeZeroPadding : { '{x}' : '0000'} * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. @@ -104,40 +103,48 @@ var pickFeaturesTags = combine(tags, { *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • * - * @param {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. + * @property {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. - * @param {Credit|String} [options.credit=''] A credit for the data source, which is displayed on the canvas. - * @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying + * @property {Credit|String} [options.credit=''] A credit for the data source, which is displayed on the canvas. + * @property {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. - * @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @param {TilingScheme} [options.tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal + * @property {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {TilingScheme} [options.tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} * is used. - * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, + * @property {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @param {Number} [options.tileWidth=256] Pixel width of image tiles. - * @param {Number} [options.tileHeight=256] Pixel height of image tiles. - * @param {Boolean} [options.hasAlphaChannel=true] true if the images provided by this imagery provider + * @property {Number} [options.tileWidth=256] Pixel width of image tiles. + * @property {Number} [options.tileHeight=256] Pixel height of image tiles. + * @property {Boolean} [options.hasAlphaChannel=true] true if the images provided by this imagery provider * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if * present, will be ignored. If this property is true, any images without an alpha channel will * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are potentially reduced. - * @param {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] The formats in which to get feature information at a + * @property {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] The formats in which to get feature information at a * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this * parameter is not specified, feature picking is disabled. - * @param {Boolean} [options.enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will + * @property {Boolean} [options.enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will * request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable * features) without communicating with the server. Set this property to false if you know your data * source does not support picking features or if you don't want this provider's features to be pickable. Note * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures} * property. - * @param {Object} [options.customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. + * @property {Object} [options.customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. + */ + +/** + * Provides imagery by requesting tiles using a specified URL template. + * + * @alias UrlTemplateImageryProvider + * @constructor * + * @param {UrlTemplateImageryProvider.ConstructorOptions} options Object describing initialization options * * @example * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project diff --git a/Source/Widgets/CesiumWidget/CesiumWidget.js b/Source/Widgets/CesiumWidget/CesiumWidget.js index fdc1c2559d1b..338f80440b2b 100644 --- a/Source/Widgets/CesiumWidget/CesiumWidget.js +++ b/Source/Widgets/CesiumWidget/CesiumWidget.js @@ -126,7 +126,7 @@ function configureCameraFrustum(widget) { * @param {Element|String} container The DOM element or ID that will contain the widget. * @param {Object} [options] Object with the following properties: * @param {Clock} [options.clock=new Clock()] The clock to use to control current time. - * @param {ImageryProvider} [options.imageryProvider=createWorldImagery()] The imagery provider to serve as the base layer. If set to false, no imagery provider will be added. + * @param {ImageryProvider | false} [options.imageryProvider=createWorldImagery()] The imagery provider to serve as the base layer. If set to false, no imagery provider will be added. * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider. * @param {SkyBox| false} [options.skyBox] The skybox used to render the stars. When undefined, the default stars are used. If set to false, no skyBox, Sun, or Moon will be added. * @param {SkyAtmosphere | false} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to false to turn it off. @@ -134,7 +134,7 @@ function configureCameraFrustum(widget) { * @param {Boolean} [options.scene3DOnly=false] When true, each geometry instance will only be rendered in 3D to save GPU memory. * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. - * @param {Globe} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to false, no globe will be added. + * @param {Globe | false} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to false, no globe will be added. * @param {Boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise. * @param {Boolean} [options.useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore window.devicePixelRatio. * @param {Number} [options.targetFrameRate] The target frame rate when using the default render loop. From e7af041eee4711ca56767fc6c3cf63b75298beb7 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sat, 30 May 2020 01:45:28 -0400 Subject: [PATCH 33/36] Workaround CesiumMath -> Math documentation issue --- Source/Core/Math.js | 2 +- gulpfile.cjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Math.js b/Source/Core/Math.js index 7e94e525ccc3..cf8bc84ef8c7 100644 --- a/Source/Core/Math.js +++ b/Source/Core/Math.js @@ -7,7 +7,7 @@ import DeveloperError from "./DeveloperError.js"; /** * Math functions. * - * @namespace CesiumMath + * @exports CesiumMath * @alias Math */ var CesiumMath = {}; diff --git a/gulpfile.cjs b/gulpfile.cjs index ab3b4e7254ae..0f57cf468bab 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1557,6 +1557,7 @@ function createTypeScriptDefinitions() { // Fix up the WebGLConstants aliasing we mentioned above by simply unquoting the strings. source = source .replace(/^declare /gm, "export ") + .replace(/module "Math"/gm, "namespace Math") .replace(/CesiumMath/gm, "Math") .replace(/Number\[]/gm, "number[]") // Workaround https://github.com/englercj/tsd-jsdoc/issues/117 .replace(/String\[]/gm, "string[]") From d95eea02bef452016fe78de883e5c2019a583dee Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sat, 30 May 2020 02:01:38 -0400 Subject: [PATCH 34/36] Fix doc links that include a hash. --- Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js b/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js index b6ba444a5a9c..ecff98ccacbf 100644 --- a/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js +++ b/Tools/jsdoc/cesium_template/static/javascript/cesiumDoc.js @@ -47,8 +47,11 @@ for (var i = 0; i < links.length; i++) { var link = links[i]; var prefix = link.href.split("?")[0]; + var parts = prefix.split("#"); link.href = - prefix + (searchTerm === "" ? "" : "?classFilter=" + searchTerm); + parts[0] + + (searchTerm === "" ? "" : "?classFilter=" + searchTerm) + + (parts[1] ? "#" + parts[1] : ""); } } From 31571eb22ef4caa98c839f3199a268c432f33bef Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sun, 31 May 2020 15:43:24 -0400 Subject: [PATCH 35/36] Fix UrlTemplateImageryProvider Also opt-in tsd-jsdoc so we can use @template in the future. --- Source/Scene/UrlTemplateImageryProvider.js | 34 +++++++++++----------- Tools/jsdoc/ts-conf.json | 3 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index b37e9799064e..11ad3d14f5f6 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -55,7 +55,7 @@ var pickFeaturesTags = combine(tags, { * Initialization options for the UrlTemplateImageryProvider constructor * * @property {Promise.|Object} [options] Object with the following properties: - * @property {Resource|String} options.url The URL template to use to request tiles. It has the following keywords: + * @property {Resource|String} url The URL template to use to request tiles. It has the following keywords: *
      *
    • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
    • *
    • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
    • @@ -75,7 +75,7 @@ var pickFeaturesTags = combine(tags, { *
    • {width}: The width of each tile in pixels.
    • *
    • {height}: The height of each tile in pixels.
    • *
    - * @property {Resource|String} [options.pickFeaturesUrl] The URL template to use to pick features. If this property is not specified, + * @property {Resource|String} [pickFeaturesUrl] The URL template to use to pick features. If this property is not specified, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no * features picked. The URL template supports all of the keywords supported by the url * parameter, plus the following: @@ -90,7 +90,7 @@ var pickFeaturesTags = combine(tags, { *
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • *
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • * - * @property {Object} [options.urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where + * @property {Object} [urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: * urlSchemeZeroPadding : { '{x}' : '0000'} * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. @@ -103,39 +103,39 @@ var pickFeaturesTags = combine(tags, { *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • * - * @property {String|String[]} [options.subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. + * @property {String|String[]} [subdomains='abc'] The subdomains to use for the {s} placeholder in the URL template. * If this parameter is a single string, each character in the string is a subdomain. If it is * an array, each element in the array is a subdomain. - * @property {Credit|String} [options.credit=''] A credit for the data source, which is displayed on the canvas. - * @property {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying + * @property {Credit|String} [credit=''] A credit for the data source, which is displayed on the canvas. + * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely * to result in rendering problems. - * @property {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * @property {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. - * @property {TilingScheme} [options.tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal + * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image. + * @property {TilingScheme} [tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} * is used. - * @property {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified, + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @property {Number} [options.tileWidth=256] Pixel width of image tiles. - * @property {Number} [options.tileHeight=256] Pixel height of image tiles. - * @property {Boolean} [options.hasAlphaChannel=true] true if the images provided by this imagery provider + * @property {Number} [tileWidth=256] Pixel width of image tiles. + * @property {Number} [tileHeight=256] Pixel height of image tiles. + * @property {Boolean} [hasAlphaChannel=true] true if the images provided by this imagery provider * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if * present, will be ignored. If this property is true, any images without an alpha channel will * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage * and texture upload time are potentially reduced. - * @property {GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] The formats in which to get feature information at a + * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats] The formats in which to get feature information at a * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this * parameter is not specified, feature picking is disabled. - * @property {Boolean} [options.enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will - * request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, + * @property {Boolean} [enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will + * request the pickFeaturesUrl and attempt to interpret the features included in the response. If false, * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable * features) without communicating with the server. Set this property to false if you know your data * source does not support picking features or if you don't want this provider's features to be pickable. Note * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures} * property. - * @property {Object} [options.customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. + * @property {Object} [customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. */ /** diff --git a/Tools/jsdoc/ts-conf.json b/Tools/jsdoc/ts-conf.json index e231b1adb8f6..6813e219ec52 100644 --- a/Tools/jsdoc/ts-conf.json +++ b/Tools/jsdoc/ts-conf.json @@ -14,7 +14,8 @@ "excludePattern": "(^|\\/|\\\\)_" }, "plugins": [ - "./Tools/jsdoc/cesiumTags" + "./Tools/jsdoc/cesiumTags", + "./node_modules/tsd-jsdoc/dist/plugin" ], "templates": { "cleverLinks": true, From 4b6a4d104cb13973766ed7eb2311659364733a19 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Sun, 31 May 2020 20:41:44 -0400 Subject: [PATCH 36/36] More fixes found by Kevin. --- Source/Scene/ArcGisMapServerImageryProvider.js | 2 +- Source/Scene/TileCoordinatesImageryProvider.js | 10 +++++----- Tools/jsdoc/ts-conf.json | 2 +- gulpfile.cjs | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js index 0f7c34c6049c..b982130e43b2 100644 --- a/Source/Scene/ArcGisMapServerImageryProvider.js +++ b/Source/Scene/ArcGisMapServerImageryProvider.js @@ -54,7 +54,7 @@ import ImageryProvider from "./ImageryProvider.js"; * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified and used, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @property {Credit|String} credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. + * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. * @property {Number} [tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property {Number} [tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property {Number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing diff --git a/Source/Scene/TileCoordinatesImageryProvider.js b/Source/Scene/TileCoordinatesImageryProvider.js index 01e3ce7c231f..6f5c6f66c320 100644 --- a/Source/Scene/TileCoordinatesImageryProvider.js +++ b/Source/Scene/TileCoordinatesImageryProvider.js @@ -10,13 +10,13 @@ import when from "../ThirdParty/when.js"; * * Initialization options for the TileCoordinatesImageryProvider constructor * - * @param {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. - * @param {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, + * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles. + * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified, * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither * parameter is specified, the WGS84 ellipsoid is used. - * @param {Color} [color=Color.YELLOW] The color to draw the tile box and label. - * @param {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes. - * @param {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes. + * @property {Color} [color=Color.YELLOW] The color to draw the tile box and label. + * @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes. + * @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes. */ /** diff --git a/Tools/jsdoc/ts-conf.json b/Tools/jsdoc/ts-conf.json index 6813e219ec52..22c743f44ba5 100644 --- a/Tools/jsdoc/ts-conf.json +++ b/Tools/jsdoc/ts-conf.json @@ -15,7 +15,7 @@ }, "plugins": [ "./Tools/jsdoc/cesiumTags", - "./node_modules/tsd-jsdoc/dist/plugin" + "tsd-jsdoc/dist/plugin" ], "templates": { "cleverLinks": true, diff --git a/gulpfile.cjs b/gulpfile.cjs index 0f57cf468bab..680f91e245aa 100644 --- a/gulpfile.cjs +++ b/gulpfile.cjs @@ -1545,12 +1545,13 @@ function createTypeScriptDefinitions() { //eslint-disable-next-line no-cond-assign while ((matches = regex.exec(source))) { const moduleName = matches[2].match(/([^\s|\(]+)/); - if (moduleName[1] === "CesiumMath") { - moduleName[1] = "Math"; - } publicModules.add(moduleName[1]); } + // Math shows up as "Math" because of it's aliasing from CesiumMath and namespace collision with actual Math + // It fails the above regex so just add it directly here. + publicModules.add("Math"); + // Fix up the output to match what we need // declare => export since we are wrapping everything in a namespace // CesiumMath => Math (because no CesiumJS build step would be complete without special logic for the Math class)