Match Highlighter Demo
- - - - -Search and highlight occurences of the selected text.
- -diff --git a/.concierge/templates/pullRequestOpened.hbs b/.concierge/templates/pullRequestOpened.hbs index f494947adb90..8408c266f8ab 100644 --- a/.concierge/templates/pullRequestOpened.hbs +++ b/.concierge/templates/pullRequestOpened.hbs @@ -1,7 +1,7 @@ {{#if askAboutContributors}} Thank you so much for the pull request @{{ userName }}! I noticed this is your first pull request and I wanted to say welcome to the Cesium community! -The [Pull Request Guidelines](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#pull-request-guidelines) is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that. +The [Pull Request Guidelines](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#pull-request-guidelines) is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that. * :x: Missing `CONTRIBUTORS.md` entry. * Please add yourself to the [contributors]({{ contributorsUrl }}) file! @@ -10,7 +10,7 @@ Thanks for the pull request @{{ userName }}! {{/if}} {{#if claEnabled}} {{#if errorCla}} -* :grey_exclamation: There was an error checking the CLA! If this is your first contribution, please send in a [Contributor License Agreement](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla). +* :grey_exclamation: There was an error checking the CLA! If this is your first contribution, please send in a [Contributor License Agreement](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla). * Maintainers, this was the error I ran into while attempting to process the CLA check. Please resolve it to continue CLA checking. ``` {{ errorCla }} @@ -18,7 +18,7 @@ Thanks for the pull request @{{ userName }}! {{else}} {{#if askForCla}} * :x: Missing CLA. - * Please send in a [Contributor License Agreement](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla) (CLA) and comment back here to let us know to check this! + * Please send in a [Contributor License Agreement](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla) (CLA) and comment back here to let us know to check this! {{else}} * :heavy_check_mark: Signed CLA found. {{/if}} @@ -34,7 +34,7 @@ Thanks for the pull request @{{ userName }}! {{/if}} {{#if askAboutTests}} * :grey_question: Unit tests were not updated. - * Make sure you've [updated tests](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/TestingGuide) to reflect your changes, added tests for any new code, and ran the code coverage tool. + * Make sure you've [updated tests](https://github.com/CesiumGS/cesium/tree/master/Documentation/Contributors/TestingGuide) to reflect your changes, added tests for any new code, and ran the code coverage tool. {{/if}} Reviewers, don't forget to make sure that: diff --git a/.eslintrc.json b/.eslintrc.json index 6c69dcbf3be5..514d51dab8a5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,8 +9,8 @@ "overrides": [ { "files": [ - "index.js", - "server.js", + "index.cjs", + "server.cjs", "gulpfile.js", "Source/Workers/transferTypedArrayTest.js" ], diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4790cd680f48..bba36ec66c7d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,25 +4,25 @@ about: Let us know so we can fix it! --- +--> -Sandcastle example: +Sandcastle example: Browser: Operating System: - \ No newline at end of file +--> diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 13ea40291f83..db5de8edb56d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,12 +3,12 @@ name: Request a feature about: New ideas & improvements to Cesium are always welcome. --- - +https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md +--> diff --git a/.gulp.json b/.gulp.json new file mode 100644 index 000000000000..96507cb26cf8 --- /dev/null +++ b/.gulp.json @@ -0,0 +1,5 @@ +{ + "flags": { + "gulpfile": "gulpfile.cjs" + } +} diff --git a/.npmignore b/.npmignore index 98c5270d4a0e..b6218280c65f 100644 --- a/.npmignore +++ b/.npmignore @@ -23,7 +23,7 @@ /index.html /index.release.html /launches -/server.js +/server.cjs /Source/copyrightHeader.js /Specs /ThirdParty diff --git a/.travis.yml b/.travis.yml index ae9f7c80d9d7..0fd9153d4bb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ script: # Various Node.js smoke-screen tests - node -e "const Cesium = require('./');" - - NODE_ENV=development node index.js - - NODE_ENV=production node index.js + - NODE_ENV=development node index.cjs + - NODE_ENV=production node index.cjs - npm --silent run cloc diff --git a/.vscode/launch.json b/.vscode/launch.json index 85fb445c2db3..7e924cbc0edb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,5 @@ { - // Use IntelliSense to learn about possible Node.js debug attributes. + // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", @@ -8,14 +8,10 @@ "type": "node", "request": "launch", "name": "Launch Program", - "program": "${workspaceRoot}\\server.js", - "cwd": "${workspaceRoot}" - }, - { - "type": "node", - "request": "attach", - "name": "Attach to Process", - "port": 5858 + "cwd": "${workspaceFolder}", + "runtimeExecutable": "npm", + "runtimeArgs": ["run-script", "start"], + "noDebug": true } ] -} \ No newline at end of file +} diff --git a/Apps/.jshintrc b/Apps/.jshintrc index ad12e9a7e032..b7b6dc60c899 100644 --- a/Apps/.jshintrc +++ b/Apps/.jshintrc @@ -21,7 +21,6 @@ "boss": false, "debug": false, "eqnull": false, - "esnext": false, "moz": false, "evil": false, "expr": false, diff --git a/Apps/Sandcastle/.jshintrc b/Apps/Sandcastle/.jshintrc index 3b38565e7618..47fbaea5fe0f 100644 --- a/Apps/Sandcastle/.jshintrc +++ b/Apps/Sandcastle/.jshintrc @@ -1,6 +1,7 @@ { "extends": "../.jshintrc", "unused": false, + "esversion": 10, "predef": [ "JSON", "require", diff --git a/Apps/Sandcastle/CesiumSandcastle.js b/Apps/Sandcastle/CesiumSandcastle.js index 4627ee0e4676..762d7f00181b 100644 --- a/Apps/Sandcastle/CesiumSandcastle.js +++ b/Apps/Sandcastle/CesiumSandcastle.js @@ -15,7 +15,7 @@ require({ location: '../Apps/Sandcastle' }, { name: 'CodeMirror', - location: '../ThirdParty/codemirror-4.6' + location: '../ThirdParty/codemirror-5.52.0' }, { name: 'ThirdParty', location: '../Apps/Sandcastle/ThirdParty' @@ -1057,7 +1057,7 @@ require({ }); } - // Work around Chrome 79 bug: https://github.com/AnalyticalGraphicsInc/cesium/issues/8460 + // Work around Chrome 79 bug: https://github.com/CesiumGS/cesium/issues/8460 function waitForDoc(doc, test) { var deferred = new Deferred(); if (test()) { diff --git a/Apps/Sandcastle/Sandcastle-header.js b/Apps/Sandcastle/Sandcastle-header.js index e75def7f5ebe..ecdb0880d54f 100644 --- a/Apps/Sandcastle/Sandcastle-header.js +++ b/Apps/Sandcastle/Sandcastle-header.js @@ -100,7 +100,7 @@ if (window.location.protocol === 'file:') { if (window.confirm("You must host this app on a web server.\nSee contributor's guide for more info?")) { - window.location = 'https://github.com/AnalyticalGraphicsInc/cesium/wiki/Contributor%27s-Guide'; + window.location = 'https://github.com/CesiumGS/cesium/wiki/Contributor%27s-Guide'; } } }()); diff --git a/Apps/Sandcastle/gallery/3D Tiles BIM.html b/Apps/Sandcastle/gallery/3D Tiles BIM.html index d6b032ed6447..6dfbe1bb71f4 100644 --- a/Apps/Sandcastle/gallery/3D Tiles BIM.html +++ b/Apps/Sandcastle/gallery/3D Tiles BIM.html @@ -84,7 +84,7 @@ // In this tileset every feature has an "element" property which is a global ID. // This property is used to associate features across different tiles and LODs. -// Workaround until 3D Tiles has the concept of global batch ids: https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/265 +// Workaround until 3D Tiles has the concept of global batch ids: https://github.com/CesiumGS/3d-tiles/issues/265 var elementMap = {}; // Build a map of elements to features. var hiddenElements = [112001, 113180, 131136, 113167, 71309, 109652, 111178, 113156, 113170, 124846, 114076, 131122, 113179, 114325, 131134, 113164, 113153, 113179, 109656, 114095, 114093, 39225, 39267, 113149, 113071, 112003, 39229, 113160, 39227, 39234, 113985, 39230, 112004, 39223]; diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html index 44a9faa97534..c976a556589b 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html @@ -40,7 +40,7 @@ }); // Load the NYC buildings tileset -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); // HTML overlay for showing feature name on mouseover @@ -99,10 +99,7 @@ nameOverlay.style.display = 'block'; nameOverlay.style.bottom = viewer.canvas.clientHeight - movement.endPosition.y + 'px'; nameOverlay.style.left = movement.endPosition.x + 'px'; - var name = pickedFeature.getProperty('name'); - if (!Cesium.defined(name)) { - name = pickedFeature.getProperty('id'); - } + var name = pickedFeature.getProperty('BIN'); nameOverlay.textContent = name; // Highlight the feature if it's not already selected. diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html index e1e2b14f48c4..bfb21515b4ca 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html @@ -23,7 +23,7 @@ 'use strict'; //Sandcastle_Begin // A demo of interactive 3D Tiles styling -// Styling language Documentation: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling +// Styling language Documentation: https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling // Building data courtesy of NYC OpenData portal: http://www1.nyc.gov/site/doitt/initiatives/3d-building.page var viewer = new Cesium.Viewer('cesiumContainer', { terrainProvider: Cesium.createWorldTerrain() @@ -41,7 +41,7 @@ }); // Load the NYC buildings tileset. -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); // Color buildings based on their height. @@ -49,13 +49,13 @@ tileset.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ - ['${height} >= 300', 'rgba(45, 0, 75, 0.5)'], - ['${height} >= 200', 'rgb(102, 71, 151)'], - ['${height} >= 100', 'rgb(170, 162, 204)'], - ['${height} >= 50', 'rgb(224, 226, 238)'], - ['${height} >= 25', 'rgb(252, 230, 200)'], - ['${height} >= 10', 'rgb(248, 176, 87)'], - ['${height} >= 5', 'rgb(198, 106, 11)'], + ['${Height} >= 300', 'rgba(45, 0, 75, 0.5)'], + ['${Height} >= 200', 'rgb(102, 71, 151)'], + ['${Height} >= 100', 'rgb(170, 162, 204)'], + ['${Height} >= 50', 'rgb(224, 226, 238)'], + ['${Height} >= 25', 'rgb(252, 230, 200)'], + ['${Height} >= 10', 'rgb(248, 176, 87)'], + ['${Height} >= 5', 'rgb(198, 106, 11)'], ['true', 'rgb(127, 59, 8)'] ] } @@ -66,7 +66,7 @@ function colorByLatitude() { tileset.style = new Cesium.Cesium3DTileStyle({ defines: { - latitudeRadians: 'radians(${latitude})' + latitudeRadians: 'radians(${Latitude})' }, color: { conditions: [ @@ -86,7 +86,7 @@ function colorByDistance() { tileset.style = new Cesium.Cesium3DTileStyle({ defines : { - distance : 'distance(vec2(radians(${longitude}), radians(${latitude})), vec2(-1.291777521, 0.7105706624))' + distance : 'distance(vec2(radians(${Longitude}), radians(${Latitude})), vec2(-1.291777521, 0.7105706624))' }, color : { conditions : [ @@ -100,17 +100,17 @@ }); } -// Color buildings with a '3' in their name. -function colorByNameRegex() { +// Color buildings with a '3' in their BIN property. +function colorByStringRegex() { tileset.style = new Cesium.Cesium3DTileStyle({ - color : "(regExp('3').test(String(${name}))) ? color('cyan', 0.9) : color('purple', 0.1)" + color : "(regExp('3').test(String(${BIN}))) ? color('cyan', 0.9) : color('purple', 0.1)" }); } // Show only buildings greater than 200 meters in height. function hideByHeight() { tileset.style = new Cesium.Cesium3DTileStyle({ - show : '${height} > 200' + show : '${Height} > 200' }); } @@ -132,7 +132,7 @@ }, { text : 'Color By Name Regex', onselect : function() { - colorByNameRegex(); + colorByStringRegex(); } }, { text : 'Hide By Height', diff --git a/Apps/Sandcastle/gallery/3D Tiles Inspector.html b/Apps/Sandcastle/gallery/3D Tiles Inspector.html index 3e0938ebf97b..7391c278a8fe 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Inspector.html +++ b/Apps/Sandcastle/gallery/3D Tiles Inspector.html @@ -32,7 +32,7 @@ viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel; -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); viewer.scene.primitives.add(tileset); tileset.readyPromise.then(function(){ diff --git a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html index f149fc146e2d..bfaf4fb0aaac 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html @@ -72,11 +72,11 @@ }); // Load the NYC buildings tileset. -var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5741) }); +var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(75343) }); scene.primitives.add(tileset); tileset.style = new Cesium.Cesium3DTileStyle({ meta: { - description: "'Building id ${id} has height ${height}.'" + description: "'Building ${BIN} has height ${Height}.'" } }); @@ -144,9 +144,9 @@ } function zoom(movement, feature) { - var longitude = Cesium.Math.toRadians(feature.getProperty('longitude')); - var latitude = Cesium.Math.toRadians(feature.getProperty('latitude')); - var height = feature.getProperty('height'); + var longitude = Cesium.Math.toRadians(feature.getProperty('Longitude')); + var latitude = Cesium.Math.toRadians(feature.getProperty('Latitude')); + var height = feature.getProperty('Height'); var positionCartographic = new Cesium.Cartographic(longitude, latitude, height * 0.5); var position = scene.globe.ellipsoid.cartographicToCartesian(positionCartographic); diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html index edcb589dcac2..53f68e227e49 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html @@ -35,7 +35,7 @@ // Geometry Tiles are experimental and the format is subject to change in the future. // For more details, see: -// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/Geometry +// https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/Geometry var classificationTileset = new Cesium.Cesium3DTileset({ url: '../../SampleData/Cesium3DTiles/Classification/PointCloud/tileset.json', classificationType: Cesium.ClassificationType.CESIUM_3D_TILE diff --git a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html index 98c239e16ae1..31edd28f924e 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html @@ -33,7 +33,7 @@ // Vector 3D Tiles are experimental and the format is subject to change in the future. // For more details, see: -// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData +// https://github.com/CesiumGS/3d-tiles/tree/3d-tiles-next/TileFormats/VectorData var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5737) }); viewer.scene.primitives.add(tileset); diff --git a/Apps/Sandcastle/gallery/Clustering.html b/Apps/Sandcastle/gallery/Clustering.html index e665667c0a33..56358aaf8b31 100644 --- a/Apps/Sandcastle/gallery/Clustering.html +++ b/Apps/Sandcastle/gallery/Clustering.html @@ -149,7 +149,7 @@ var pickedLabel = viewer.scene.pick(movement.position); if (Cesium.defined(pickedLabel)) { var ids = pickedLabel.id; - if (Cesium.isArray(ids)) { + if (Array.isArray(ids)) { for (var i = 0; i < ids.length; ++i) { ids[i].billboard.color = Cesium.Color.RED; } diff --git a/Apps/Sandcastle/gallery/FXAA.html b/Apps/Sandcastle/gallery/FXAA.html index d0b293c1cfb4..05ce4820c061 100644 --- a/Apps/Sandcastle/gallery/FXAA.html +++ b/Apps/Sandcastle/gallery/FXAA.html @@ -33,7 +33,7 @@ }); viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(5741) + url: Cesium.IonResource.fromAssetId(75343) })); viewer.scene.postProcessStages.fxaa.enabled = true; diff --git a/Apps/Sandcastle/gallery/Offline.html b/Apps/Sandcastle/gallery/Offline.html index d66133344d0a..353e32cb57ac 100644 --- a/Apps/Sandcastle/gallery/Offline.html +++ b/Apps/Sandcastle/gallery/Offline.html @@ -25,7 +25,7 @@ // This is an example of using Cesium "Offline", meaning disconnected from the // external Internet. It must still be served from a local web server, but // does not rely on any outside resources or services. For more info, see: -// https://github.com/AnalyticalGraphicsInc/cesium/wiki/Offline-Guide +// https://github.com/CesiumGS/cesium/wiki/Offline-Guide var viewer = new Cesium.Viewer('cesiumContainer', { imageryProvider : new Cesium.TileMapServiceImageryProvider({ diff --git a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html index 118bcdb188cf..600a6f236cce 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html @@ -52,7 +52,7 @@ var heatmapTileProperty = '_foveatedFactor'; var tileset = new Cesium.Cesium3DTileset({ - url: Cesium.IonResource.fromAssetId(5741), + url: Cesium.IonResource.fromAssetId(75343), debugHeatmapTilePropertyName: heatmapTileProperty }); diff --git a/Apps/Sandcastle/index.html b/Apps/Sandcastle/index.html index e67bca0867ae..8d20cfc2a56b 100644 --- a/Apps/Sandcastle/index.html +++ b/Apps/Sandcastle/index.html @@ -5,16 +5,16 @@
- +
-[![Build Status](https://travis-ci.org/AnalyticalGraphicsInc/cesium.svg?branch=master)](https://travis-ci.org/AnalyticalGraphicsInc/cesium) -[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) [![Greenkeeper badge](https://badges.greenkeeper.io/AnalyticalGraphicsInc/cesium.svg)](https://greenkeeper.io/) +[![Build Status](https://travis-ci.org/CesiumGS/cesium.svg?branch=master)](https://travis-ci.org/CesiumGS/cesium) +[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics, and is cross-platform, cross-browser, and tuned for dynamic-data visualization. [CesiumJS Homepage](https://cesium.com/cesiumjs) -[CesiumJS Features Checklist](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CesiumJS-Features-Checklist) +[CesiumJS Features Checklist](https://github.com/CesiumGS/cesium/wiki/CesiumJS-Features-Checklist) ### :rocket: Get Started @@ -38,11 +38,11 @@ Using Cesium ion helps support CesiumJS development. :heart: ### :clap: Featured Demos -+
-
+
@@ -54,7 +54,7 @@ Using Cesium ion helps support CesiumJS development. :heart:
-
+
diff --git a/Source/Core/ApproximateTerrainHeights.js b/Source/Core/ApproximateTerrainHeights.js
index 9fbe33dcf579..93724cb5212b 100644
--- a/Source/Core/ApproximateTerrainHeights.js
+++ b/Source/Core/ApproximateTerrainHeights.js
@@ -6,7 +6,6 @@ import Cartographic from './Cartographic.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import GeographicTilingScheme from './GeographicTilingScheme.js';
@@ -184,7 +183,7 @@ import Resource from './Resource.js';
ApproximateTerrainHeights._terrainHeights = undefined;
ApproximateTerrainHeights._initPromise = undefined;
- defineProperties(ApproximateTerrainHeights, {
+ Object.defineProperties(ApproximateTerrainHeights, {
/**
* Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,
* call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.
diff --git a/Source/Core/ArcGISTiledElevationTerrainProvider.js b/Source/Core/ArcGISTiledElevationTerrainProvider.js
index 618db212a95c..1416393493ca 100644
--- a/Source/Core/ArcGISTiledElevationTerrainProvider.js
+++ b/Source/Core/ArcGISTiledElevationTerrainProvider.js
@@ -3,7 +3,6 @@ import Cartesian2 from './Cartesian2.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import Event from './Event.js';
@@ -160,7 +159,7 @@ import WebMercatorTilingScheme from './WebMercatorTilingScheme.js';
this._errorEvent = new Event();
}
- defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
+ Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
diff --git a/Source/Core/ArcType.js b/Source/Core/ArcType.js
index e5665855334b..96a90f403ecb 100644
--- a/Source/Core/ArcType.js
+++ b/Source/Core/ArcType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* ArcType defines the path that should be taken connecting vertices.
@@ -30,4 +29,4 @@ import freezeObject from './freezeObject.js';
*/
RHUMB : 2
};
-export default freezeObject(ArcType);
+export default Object.freeze(ArcType);
diff --git a/Source/Core/AssociativeArray.js b/Source/Core/AssociativeArray.js
index e4fe67788d80..9a3932929881 100644
--- a/Source/Core/AssociativeArray.js
+++ b/Source/Core/AssociativeArray.js
@@ -1,5 +1,4 @@
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -13,7 +12,7 @@ import DeveloperError from './DeveloperError.js';
this._hash = {};
}
- defineProperties(AssociativeArray.prototype, {
+ Object.defineProperties(AssociativeArray.prototype, {
/**
* Gets the number of items in the collection.
* @memberof AssociativeArray.prototype
diff --git a/Source/Core/AttributeCompression.js b/Source/Core/AttributeCompression.js
index 59fe136b8c86..00cd2b6d30b3 100644
--- a/Source/Core/AttributeCompression.js
+++ b/Source/Core/AttributeCompression.js
@@ -339,7 +339,7 @@ import CesiumMath from './Math.js';
* @param {Uint16Array} vBuffer The buffer view of v values.
* @param {Uint16Array} [heightBuffer] The buffer view of height values.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh|quantized-mesh-1.0 terrain format}
+ * @see {@link https://github.com/CesiumGS/quantized-mesh|quantized-mesh-1.0 terrain format}
*/
AttributeCompression.zigZagDeltaDecode = function(uBuffer, vBuffer, heightBuffer) {
//>>includeStart('debug', pragmas.debug);
diff --git a/Source/Core/BingMapsGeocoderService.js b/Source/Core/BingMapsGeocoderService.js
index 91aaff956004..41d694df647f 100644
--- a/Source/Core/BingMapsGeocoderService.js
+++ b/Source/Core/BingMapsGeocoderService.js
@@ -1,7 +1,6 @@
import BingMapsApi from './BingMapsApi.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
-import defineProperties from './defineProperties.js';
import Rectangle from './Rectangle.js';
import Resource from './Resource.js';
@@ -29,7 +28,7 @@ import Resource from './Resource.js';
});
}
- defineProperties(BingMapsGeocoderService.prototype, {
+ Object.defineProperties(BingMapsGeocoderService.prototype, {
/**
* The URL endpoint for the Bing geocoder service
* @type {String}
diff --git a/Source/Core/Cartesian2.js b/Source/Core/Cartesian2.js
index 4ffcfcc81a9b..ac76c2c58e55 100644
--- a/Source/Core/Cartesian2.js
+++ b/Source/Core/Cartesian2.js
@@ -2,7 +2,6 @@ import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
/**
@@ -149,7 +148,8 @@ import CesiumMath from './Math.js';
* Flattens an array of Cartesian2s into and array of components.
*
* @param {Cartesian2[]} array The array of cartesians to pack.
- * @param {Number[]} [result] The array onto which to store the result.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.
+
* @returns {Number[]} The packed array.
*/
Cartesian2.packArray = function(array, result) {
@@ -158,10 +158,13 @@ import CesiumMath from './Math.js';
//>>includeEnd('debug');
var length = array.length;
+ var resultLength = length * 2;
if (!defined(result)) {
- result = new Array(length * 2);
- } else {
- result.length = length * 2;
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError('If result is a typed array, it must have exactly array.length * 2 elements');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
}
for (var i = 0; i < length; ++i) {
@@ -180,6 +183,10 @@ import CesiumMath from './Math.js';
Cartesian2.unpackArray = function(array, result) {
//>>includeStart('debug', pragmas.debug);
Check.defined('array', array);
+ Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 2);
+ if (array.length % 2 !== 0) {
+ throw new DeveloperError('array length must be a multiple of 2.');
+ }
//>>includeEnd('debug');
var length = array.length;
@@ -671,7 +678,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian2}
* @constant
*/
- Cartesian2.ZERO = freezeObject(new Cartesian2(0.0, 0.0));
+ Cartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0));
/**
* An immutable Cartesian2 instance initialized to (1.0, 0.0).
@@ -679,7 +686,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian2}
* @constant
*/
- Cartesian2.UNIT_X = freezeObject(new Cartesian2(1.0, 0.0));
+ Cartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0));
/**
* An immutable Cartesian2 instance initialized to (0.0, 1.0).
@@ -687,7 +694,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian2}
* @constant
*/
- Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0));
+ Cartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0));
/**
* Duplicates this Cartesian2 instance.
diff --git a/Source/Core/Cartesian3.js b/Source/Core/Cartesian3.js
index 9fbd998f683f..2ca99e6f0967 100644
--- a/Source/Core/Cartesian3.js
+++ b/Source/Core/Cartesian3.js
@@ -2,7 +2,6 @@ import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
/**
@@ -177,7 +176,7 @@ import CesiumMath from './Math.js';
* Flattens an array of Cartesian3s into an array of components.
*
* @param {Cartesian3[]} array The array of cartesians to pack.
- * @param {Number[]} [result] The array onto which to store the result.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.
* @returns {Number[]} The packed array.
*/
Cartesian3.packArray = function(array, result) {
@@ -186,10 +185,13 @@ import CesiumMath from './Math.js';
//>>includeEnd('debug');
var length = array.length;
+ var resultLength = length * 3;
if (!defined(result)) {
- result = new Array(length * 3);
- } else {
- result.length = length * 3;
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError('If result is a typed array, it must have exactly array.length * 3 elements');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
}
for (var i = 0; i < length; ++i) {
@@ -1009,7 +1011,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian3}
* @constant
*/
- Cartesian3.ZERO = freezeObject(new Cartesian3(0.0, 0.0, 0.0));
+ Cartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0));
/**
* An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
@@ -1017,7 +1019,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian3}
* @constant
*/
- Cartesian3.UNIT_X = freezeObject(new Cartesian3(1.0, 0.0, 0.0));
+ Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0));
/**
* An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
@@ -1025,7 +1027,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian3}
* @constant
*/
- Cartesian3.UNIT_Y = freezeObject(new Cartesian3(0.0, 1.0, 0.0));
+ Cartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0));
/**
* An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
@@ -1033,7 +1035,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian3}
* @constant
*/
- Cartesian3.UNIT_Z = freezeObject(new Cartesian3(0.0, 0.0, 1.0));
+ Cartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0));
/**
* Duplicates this Cartesian3 instance.
diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js
index 6f3911fefad3..4273018235a1 100644
--- a/Source/Core/Cartesian4.js
+++ b/Source/Core/Cartesian4.js
@@ -2,7 +2,6 @@ import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
/**
@@ -177,7 +176,8 @@ import CesiumMath from './Math.js';
* Flattens an array of Cartesian4s into and array of components.
*
* @param {Cartesian4[]} array The array of cartesians to pack.
- * @param {Number[]} [result] The array onto which to store the result.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
+
* @returns {Number[]} The packed array.
*/
Cartesian4.packArray = function(array, result) {
@@ -186,10 +186,13 @@ import CesiumMath from './Math.js';
//>>includeEnd('debug');
var length = array.length;
+ var resultLength = length * 4;
if (!defined(result)) {
- result = new Array(length * 4);
- } else {
- result.length = length * 4;
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError('If result is a typed array, it must have exactly array.length * 4 elements');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
}
for (var i = 0; i < length; ++i) {
@@ -208,6 +211,10 @@ import CesiumMath from './Math.js';
Cartesian4.unpackArray = function(array, result) {
//>>includeStart('debug', pragmas.debug);
Check.defined('array', array);
+ Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 4);
+ if (array.length % 4 !== 0) {
+ throw new DeveloperError('array length must be a multiple of 4.');
+ }
//>>includeEnd('debug');
var length = array.length;
@@ -730,7 +737,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian4}
* @constant
*/
- Cartesian4.ZERO = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 0.0));
+ Cartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));
/**
* An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
@@ -738,7 +745,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian4}
* @constant
*/
- Cartesian4.UNIT_X = freezeObject(new Cartesian4(1.0, 0.0, 0.0, 0.0));
+ Cartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));
/**
* An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
@@ -746,7 +753,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian4}
* @constant
*/
- Cartesian4.UNIT_Y = freezeObject(new Cartesian4(0.0, 1.0, 0.0, 0.0));
+ Cartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));
/**
* An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
@@ -754,7 +761,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian4}
* @constant
*/
- Cartesian4.UNIT_Z = freezeObject(new Cartesian4(0.0, 0.0, 1.0, 0.0));
+ Cartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));
/**
* An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
@@ -762,7 +769,7 @@ import CesiumMath from './Math.js';
* @type {Cartesian4}
* @constant
*/
- Cartesian4.UNIT_W = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 1.0));
+ Cartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));
/**
* Duplicates this Cartesian4 instance.
diff --git a/Source/Core/Cartographic.js b/Source/Core/Cartographic.js
index d8fc84bd899c..7e1c3918fef2 100644
--- a/Source/Core/Cartographic.js
+++ b/Source/Core/Cartographic.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
@@ -219,7 +218,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
* @type {Cartographic}
* @constant
*/
- Cartographic.ZERO = freezeObject(new Cartographic(0.0, 0.0, 0.0));
+ Cartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));
/**
* Duplicates this instance.
diff --git a/Source/Core/CatmullRomSpline.js b/Source/Core/CatmullRomSpline.js
index 352c647045b5..2bb602a31f72 100644
--- a/Source/Core/CatmullRomSpline.js
+++ b/Source/Core/CatmullRomSpline.js
@@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import HermiteSpline from './HermiteSpline.js';
import Matrix4 from './Matrix4.js';
import Spline from './Spline.js';
@@ -174,7 +173,7 @@ import Spline from './Spline.js';
this._lastTimeIndex = 0;
}
- defineProperties(CatmullRomSpline.prototype, {
+ Object.defineProperties(CatmullRomSpline.prototype, {
/**
* An array of times for the control points.
*
diff --git a/Source/Core/CesiumTerrainProvider.js b/Source/Core/CesiumTerrainProvider.js
index 3fa8aea1f484..2f286623821d 100644
--- a/Source/Core/CesiumTerrainProvider.js
+++ b/Source/Core/CesiumTerrainProvider.js
@@ -5,7 +5,6 @@ import Cartesian3 from './Cartesian3.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Event from './Event.js';
import GeographicTilingScheme from './GeographicTilingScheme.js';
@@ -720,7 +719,7 @@ import TileProviderError from './TileProviderError.js';
});
}
- defineProperties(CesiumTerrainProvider.prototype, {
+ Object.defineProperties(CesiumTerrainProvider.prototype, {
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
diff --git a/Source/Core/CircleGeometry.js b/Source/Core/CircleGeometry.js
index 18ad570f8e5b..dd1402bfdb08 100644
--- a/Source/Core/CircleGeometry.js
+++ b/Source/Core/CircleGeometry.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import EllipseGeometry from './EllipseGeometry.js';
import Ellipsoid from './Ellipsoid.js';
import VertexFormat from './VertexFormat.js';
@@ -165,7 +164,7 @@ import VertexFormat from './VertexFormat.js';
});
};
- defineProperties(CircleGeometry.prototype, {
+ Object.defineProperties(CircleGeometry.prototype, {
/**
* @private
*/
diff --git a/Source/Core/Clock.js b/Source/Core/Clock.js
index ab33cd1c6192..390db7f1469a 100644
--- a/Source/Core/Clock.js
+++ b/Source/Core/Clock.js
@@ -2,7 +2,6 @@ import ClockRange from './ClockRange.js';
import ClockStep from './ClockStep.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Event from './Event.js';
import getTimestamp from './getTimestamp.js';
@@ -141,7 +140,7 @@ import JulianDate from './JulianDate.js';
this.clockStep = defaultValue(options.clockStep, ClockStep.SYSTEM_CLOCK_MULTIPLIER);
}
- defineProperties(Clock.prototype, {
+ Object.defineProperties(Clock.prototype, {
/**
* The current time.
* Changing this property will change
diff --git a/Source/Core/ClockRange.js b/Source/Core/ClockRange.js
index b458f8b07edd..ca3343497d96 100644
--- a/Source/Core/ClockRange.js
+++ b/Source/Core/ClockRange.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Constants used by {@link Clock#tick} to determine behavior
@@ -38,4 +37,4 @@ import freezeObject from './freezeObject.js';
*/
LOOP_STOP : 2
};
-export default freezeObject(ClockRange);
+export default Object.freeze(ClockRange);
diff --git a/Source/Core/ClockStep.js b/Source/Core/ClockStep.js
index 26385e80dfb3..c2429730a63e 100644
--- a/Source/Core/ClockStep.js
+++ b/Source/Core/ClockStep.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Constants to determine how much time advances with each call
@@ -37,4 +36,4 @@ import freezeObject from './freezeObject.js';
*/
SYSTEM_CLOCK : 2
};
-export default freezeObject(ClockStep);
+export default Object.freeze(ClockStep);
diff --git a/Source/Core/Color.js b/Source/Core/Color.js
index 9119ca9e5a31..62a27a68b0e8 100644
--- a/Source/Core/Color.js
+++ b/Source/Core/Color.js
@@ -2,7 +2,6 @@ import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import FeatureDetection from './FeatureDetection.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
function hue2rgb(m1, m2, h) {
@@ -880,7 +879,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ALICEBLUE = freezeObject(Color.fromCssColorString('#F0F8FF'));
+ Color.ALICEBLUE = Object.freeze(Color.fromCssColorString('#F0F8FF'));
/**
* An immutable Color instance initialized to CSS color #FAEBD7
@@ -889,7 +888,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ANTIQUEWHITE = freezeObject(Color.fromCssColorString('#FAEBD7'));
+ Color.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString('#FAEBD7'));
/**
* An immutable Color instance initialized to CSS color #00FFFF
@@ -898,7 +897,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.AQUA = freezeObject(Color.fromCssColorString('#00FFFF'));
+ Color.AQUA = Object.freeze(Color.fromCssColorString('#00FFFF'));
/**
* An immutable Color instance initialized to CSS color #7FFFD4
@@ -907,7 +906,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.AQUAMARINE = freezeObject(Color.fromCssColorString('#7FFFD4'));
+ Color.AQUAMARINE = Object.freeze(Color.fromCssColorString('#7FFFD4'));
/**
* An immutable Color instance initialized to CSS color #F0FFFF
@@ -916,7 +915,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.AZURE = freezeObject(Color.fromCssColorString('#F0FFFF'));
+ Color.AZURE = Object.freeze(Color.fromCssColorString('#F0FFFF'));
/**
* An immutable Color instance initialized to CSS color #F5F5DC
@@ -925,7 +924,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BEIGE = freezeObject(Color.fromCssColorString('#F5F5DC'));
+ Color.BEIGE = Object.freeze(Color.fromCssColorString('#F5F5DC'));
/**
* An immutable Color instance initialized to CSS color #FFE4C4
@@ -934,7 +933,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BISQUE = freezeObject(Color.fromCssColorString('#FFE4C4'));
+ Color.BISQUE = Object.freeze(Color.fromCssColorString('#FFE4C4'));
/**
* An immutable Color instance initialized to CSS color #000000
@@ -943,7 +942,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BLACK = freezeObject(Color.fromCssColorString('#000000'));
+ Color.BLACK = Object.freeze(Color.fromCssColorString('#000000'));
/**
* An immutable Color instance initialized to CSS color #FFEBCD
@@ -952,7 +951,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BLANCHEDALMOND = freezeObject(Color.fromCssColorString('#FFEBCD'));
+ Color.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString('#FFEBCD'));
/**
* An immutable Color instance initialized to CSS color #0000FF
@@ -961,7 +960,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BLUE = freezeObject(Color.fromCssColorString('#0000FF'));
+ Color.BLUE = Object.freeze(Color.fromCssColorString('#0000FF'));
/**
* An immutable Color instance initialized to CSS color #8A2BE2
@@ -970,7 +969,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BLUEVIOLET = freezeObject(Color.fromCssColorString('#8A2BE2'));
+ Color.BLUEVIOLET = Object.freeze(Color.fromCssColorString('#8A2BE2'));
/**
* An immutable Color instance initialized to CSS color #A52A2A
@@ -979,7 +978,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BROWN = freezeObject(Color.fromCssColorString('#A52A2A'));
+ Color.BROWN = Object.freeze(Color.fromCssColorString('#A52A2A'));
/**
* An immutable Color instance initialized to CSS color #DEB887
@@ -988,7 +987,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.BURLYWOOD = freezeObject(Color.fromCssColorString('#DEB887'));
+ Color.BURLYWOOD = Object.freeze(Color.fromCssColorString('#DEB887'));
/**
* An immutable Color instance initialized to CSS color #5F9EA0
@@ -997,7 +996,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CADETBLUE = freezeObject(Color.fromCssColorString('#5F9EA0'));
+ Color.CADETBLUE = Object.freeze(Color.fromCssColorString('#5F9EA0'));
/**
* An immutable Color instance initialized to CSS color #7FFF00
*
@@ -1005,7 +1004,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CHARTREUSE = freezeObject(Color.fromCssColorString('#7FFF00'));
+ Color.CHARTREUSE = Object.freeze(Color.fromCssColorString('#7FFF00'));
/**
* An immutable Color instance initialized to CSS color #D2691E
@@ -1014,7 +1013,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CHOCOLATE = freezeObject(Color.fromCssColorString('#D2691E'));
+ Color.CHOCOLATE = Object.freeze(Color.fromCssColorString('#D2691E'));
/**
* An immutable Color instance initialized to CSS color #FF7F50
@@ -1023,7 +1022,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CORAL = freezeObject(Color.fromCssColorString('#FF7F50'));
+ Color.CORAL = Object.freeze(Color.fromCssColorString('#FF7F50'));
/**
* An immutable Color instance initialized to CSS color #6495ED
@@ -1032,7 +1031,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CORNFLOWERBLUE = freezeObject(Color.fromCssColorString('#6495ED'));
+ Color.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString('#6495ED'));
/**
* An immutable Color instance initialized to CSS color #FFF8DC
@@ -1041,7 +1040,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CORNSILK = freezeObject(Color.fromCssColorString('#FFF8DC'));
+ Color.CORNSILK = Object.freeze(Color.fromCssColorString('#FFF8DC'));
/**
* An immutable Color instance initialized to CSS color #DC143C
@@ -1050,7 +1049,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CRIMSON = freezeObject(Color.fromCssColorString('#DC143C'));
+ Color.CRIMSON = Object.freeze(Color.fromCssColorString('#DC143C'));
/**
* An immutable Color instance initialized to CSS color #00FFFF
@@ -1059,7 +1058,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.CYAN = freezeObject(Color.fromCssColorString('#00FFFF'));
+ Color.CYAN = Object.freeze(Color.fromCssColorString('#00FFFF'));
/**
* An immutable Color instance initialized to CSS color #00008B
@@ -1068,7 +1067,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKBLUE = freezeObject(Color.fromCssColorString('#00008B'));
+ Color.DARKBLUE = Object.freeze(Color.fromCssColorString('#00008B'));
/**
* An immutable Color instance initialized to CSS color #008B8B
@@ -1077,7 +1076,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKCYAN = freezeObject(Color.fromCssColorString('#008B8B'));
+ Color.DARKCYAN = Object.freeze(Color.fromCssColorString('#008B8B'));
/**
* An immutable Color instance initialized to CSS color #B8860B
@@ -1086,7 +1085,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKGOLDENROD = freezeObject(Color.fromCssColorString('#B8860B'));
+ Color.DARKGOLDENROD = Object.freeze(Color.fromCssColorString('#B8860B'));
/**
* An immutable Color instance initialized to CSS color #A9A9A9
@@ -1095,7 +1094,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKGRAY = freezeObject(Color.fromCssColorString('#A9A9A9'));
+ Color.DARKGRAY = Object.freeze(Color.fromCssColorString('#A9A9A9'));
/**
* An immutable Color instance initialized to CSS color #006400
@@ -1104,7 +1103,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKGREEN = freezeObject(Color.fromCssColorString('#006400'));
+ Color.DARKGREEN = Object.freeze(Color.fromCssColorString('#006400'));
/**
* An immutable Color instance initialized to CSS color #A9A9A9
@@ -1122,7 +1121,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKKHAKI = freezeObject(Color.fromCssColorString('#BDB76B'));
+ Color.DARKKHAKI = Object.freeze(Color.fromCssColorString('#BDB76B'));
/**
* An immutable Color instance initialized to CSS color #8B008B
@@ -1131,7 +1130,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKMAGENTA = freezeObject(Color.fromCssColorString('#8B008B'));
+ Color.DARKMAGENTA = Object.freeze(Color.fromCssColorString('#8B008B'));
/**
* An immutable Color instance initialized to CSS color #556B2F
@@ -1140,7 +1139,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKOLIVEGREEN = freezeObject(Color.fromCssColorString('#556B2F'));
+ Color.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString('#556B2F'));
/**
* An immutable Color instance initialized to CSS color #FF8C00
@@ -1149,7 +1148,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKORANGE = freezeObject(Color.fromCssColorString('#FF8C00'));
+ Color.DARKORANGE = Object.freeze(Color.fromCssColorString('#FF8C00'));
/**
* An immutable Color instance initialized to CSS color #9932CC
@@ -1158,7 +1157,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKORCHID = freezeObject(Color.fromCssColorString('#9932CC'));
+ Color.DARKORCHID = Object.freeze(Color.fromCssColorString('#9932CC'));
/**
* An immutable Color instance initialized to CSS color #8B0000
@@ -1167,7 +1166,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKRED = freezeObject(Color.fromCssColorString('#8B0000'));
+ Color.DARKRED = Object.freeze(Color.fromCssColorString('#8B0000'));
/**
* An immutable Color instance initialized to CSS color #E9967A
@@ -1176,7 +1175,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKSALMON = freezeObject(Color.fromCssColorString('#E9967A'));
+ Color.DARKSALMON = Object.freeze(Color.fromCssColorString('#E9967A'));
/**
* An immutable Color instance initialized to CSS color #8FBC8F
@@ -1185,7 +1184,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKSEAGREEN = freezeObject(Color.fromCssColorString('#8FBC8F'));
+ Color.DARKSEAGREEN = Object.freeze(Color.fromCssColorString('#8FBC8F'));
/**
* An immutable Color instance initialized to CSS color #483D8B
@@ -1194,7 +1193,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKSLATEBLUE = freezeObject(Color.fromCssColorString('#483D8B'));
+ Color.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString('#483D8B'));
/**
* An immutable Color instance initialized to CSS color #2F4F4F
@@ -1203,7 +1202,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKSLATEGRAY = freezeObject(Color.fromCssColorString('#2F4F4F'));
+ Color.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString('#2F4F4F'));
/**
* An immutable Color instance initialized to CSS color #2F4F4F
@@ -1221,7 +1220,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKTURQUOISE = freezeObject(Color.fromCssColorString('#00CED1'));
+ Color.DARKTURQUOISE = Object.freeze(Color.fromCssColorString('#00CED1'));
/**
* An immutable Color instance initialized to CSS color #9400D3
@@ -1230,7 +1229,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DARKVIOLET = freezeObject(Color.fromCssColorString('#9400D3'));
+ Color.DARKVIOLET = Object.freeze(Color.fromCssColorString('#9400D3'));
/**
* An immutable Color instance initialized to CSS color #FF1493
@@ -1239,7 +1238,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DEEPPINK = freezeObject(Color.fromCssColorString('#FF1493'));
+ Color.DEEPPINK = Object.freeze(Color.fromCssColorString('#FF1493'));
/**
* An immutable Color instance initialized to CSS color #00BFFF
@@ -1248,7 +1247,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DEEPSKYBLUE = freezeObject(Color.fromCssColorString('#00BFFF'));
+ Color.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString('#00BFFF'));
/**
* An immutable Color instance initialized to CSS color #696969
@@ -1257,7 +1256,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DIMGRAY = freezeObject(Color.fromCssColorString('#696969'));
+ Color.DIMGRAY = Object.freeze(Color.fromCssColorString('#696969'));
/**
* An immutable Color instance initialized to CSS color #696969
@@ -1275,7 +1274,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.DODGERBLUE = freezeObject(Color.fromCssColorString('#1E90FF'));
+ Color.DODGERBLUE = Object.freeze(Color.fromCssColorString('#1E90FF'));
/**
* An immutable Color instance initialized to CSS color #B22222
@@ -1284,7 +1283,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.FIREBRICK = freezeObject(Color.fromCssColorString('#B22222'));
+ Color.FIREBRICK = Object.freeze(Color.fromCssColorString('#B22222'));
/**
* An immutable Color instance initialized to CSS color #FFFAF0
@@ -1293,7 +1292,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.FLORALWHITE = freezeObject(Color.fromCssColorString('#FFFAF0'));
+ Color.FLORALWHITE = Object.freeze(Color.fromCssColorString('#FFFAF0'));
/**
* An immutable Color instance initialized to CSS color #228B22
@@ -1302,7 +1301,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.FORESTGREEN = freezeObject(Color.fromCssColorString('#228B22'));
+ Color.FORESTGREEN = Object.freeze(Color.fromCssColorString('#228B22'));
/**
* An immutable Color instance initialized to CSS color #FF00FF
@@ -1311,7 +1310,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.FUCHSIA = freezeObject(Color.fromCssColorString('#FF00FF'));
+ Color.FUCHSIA = Object.freeze(Color.fromCssColorString('#FF00FF'));
/**
* An immutable Color instance initialized to CSS color #DCDCDC
@@ -1320,7 +1319,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GAINSBORO = freezeObject(Color.fromCssColorString('#DCDCDC'));
+ Color.GAINSBORO = Object.freeze(Color.fromCssColorString('#DCDCDC'));
/**
* An immutable Color instance initialized to CSS color #F8F8FF
@@ -1329,7 +1328,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GHOSTWHITE = freezeObject(Color.fromCssColorString('#F8F8FF'));
+ Color.GHOSTWHITE = Object.freeze(Color.fromCssColorString('#F8F8FF'));
/**
* An immutable Color instance initialized to CSS color #FFD700
@@ -1338,7 +1337,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GOLD = freezeObject(Color.fromCssColorString('#FFD700'));
+ Color.GOLD = Object.freeze(Color.fromCssColorString('#FFD700'));
/**
* An immutable Color instance initialized to CSS color #DAA520
@@ -1347,7 +1346,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GOLDENROD = freezeObject(Color.fromCssColorString('#DAA520'));
+ Color.GOLDENROD = Object.freeze(Color.fromCssColorString('#DAA520'));
/**
* An immutable Color instance initialized to CSS color #808080
@@ -1356,7 +1355,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GRAY = freezeObject(Color.fromCssColorString('#808080'));
+ Color.GRAY = Object.freeze(Color.fromCssColorString('#808080'));
/**
* An immutable Color instance initialized to CSS color #008000
@@ -1365,7 +1364,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GREEN = freezeObject(Color.fromCssColorString('#008000'));
+ Color.GREEN = Object.freeze(Color.fromCssColorString('#008000'));
/**
* An immutable Color instance initialized to CSS color #ADFF2F
@@ -1374,7 +1373,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.GREENYELLOW = freezeObject(Color.fromCssColorString('#ADFF2F'));
+ Color.GREENYELLOW = Object.freeze(Color.fromCssColorString('#ADFF2F'));
/**
* An immutable Color instance initialized to CSS color #808080
@@ -1392,7 +1391,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.HONEYDEW = freezeObject(Color.fromCssColorString('#F0FFF0'));
+ Color.HONEYDEW = Object.freeze(Color.fromCssColorString('#F0FFF0'));
/**
* An immutable Color instance initialized to CSS color #FF69B4
@@ -1401,7 +1400,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.HOTPINK = freezeObject(Color.fromCssColorString('#FF69B4'));
+ Color.HOTPINK = Object.freeze(Color.fromCssColorString('#FF69B4'));
/**
* An immutable Color instance initialized to CSS color #CD5C5C
@@ -1410,7 +1409,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.INDIANRED = freezeObject(Color.fromCssColorString('#CD5C5C'));
+ Color.INDIANRED = Object.freeze(Color.fromCssColorString('#CD5C5C'));
/**
* An immutable Color instance initialized to CSS color #4B0082
@@ -1419,7 +1418,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.INDIGO = freezeObject(Color.fromCssColorString('#4B0082'));
+ Color.INDIGO = Object.freeze(Color.fromCssColorString('#4B0082'));
/**
* An immutable Color instance initialized to CSS color #FFFFF0
@@ -1428,7 +1427,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.IVORY = freezeObject(Color.fromCssColorString('#FFFFF0'));
+ Color.IVORY = Object.freeze(Color.fromCssColorString('#FFFFF0'));
/**
* An immutable Color instance initialized to CSS color #F0E68C
@@ -1437,7 +1436,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.KHAKI = freezeObject(Color.fromCssColorString('#F0E68C'));
+ Color.KHAKI = Object.freeze(Color.fromCssColorString('#F0E68C'));
/**
* An immutable Color instance initialized to CSS color #E6E6FA
@@ -1446,7 +1445,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LAVENDER = freezeObject(Color.fromCssColorString('#E6E6FA'));
+ Color.LAVENDER = Object.freeze(Color.fromCssColorString('#E6E6FA'));
/**
* An immutable Color instance initialized to CSS color #FFF0F5
@@ -1455,7 +1454,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LAVENDAR_BLUSH = freezeObject(Color.fromCssColorString('#FFF0F5'));
+ Color.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString('#FFF0F5'));
/**
* An immutable Color instance initialized to CSS color #7CFC00
@@ -1464,7 +1463,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LAWNGREEN = freezeObject(Color.fromCssColorString('#7CFC00'));
+ Color.LAWNGREEN = Object.freeze(Color.fromCssColorString('#7CFC00'));
/**
* An immutable Color instance initialized to CSS color #FFFACD
@@ -1473,7 +1472,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LEMONCHIFFON = freezeObject(Color.fromCssColorString('#FFFACD'));
+ Color.LEMONCHIFFON = Object.freeze(Color.fromCssColorString('#FFFACD'));
/**
* An immutable Color instance initialized to CSS color #ADD8E6
@@ -1482,7 +1481,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTBLUE = freezeObject(Color.fromCssColorString('#ADD8E6'));
+ Color.LIGHTBLUE = Object.freeze(Color.fromCssColorString('#ADD8E6'));
/**
* An immutable Color instance initialized to CSS color #F08080
@@ -1491,7 +1490,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTCORAL = freezeObject(Color.fromCssColorString('#F08080'));
+ Color.LIGHTCORAL = Object.freeze(Color.fromCssColorString('#F08080'));
/**
* An immutable Color instance initialized to CSS color #E0FFFF
@@ -1500,7 +1499,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTCYAN = freezeObject(Color.fromCssColorString('#E0FFFF'));
+ Color.LIGHTCYAN = Object.freeze(Color.fromCssColorString('#E0FFFF'));
/**
* An immutable Color instance initialized to CSS color #FAFAD2
@@ -1509,7 +1508,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTGOLDENRODYELLOW = freezeObject(Color.fromCssColorString('#FAFAD2'));
+ Color.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString('#FAFAD2'));
/**
* An immutable Color instance initialized to CSS color #D3D3D3
@@ -1518,7 +1517,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTGRAY = freezeObject(Color.fromCssColorString('#D3D3D3'));
+ Color.LIGHTGRAY = Object.freeze(Color.fromCssColorString('#D3D3D3'));
/**
* An immutable Color instance initialized to CSS color #90EE90
@@ -1527,7 +1526,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTGREEN = freezeObject(Color.fromCssColorString('#90EE90'));
+ Color.LIGHTGREEN = Object.freeze(Color.fromCssColorString('#90EE90'));
/**
* An immutable Color instance initialized to CSS color #D3D3D3
@@ -1545,7 +1544,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTPINK = freezeObject(Color.fromCssColorString('#FFB6C1'));
+ Color.LIGHTPINK = Object.freeze(Color.fromCssColorString('#FFB6C1'));
/**
* An immutable Color instance initialized to CSS color #20B2AA
@@ -1554,7 +1553,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTSEAGREEN = freezeObject(Color.fromCssColorString('#20B2AA'));
+ Color.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString('#20B2AA'));
/**
* An immutable Color instance initialized to CSS color #87CEFA
@@ -1563,7 +1562,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTSKYBLUE = freezeObject(Color.fromCssColorString('#87CEFA'));
+ Color.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString('#87CEFA'));
/**
* An immutable Color instance initialized to CSS color #778899
@@ -1572,7 +1571,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTSLATEGRAY = freezeObject(Color.fromCssColorString('#778899'));
+ Color.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString('#778899'));
/**
* An immutable Color instance initialized to CSS color #778899
@@ -1590,7 +1589,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTSTEELBLUE = freezeObject(Color.fromCssColorString('#B0C4DE'));
+ Color.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString('#B0C4DE'));
/**
* An immutable Color instance initialized to CSS color #FFFFE0
@@ -1599,7 +1598,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIGHTYELLOW = freezeObject(Color.fromCssColorString('#FFFFE0'));
+ Color.LIGHTYELLOW = Object.freeze(Color.fromCssColorString('#FFFFE0'));
/**
* An immutable Color instance initialized to CSS color #00FF00
@@ -1608,7 +1607,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIME = freezeObject(Color.fromCssColorString('#00FF00'));
+ Color.LIME = Object.freeze(Color.fromCssColorString('#00FF00'));
/**
* An immutable Color instance initialized to CSS color #32CD32
@@ -1617,7 +1616,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LIMEGREEN = freezeObject(Color.fromCssColorString('#32CD32'));
+ Color.LIMEGREEN = Object.freeze(Color.fromCssColorString('#32CD32'));
/**
* An immutable Color instance initialized to CSS color #FAF0E6
@@ -1626,7 +1625,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.LINEN = freezeObject(Color.fromCssColorString('#FAF0E6'));
+ Color.LINEN = Object.freeze(Color.fromCssColorString('#FAF0E6'));
/**
* An immutable Color instance initialized to CSS color #FF00FF
@@ -1635,7 +1634,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MAGENTA = freezeObject(Color.fromCssColorString('#FF00FF'));
+ Color.MAGENTA = Object.freeze(Color.fromCssColorString('#FF00FF'));
/**
* An immutable Color instance initialized to CSS color #800000
@@ -1644,7 +1643,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MAROON = freezeObject(Color.fromCssColorString('#800000'));
+ Color.MAROON = Object.freeze(Color.fromCssColorString('#800000'));
/**
* An immutable Color instance initialized to CSS color #66CDAA
@@ -1653,7 +1652,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMAQUAMARINE = freezeObject(Color.fromCssColorString('#66CDAA'));
+ Color.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString('#66CDAA'));
/**
* An immutable Color instance initialized to CSS color #0000CD
@@ -1662,7 +1661,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMBLUE = freezeObject(Color.fromCssColorString('#0000CD'));
+ Color.MEDIUMBLUE = Object.freeze(Color.fromCssColorString('#0000CD'));
/**
* An immutable Color instance initialized to CSS color #BA55D3
@@ -1671,7 +1670,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMORCHID = freezeObject(Color.fromCssColorString('#BA55D3'));
+ Color.MEDIUMORCHID = Object.freeze(Color.fromCssColorString('#BA55D3'));
/**
* An immutable Color instance initialized to CSS color #9370DB
@@ -1680,7 +1679,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMPURPLE = freezeObject(Color.fromCssColorString('#9370DB'));
+ Color.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString('#9370DB'));
/**
* An immutable Color instance initialized to CSS color #3CB371
@@ -1689,7 +1688,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMSEAGREEN = freezeObject(Color.fromCssColorString('#3CB371'));
+ Color.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString('#3CB371'));
/**
* An immutable Color instance initialized to CSS color #7B68EE
@@ -1698,7 +1697,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMSLATEBLUE = freezeObject(Color.fromCssColorString('#7B68EE'));
+ Color.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString('#7B68EE'));
/**
* An immutable Color instance initialized to CSS color #00FA9A
@@ -1707,7 +1706,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMSPRINGGREEN = freezeObject(Color.fromCssColorString('#00FA9A'));
+ Color.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString('#00FA9A'));
/**
* An immutable Color instance initialized to CSS color #48D1CC
@@ -1716,7 +1715,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMTURQUOISE = freezeObject(Color.fromCssColorString('#48D1CC'));
+ Color.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString('#48D1CC'));
/**
* An immutable Color instance initialized to CSS color #C71585
@@ -1725,7 +1724,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MEDIUMVIOLETRED = freezeObject(Color.fromCssColorString('#C71585'));
+ Color.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString('#C71585'));
/**
* An immutable Color instance initialized to CSS color #191970
@@ -1734,7 +1733,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MIDNIGHTBLUE = freezeObject(Color.fromCssColorString('#191970'));
+ Color.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString('#191970'));
/**
* An immutable Color instance initialized to CSS color #F5FFFA
@@ -1743,7 +1742,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MINTCREAM = freezeObject(Color.fromCssColorString('#F5FFFA'));
+ Color.MINTCREAM = Object.freeze(Color.fromCssColorString('#F5FFFA'));
/**
* An immutable Color instance initialized to CSS color #FFE4E1
@@ -1752,7 +1751,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MISTYROSE = freezeObject(Color.fromCssColorString('#FFE4E1'));
+ Color.MISTYROSE = Object.freeze(Color.fromCssColorString('#FFE4E1'));
/**
* An immutable Color instance initialized to CSS color #FFE4B5
@@ -1761,7 +1760,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.MOCCASIN = freezeObject(Color.fromCssColorString('#FFE4B5'));
+ Color.MOCCASIN = Object.freeze(Color.fromCssColorString('#FFE4B5'));
/**
* An immutable Color instance initialized to CSS color #FFDEAD
@@ -1770,7 +1769,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.NAVAJOWHITE = freezeObject(Color.fromCssColorString('#FFDEAD'));
+ Color.NAVAJOWHITE = Object.freeze(Color.fromCssColorString('#FFDEAD'));
/**
* An immutable Color instance initialized to CSS color #000080
@@ -1779,7 +1778,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.NAVY = freezeObject(Color.fromCssColorString('#000080'));
+ Color.NAVY = Object.freeze(Color.fromCssColorString('#000080'));
/**
* An immutable Color instance initialized to CSS color #FDF5E6
@@ -1788,7 +1787,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.OLDLACE = freezeObject(Color.fromCssColorString('#FDF5E6'));
+ Color.OLDLACE = Object.freeze(Color.fromCssColorString('#FDF5E6'));
/**
* An immutable Color instance initialized to CSS color #808000
@@ -1797,7 +1796,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.OLIVE = freezeObject(Color.fromCssColorString('#808000'));
+ Color.OLIVE = Object.freeze(Color.fromCssColorString('#808000'));
/**
* An immutable Color instance initialized to CSS color #6B8E23
@@ -1806,7 +1805,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.OLIVEDRAB = freezeObject(Color.fromCssColorString('#6B8E23'));
+ Color.OLIVEDRAB = Object.freeze(Color.fromCssColorString('#6B8E23'));
/**
* An immutable Color instance initialized to CSS color #FFA500
@@ -1815,7 +1814,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ORANGE = freezeObject(Color.fromCssColorString('#FFA500'));
+ Color.ORANGE = Object.freeze(Color.fromCssColorString('#FFA500'));
/**
* An immutable Color instance initialized to CSS color #FF4500
@@ -1824,7 +1823,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ORANGERED = freezeObject(Color.fromCssColorString('#FF4500'));
+ Color.ORANGERED = Object.freeze(Color.fromCssColorString('#FF4500'));
/**
* An immutable Color instance initialized to CSS color #DA70D6
@@ -1833,7 +1832,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ORCHID = freezeObject(Color.fromCssColorString('#DA70D6'));
+ Color.ORCHID = Object.freeze(Color.fromCssColorString('#DA70D6'));
/**
* An immutable Color instance initialized to CSS color #EEE8AA
@@ -1842,7 +1841,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PALEGOLDENROD = freezeObject(Color.fromCssColorString('#EEE8AA'));
+ Color.PALEGOLDENROD = Object.freeze(Color.fromCssColorString('#EEE8AA'));
/**
* An immutable Color instance initialized to CSS color #98FB98
@@ -1851,7 +1850,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PALEGREEN = freezeObject(Color.fromCssColorString('#98FB98'));
+ Color.PALEGREEN = Object.freeze(Color.fromCssColorString('#98FB98'));
/**
* An immutable Color instance initialized to CSS color #AFEEEE
@@ -1860,7 +1859,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PALETURQUOISE = freezeObject(Color.fromCssColorString('#AFEEEE'));
+ Color.PALETURQUOISE = Object.freeze(Color.fromCssColorString('#AFEEEE'));
/**
* An immutable Color instance initialized to CSS color #DB7093
@@ -1869,7 +1868,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PALEVIOLETRED = freezeObject(Color.fromCssColorString('#DB7093'));
+ Color.PALEVIOLETRED = Object.freeze(Color.fromCssColorString('#DB7093'));
/**
* An immutable Color instance initialized to CSS color #FFEFD5
@@ -1878,7 +1877,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PAPAYAWHIP = freezeObject(Color.fromCssColorString('#FFEFD5'));
+ Color.PAPAYAWHIP = Object.freeze(Color.fromCssColorString('#FFEFD5'));
/**
* An immutable Color instance initialized to CSS color #FFDAB9
@@ -1887,7 +1886,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PEACHPUFF = freezeObject(Color.fromCssColorString('#FFDAB9'));
+ Color.PEACHPUFF = Object.freeze(Color.fromCssColorString('#FFDAB9'));
/**
* An immutable Color instance initialized to CSS color #CD853F
@@ -1896,7 +1895,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PERU = freezeObject(Color.fromCssColorString('#CD853F'));
+ Color.PERU = Object.freeze(Color.fromCssColorString('#CD853F'));
/**
* An immutable Color instance initialized to CSS color #FFC0CB
@@ -1905,7 +1904,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PINK = freezeObject(Color.fromCssColorString('#FFC0CB'));
+ Color.PINK = Object.freeze(Color.fromCssColorString('#FFC0CB'));
/**
* An immutable Color instance initialized to CSS color #DDA0DD
@@ -1914,7 +1913,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PLUM = freezeObject(Color.fromCssColorString('#DDA0DD'));
+ Color.PLUM = Object.freeze(Color.fromCssColorString('#DDA0DD'));
/**
* An immutable Color instance initialized to CSS color #B0E0E6
@@ -1923,7 +1922,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.POWDERBLUE = freezeObject(Color.fromCssColorString('#B0E0E6'));
+ Color.POWDERBLUE = Object.freeze(Color.fromCssColorString('#B0E0E6'));
/**
* An immutable Color instance initialized to CSS color #800080
@@ -1932,7 +1931,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.PURPLE = freezeObject(Color.fromCssColorString('#800080'));
+ Color.PURPLE = Object.freeze(Color.fromCssColorString('#800080'));
/**
* An immutable Color instance initialized to CSS color #FF0000
@@ -1941,7 +1940,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.RED = freezeObject(Color.fromCssColorString('#FF0000'));
+ Color.RED = Object.freeze(Color.fromCssColorString('#FF0000'));
/**
* An immutable Color instance initialized to CSS color #BC8F8F
@@ -1950,7 +1949,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ROSYBROWN = freezeObject(Color.fromCssColorString('#BC8F8F'));
+ Color.ROSYBROWN = Object.freeze(Color.fromCssColorString('#BC8F8F'));
/**
* An immutable Color instance initialized to CSS color #4169E1
@@ -1959,7 +1958,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.ROYALBLUE = freezeObject(Color.fromCssColorString('#4169E1'));
+ Color.ROYALBLUE = Object.freeze(Color.fromCssColorString('#4169E1'));
/**
* An immutable Color instance initialized to CSS color #8B4513
@@ -1968,7 +1967,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SADDLEBROWN = freezeObject(Color.fromCssColorString('#8B4513'));
+ Color.SADDLEBROWN = Object.freeze(Color.fromCssColorString('#8B4513'));
/**
* An immutable Color instance initialized to CSS color #FA8072
@@ -1977,7 +1976,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SALMON = freezeObject(Color.fromCssColorString('#FA8072'));
+ Color.SALMON = Object.freeze(Color.fromCssColorString('#FA8072'));
/**
* An immutable Color instance initialized to CSS color #F4A460
@@ -1986,7 +1985,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SANDYBROWN = freezeObject(Color.fromCssColorString('#F4A460'));
+ Color.SANDYBROWN = Object.freeze(Color.fromCssColorString('#F4A460'));
/**
* An immutable Color instance initialized to CSS color #2E8B57
@@ -1995,7 +1994,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SEAGREEN = freezeObject(Color.fromCssColorString('#2E8B57'));
+ Color.SEAGREEN = Object.freeze(Color.fromCssColorString('#2E8B57'));
/**
* An immutable Color instance initialized to CSS color #FFF5EE
@@ -2004,7 +2003,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SEASHELL = freezeObject(Color.fromCssColorString('#FFF5EE'));
+ Color.SEASHELL = Object.freeze(Color.fromCssColorString('#FFF5EE'));
/**
* An immutable Color instance initialized to CSS color #A0522D
@@ -2013,7 +2012,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SIENNA = freezeObject(Color.fromCssColorString('#A0522D'));
+ Color.SIENNA = Object.freeze(Color.fromCssColorString('#A0522D'));
/**
* An immutable Color instance initialized to CSS color #C0C0C0
@@ -2022,7 +2021,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SILVER = freezeObject(Color.fromCssColorString('#C0C0C0'));
+ Color.SILVER = Object.freeze(Color.fromCssColorString('#C0C0C0'));
/**
* An immutable Color instance initialized to CSS color #87CEEB
@@ -2031,7 +2030,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SKYBLUE = freezeObject(Color.fromCssColorString('#87CEEB'));
+ Color.SKYBLUE = Object.freeze(Color.fromCssColorString('#87CEEB'));
/**
* An immutable Color instance initialized to CSS color #6A5ACD
@@ -2040,7 +2039,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SLATEBLUE = freezeObject(Color.fromCssColorString('#6A5ACD'));
+ Color.SLATEBLUE = Object.freeze(Color.fromCssColorString('#6A5ACD'));
/**
* An immutable Color instance initialized to CSS color #708090
@@ -2049,7 +2048,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SLATEGRAY = freezeObject(Color.fromCssColorString('#708090'));
+ Color.SLATEGRAY = Object.freeze(Color.fromCssColorString('#708090'));
/**
* An immutable Color instance initialized to CSS color #708090
@@ -2067,7 +2066,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SNOW = freezeObject(Color.fromCssColorString('#FFFAFA'));
+ Color.SNOW = Object.freeze(Color.fromCssColorString('#FFFAFA'));
/**
* An immutable Color instance initialized to CSS color #00FF7F
@@ -2076,7 +2075,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.SPRINGGREEN = freezeObject(Color.fromCssColorString('#00FF7F'));
+ Color.SPRINGGREEN = Object.freeze(Color.fromCssColorString('#00FF7F'));
/**
* An immutable Color instance initialized to CSS color #4682B4
@@ -2085,7 +2084,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.STEELBLUE = freezeObject(Color.fromCssColorString('#4682B4'));
+ Color.STEELBLUE = Object.freeze(Color.fromCssColorString('#4682B4'));
/**
* An immutable Color instance initialized to CSS color #D2B48C
@@ -2094,7 +2093,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.TAN = freezeObject(Color.fromCssColorString('#D2B48C'));
+ Color.TAN = Object.freeze(Color.fromCssColorString('#D2B48C'));
/**
* An immutable Color instance initialized to CSS color #008080
@@ -2103,7 +2102,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.TEAL = freezeObject(Color.fromCssColorString('#008080'));
+ Color.TEAL = Object.freeze(Color.fromCssColorString('#008080'));
/**
* An immutable Color instance initialized to CSS color #D8BFD8
@@ -2112,7 +2111,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.THISTLE = freezeObject(Color.fromCssColorString('#D8BFD8'));
+ Color.THISTLE = Object.freeze(Color.fromCssColorString('#D8BFD8'));
/**
* An immutable Color instance initialized to CSS color #FF6347
@@ -2121,7 +2120,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.TOMATO = freezeObject(Color.fromCssColorString('#FF6347'));
+ Color.TOMATO = Object.freeze(Color.fromCssColorString('#FF6347'));
/**
* An immutable Color instance initialized to CSS color #40E0D0
@@ -2130,7 +2129,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.TURQUOISE = freezeObject(Color.fromCssColorString('#40E0D0'));
+ Color.TURQUOISE = Object.freeze(Color.fromCssColorString('#40E0D0'));
/**
* An immutable Color instance initialized to CSS color #EE82EE
@@ -2139,7 +2138,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.VIOLET = freezeObject(Color.fromCssColorString('#EE82EE'));
+ Color.VIOLET = Object.freeze(Color.fromCssColorString('#EE82EE'));
/**
* An immutable Color instance initialized to CSS color #F5DEB3
@@ -2148,7 +2147,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.WHEAT = freezeObject(Color.fromCssColorString('#F5DEB3'));
+ Color.WHEAT = Object.freeze(Color.fromCssColorString('#F5DEB3'));
/**
* An immutable Color instance initialized to CSS color #FFFFFF
@@ -2157,7 +2156,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.WHITE = freezeObject(Color.fromCssColorString('#FFFFFF'));
+ Color.WHITE = Object.freeze(Color.fromCssColorString('#FFFFFF'));
/**
* An immutable Color instance initialized to CSS color #F5F5F5
@@ -2166,7 +2165,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.WHITESMOKE = freezeObject(Color.fromCssColorString('#F5F5F5'));
+ Color.WHITESMOKE = Object.freeze(Color.fromCssColorString('#F5F5F5'));
/**
* An immutable Color instance initialized to CSS color #FFFF00
@@ -2175,7 +2174,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.YELLOW = freezeObject(Color.fromCssColorString('#FFFF00'));
+ Color.YELLOW = Object.freeze(Color.fromCssColorString('#FFFF00'));
/**
* An immutable Color instance initialized to CSS color #9ACD32
@@ -2184,7 +2183,7 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.YELLOWGREEN = freezeObject(Color.fromCssColorString('#9ACD32'));
+ Color.YELLOWGREEN = Object.freeze(Color.fromCssColorString('#9ACD32'));
/**
* An immutable Color instance initialized to CSS transparent.
@@ -2193,5 +2192,5 @@ import CesiumMath from './Math.js';
* @constant
* @type {Color}
*/
- Color.TRANSPARENT = freezeObject(new Color(0, 0, 0, 0));
+ Color.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));
export default Color;
diff --git a/Source/Core/ColorGeometryInstanceAttribute.js b/Source/Core/ColorGeometryInstanceAttribute.js
index 5ef44ea8e36c..cf88ec7ad89b 100644
--- a/Source/Core/ColorGeometryInstanceAttribute.js
+++ b/Source/Core/ColorGeometryInstanceAttribute.js
@@ -2,7 +2,6 @@ import Color from './Color.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -54,7 +53,7 @@ import DeveloperError from './DeveloperError.js';
]);
}
- defineProperties(ColorGeometryInstanceAttribute.prototype, {
+ Object.defineProperties(ColorGeometryInstanceAttribute.prototype, {
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link ColorGeometryInstanceAttribute#value}.
diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js
index fe1ab0d87833..fcc29403ab12 100644
--- a/Source/Core/ComponentDatatype.js
+++ b/Source/Core/ComponentDatatype.js
@@ -1,7 +1,6 @@
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import WebGLConstants from './WebGLConstants.js';
/**
@@ -318,4 +317,4 @@ import WebGLConstants from './WebGLConstants.js';
//>>includeEnd('debug');
}
};
-export default freezeObject(ComponentDatatype);
+export default Object.freeze(ComponentDatatype);
diff --git a/Source/Core/CompressedTextureBuffer.js b/Source/Core/CompressedTextureBuffer.js
index 62f00c56ea9e..3016fdad58c7 100644
--- a/Source/Core/CompressedTextureBuffer.js
+++ b/Source/Core/CompressedTextureBuffer.js
@@ -1,5 +1,4 @@
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
/**
* Describes a compressed texture and contains a compressed texture buffer.
@@ -18,7 +17,7 @@ import defineProperties from './defineProperties.js';
this._buffer = buffer;
}
- defineProperties(CompressedTextureBuffer.prototype, {
+ Object.defineProperties(CompressedTextureBuffer.prototype, {
/**
* The format of the compressed texture.
* @type PixelFormat
diff --git a/Source/Core/CornerType.js b/Source/Core/CornerType.js
index de73c9ef7fb9..55b29a36a857 100644
--- a/Source/Core/CornerType.js
+++ b/Source/Core/CornerType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Style options for corners.
@@ -36,4 +35,4 @@ import freezeObject from './freezeObject.js';
*/
BEVELED : 2
};
-export default freezeObject(CornerType);
+export default Object.freeze(CornerType);
diff --git a/Source/Core/CorridorGeometry.js b/Source/Core/CorridorGeometry.js
index 096ccab75bbc..fcaebd4181bc 100644
--- a/Source/Core/CorridorGeometry.js
+++ b/Source/Core/CorridorGeometry.js
@@ -9,7 +9,6 @@ import CornerType from './CornerType.js';
import CorridorGeometryLibrary from './CorridorGeometryLibrary.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import Geometry from './Geometry.js';
import GeometryAttribute from './GeometryAttribute.js';
@@ -1066,7 +1065,7 @@ import VertexFormat from './VertexFormat.js';
});
};
- defineProperties(CorridorGeometry.prototype, {
+ Object.defineProperties(CorridorGeometry.prototype, {
/**
* @private
*/
diff --git a/Source/Core/Credit.js b/Source/Core/Credit.js
index e6b45128b4e8..e4eba45763c4 100644
--- a/Source/Core/Credit.js
+++ b/Source/Core/Credit.js
@@ -2,7 +2,6 @@ import DOMPurify from '../ThirdParty/purify.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
var nextCreditId = 0;
var creditToId = {};
@@ -44,7 +43,7 @@ import defineProperties from './defineProperties.js';
this._element = undefined;
}
- defineProperties(Credit.prototype, {
+ Object.defineProperties(Credit.prototype, {
/**
* The credit content
* @memberof Credit.prototype
diff --git a/Source/Core/DistanceDisplayCondition.js b/Source/Core/DistanceDisplayCondition.js
index 17cc7337c98f..6ad3b43189dd 100644
--- a/Source/Core/DistanceDisplayCondition.js
+++ b/Source/Core/DistanceDisplayCondition.js
@@ -1,6 +1,5 @@
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -24,7 +23,7 @@ import DeveloperError from './DeveloperError.js';
this._far = far;
}
- defineProperties(DistanceDisplayCondition.prototype, {
+ Object.defineProperties(DistanceDisplayCondition.prototype, {
/**
* The smallest distance in the interval where the object is visible.
* @memberof DistanceDisplayCondition.prototype
diff --git a/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js b/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js
index f51ee7efa027..38f8b59d8e01 100644
--- a/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js
+++ b/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js
@@ -1,7 +1,6 @@
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -53,7 +52,7 @@ import DeveloperError from './DeveloperError.js';
this.value = new Float32Array([near, far]);
}
- defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype, {
+ Object.defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype, {
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
diff --git a/Source/Core/DoublyLinkedList.js b/Source/Core/DoublyLinkedList.js
index 6dcb2ebea2ec..03e0786349fd 100644
--- a/Source/Core/DoublyLinkedList.js
+++ b/Source/Core/DoublyLinkedList.js
@@ -1,5 +1,4 @@
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
/**
* @private
@@ -10,7 +9,7 @@ import defineProperties from './defineProperties.js';
this._length = 0;
}
- defineProperties(DoublyLinkedList.prototype, {
+ Object.defineProperties(DoublyLinkedList.prototype, {
length : {
get : function() {
return this._length;
diff --git a/Source/Core/EarthOrientationParameters.js b/Source/Core/EarthOrientationParameters.js
index 60cadf4036a3..daae39b69f19 100644
--- a/Source/Core/EarthOrientationParameters.js
+++ b/Source/Core/EarthOrientationParameters.js
@@ -3,7 +3,6 @@ import binarySearch from './binarySearch.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import EarthOrientationParametersSample from './EarthOrientationParametersSample.js';
-import freezeObject from './freezeObject.js';
import JulianDate from './JulianDate.js';
import LeapSecond from './LeapSecond.js';
import Resource from './Resource.js';
@@ -99,7 +98,7 @@ import TimeStandard from './TimeStandard.js';
/**
* A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.
*/
- EarthOrientationParameters.NONE = freezeObject({
+ EarthOrientationParameters.NONE = Object.freeze({
getPromiseToLoad : function() {
return when();
},
diff --git a/Source/Core/EasingFunction.js b/Source/Core/EasingFunction.js
index 2747bd7f61cf..685ef7074aa8 100644
--- a/Source/Core/EasingFunction.js
+++ b/Source/Core/EasingFunction.js
@@ -1,5 +1,4 @@
import Tween from '../ThirdParty/Tween.js';
-import freezeObject from './freezeObject.js';
/**
* Easing functions for use with TweenCollection. These function are from
@@ -254,4 +253,4 @@ import freezeObject from './freezeObject.js';
* return time * (2.0 - time);
* }
*/
-export default freezeObject(EasingFunction);
+export default Object.freeze(EasingFunction);
diff --git a/Source/Core/EllipseGeometry.js b/Source/Core/EllipseGeometry.js
index 6414056bcf72..94580a26cbd7 100644
--- a/Source/Core/EllipseGeometry.js
+++ b/Source/Core/EllipseGeometry.js
@@ -7,7 +7,6 @@ import Check from './Check.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import EllipseGeometryLibrary from './EllipseGeometryLibrary.js';
import Ellipsoid from './Ellipsoid.js';
@@ -1046,7 +1045,7 @@ import VertexFormat from './VertexFormat.js';
return Geometry._textureCoordinateRotationPoints(positions, stRotation, ellipsoid, boundingRectangle);
}
- defineProperties(EllipseGeometry.prototype, {
+ Object.defineProperties(EllipseGeometry.prototype, {
/**
* @private
*/
diff --git a/Source/Core/Ellipsoid.js b/Source/Core/Ellipsoid.js
index 48918405e57e..c2a8b94e05be 100644
--- a/Source/Core/Ellipsoid.js
+++ b/Source/Core/Ellipsoid.js
@@ -3,9 +3,7 @@ import Cartographic from './Cartographic.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
@@ -83,7 +81,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
initialize(this, x, y, z);
}
- defineProperties(Ellipsoid.prototype, {
+ Object.defineProperties(Ellipsoid.prototype, {
/**
* Gets the radii of the ellipsoid.
* @memberof Ellipsoid.prototype
@@ -225,7 +223,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
* @type {Ellipsoid}
* @constant
*/
- Ellipsoid.WGS84 = freezeObject(new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793));
+ Ellipsoid.WGS84 = Object.freeze(new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793));
/**
* An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
@@ -233,7 +231,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
* @type {Ellipsoid}
* @constant
*/
- Ellipsoid.UNIT_SPHERE = freezeObject(new Ellipsoid(1.0, 1.0, 1.0));
+ Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));
/**
* An Ellipsoid instance initialized to a sphere with the lunar radius.
@@ -241,7 +239,7 @@ import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
* @type {Ellipsoid}
* @constant
*/
- Ellipsoid.MOON = freezeObject(new Ellipsoid(CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS));
+ Ellipsoid.MOON = Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS));
/**
* Duplicates an Ellipsoid instance.
diff --git a/Source/Core/EllipsoidGeodesic.js b/Source/Core/EllipsoidGeodesic.js
index 4ea5b62c829a..899297844e0b 100644
--- a/Source/Core/EllipsoidGeodesic.js
+++ b/Source/Core/EllipsoidGeodesic.js
@@ -3,7 +3,6 @@ import Cartographic from './Cartographic.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import CesiumMath from './Math.js';
@@ -208,7 +207,7 @@ import CesiumMath from './Math.js';
}
}
- defineProperties(EllipsoidGeodesic.prototype, {
+ Object.defineProperties(EllipsoidGeodesic.prototype, {
/**
* Gets the ellipsoid.
* @memberof EllipsoidGeodesic.prototype
diff --git a/Source/Core/EllipsoidRhumbLine.js b/Source/Core/EllipsoidRhumbLine.js
index 1fb62e1b776f..04ffa3e3838a 100644
--- a/Source/Core/EllipsoidRhumbLine.js
+++ b/Source/Core/EllipsoidRhumbLine.js
@@ -3,7 +3,6 @@ import Cartographic from './Cartographic.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import CesiumMath from './Math.js';
@@ -227,7 +226,7 @@ import CesiumMath from './Math.js';
}
}
- defineProperties(EllipsoidRhumbLine.prototype, {
+ Object.defineProperties(EllipsoidRhumbLine.prototype, {
/**
* Gets the ellipsoid.
* @memberof EllipsoidRhumbLine.prototype
diff --git a/Source/Core/EllipsoidTangentPlane.js b/Source/Core/EllipsoidTangentPlane.js
index 54a33f1886f0..1b0cfda8d6cd 100644
--- a/Source/Core/EllipsoidTangentPlane.js
+++ b/Source/Core/EllipsoidTangentPlane.js
@@ -5,7 +5,6 @@ import Cartesian4 from './Cartesian4.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import IntersectionTests from './IntersectionTests.js';
@@ -51,7 +50,7 @@ import Transforms from './Transforms.js';
this._plane = Plane.fromPointNormal(origin, normal);
}
- defineProperties(EllipsoidTangentPlane.prototype, {
+ Object.defineProperties(EllipsoidTangentPlane.prototype, {
/**
* Gets the ellipsoid.
* @memberof EllipsoidTangentPlane.prototype
diff --git a/Source/Core/EllipsoidTerrainProvider.js b/Source/Core/EllipsoidTerrainProvider.js
index fef1b4cfa455..bdbd1e7cfdd8 100644
--- a/Source/Core/EllipsoidTerrainProvider.js
+++ b/Source/Core/EllipsoidTerrainProvider.js
@@ -1,7 +1,6 @@
import when from '../ThirdParty/when.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import Event from './Event.js';
import GeographicTilingScheme from './GeographicTilingScheme.js';
@@ -43,7 +42,7 @@ import TerrainProvider from './TerrainProvider.js';
this._readyPromise = when.resolve(true);
}
- defineProperties(EllipsoidTerrainProvider.prototype, {
+ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
diff --git a/Source/Core/EllipsoidalOccluder.js b/Source/Core/EllipsoidalOccluder.js
index 590c812d07ca..84ba5897b044 100644
--- a/Source/Core/EllipsoidalOccluder.js
+++ b/Source/Core/EllipsoidalOccluder.js
@@ -3,7 +3,6 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import Rectangle from './Rectangle.js';
@@ -46,7 +45,7 @@ import Rectangle from './Rectangle.js';
}
}
- defineProperties(EllipsoidalOccluder.prototype, {
+ Object.defineProperties(EllipsoidalOccluder.prototype, {
/**
* Gets the occluding ellipsoid.
* @memberof EllipsoidalOccluder.prototype
diff --git a/Source/Core/Event.js b/Source/Core/Event.js
index 87660a4417a2..47e07552958d 100644
--- a/Source/Core/Event.js
+++ b/Source/Core/Event.js
@@ -1,6 +1,5 @@
import Check from './Check.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
/**
* A generic utility class for managing subscribers for a particular event.
@@ -28,7 +27,7 @@ import defineProperties from './defineProperties.js';
this._insideRaiseEvent = false;
}
- defineProperties(Event.prototype, {
+ Object.defineProperties(Event.prototype, {
/**
* The number of listeners currently subscribed to the event.
* @memberof Event.prototype
diff --git a/Source/Core/ExtrapolationType.js b/Source/Core/ExtrapolationType.js
index 1dd05abb2a5c..40f40c6632ad 100644
--- a/Source/Core/ExtrapolationType.js
+++ b/Source/Core/ExtrapolationType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Constants to determine how an interpolated value is extrapolated
@@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js';
*/
EXTRAPOLATE : 2
};
-export default freezeObject(ExtrapolationType);
+export default Object.freeze(ExtrapolationType);
diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js
index 142e4dcf8763..0b6d6eeeab49 100644
--- a/Source/Core/FeatureDetection.js
+++ b/Source/Core/FeatureDetection.js
@@ -1,7 +1,6 @@
import when from '../ThirdParty/when.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Fullscreen from './Fullscreen.js';
/*global CanvasPixelArray*/
@@ -168,7 +167,7 @@ import Fullscreen from './Fullscreen.js';
//that rely on it, such as the Windows WebBrowser control which defines
//PointerEvent but sets navigator.pointerEnabled to false.
- //Firefox disabled because of https://github.com/AnalyticalGraphicsInc/cesium/issues/6372
+ //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372
hasPointerEvents = !isFirefox() && typeof PointerEvent !== 'undefined' && (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);
}
return hasPointerEvents;
@@ -237,7 +236,7 @@ import Fullscreen from './Fullscreen.js';
return supportsWebPDeferred.promise;
};
- defineProperties(supportsWebP, {
+ Object.defineProperties(supportsWebP, {
initialized: {
get: function() {
return defined(supportsWebP._result);
diff --git a/Source/Core/Fullscreen.js b/Source/Core/Fullscreen.js
index ba85ec0ee8cb..8e73a22c4d79 100644
--- a/Source/Core/Fullscreen.js
+++ b/Source/Core/Fullscreen.js
@@ -1,5 +1,4 @@
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
var _supportsFullscreen;
var _names = {
@@ -21,7 +20,7 @@ import defineProperties from './defineProperties.js';
*/
var Fullscreen = {};
- defineProperties(Fullscreen, {
+ Object.defineProperties(Fullscreen, {
/**
* The element that is currently fullscreen, if any. To simply check if the
* browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
diff --git a/Source/Core/GeocodeType.js b/Source/Core/GeocodeType.js
index a56053c198ad..0e251cc01a53 100644
--- a/Source/Core/GeocodeType.js
+++ b/Source/Core/GeocodeType.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The type of geocoding to be performed by a {@link GeocoderService}.
@@ -23,4 +22,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
AUTOCOMPLETE: 1
};
-export default freezeObject(GeocodeType);
+export default Object.freeze(GeocodeType);
diff --git a/Source/Core/GeographicProjection.js b/Source/Core/GeographicProjection.js
index 19a7d42cc3a8..6e4d64f5b9a3 100644
--- a/Source/Core/GeographicProjection.js
+++ b/Source/Core/GeographicProjection.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Cartographic from './Cartographic.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
@@ -25,7 +24,7 @@ import Ellipsoid from './Ellipsoid.js';
this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;
}
- defineProperties(GeographicProjection.prototype, {
+ Object.defineProperties(GeographicProjection.prototype, {
/**
* Gets the {@link Ellipsoid}.
*
diff --git a/Source/Core/GeographicTilingScheme.js b/Source/Core/GeographicTilingScheme.js
index 657ecd0153c5..3282c6177349 100644
--- a/Source/Core/GeographicTilingScheme.js
+++ b/Source/Core/GeographicTilingScheme.js
@@ -2,7 +2,6 @@ import Cartesian2 from './Cartesian2.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import GeographicProjection from './GeographicProjection.js';
import CesiumMath from './Math.js';
@@ -35,7 +34,7 @@ import Rectangle from './Rectangle.js';
this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 1);
}
- defineProperties(GeographicTilingScheme.prototype, {
+ Object.defineProperties(GeographicTilingScheme.prototype, {
/**
* Gets the ellipsoid that is tiled by this tiling scheme.
* @memberof GeographicTilingScheme.prototype
diff --git a/Source/Core/GeometryOffsetAttribute.js b/Source/Core/GeometryOffsetAttribute.js
index b585a118724b..b42ce92da6b4 100644
--- a/Source/Core/GeometryOffsetAttribute.js
+++ b/Source/Core/GeometryOffsetAttribute.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* Represents which vertices should have a value of `true` for the `applyOffset` attribute
@@ -9,4 +8,4 @@ import freezeObject from '../Core/freezeObject.js';
TOP : 1,
ALL : 2
};
-export default freezeObject(GeometryOffsetAttribute);
+export default Object.freeze(GeometryOffsetAttribute);
diff --git a/Source/Core/GeometryType.js b/Source/Core/GeometryType.js
index 41dd1b1bd962..f001a554ec7a 100644
--- a/Source/Core/GeometryType.js
+++ b/Source/Core/GeometryType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* @private
@@ -9,4 +8,4 @@ import freezeObject from './freezeObject.js';
LINES : 2,
POLYLINES : 3
};
-export default freezeObject(GeometryType);
+export default Object.freeze(GeometryType);
diff --git a/Source/Core/GoogleEarthEnterpriseMetadata.js b/Source/Core/GoogleEarthEnterpriseMetadata.js
index f7802eab9b7c..88c57fa624f2 100644
--- a/Source/Core/GoogleEarthEnterpriseMetadata.js
+++ b/Source/Core/GoogleEarthEnterpriseMetadata.js
@@ -5,7 +5,6 @@ import Check from './Check.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import GoogleEarthEnterpriseTileInformation from './GoogleEarthEnterpriseTileInformation.js';
import isBitSet from './isBitSet.js';
import loadAndExecuteScript from './loadAndExecuteScript.js';
@@ -128,7 +127,7 @@ import TaskProcessor from './TaskProcessor.js';
});
}
- defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
+ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
/**
* Gets the name of the Google Earth Enterprise server.
* @memberof GoogleEarthEnterpriseMetadata.prototype
diff --git a/Source/Core/GoogleEarthEnterpriseTerrainData.js b/Source/Core/GoogleEarthEnterpriseTerrainData.js
index d1418b26ce2f..9b9b865894aa 100644
--- a/Source/Core/GoogleEarthEnterpriseTerrainData.js
+++ b/Source/Core/GoogleEarthEnterpriseTerrainData.js
@@ -4,7 +4,6 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import IndexDatatype from './IndexDatatype.js';
import Intersections2D from './Intersections2D.js';
@@ -86,7 +85,7 @@ import TerrainMesh from './TerrainMesh.js';
this._maximumHeight = undefined;
}
- defineProperties(GoogleEarthEnterpriseTerrainData.prototype, {
+ Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, {
/**
* An array of credits for this tile
* @memberof GoogleEarthEnterpriseTerrainData.prototype
diff --git a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js
index 273c30f3e9ca..db2b011f7623 100644
--- a/Source/Core/GoogleEarthEnterpriseTerrainProvider.js
+++ b/Source/Core/GoogleEarthEnterpriseTerrainProvider.js
@@ -2,7 +2,6 @@ import when from '../ThirdParty/when.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Event from './Event.js';
import GeographicTilingScheme from './GeographicTilingScheme.js';
@@ -152,7 +151,7 @@ import TileProviderError from './TileProviderError.js';
});
}
- defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
+ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
/**
* Gets the name of the Google Earth Enterprise server url hosting the imagery.
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js
index 22fb8f6c7cce..8fad73bce20f 100644
--- a/Source/Core/GroundPolylineGeometry.js
+++ b/Source/Core/GroundPolylineGeometry.js
@@ -8,7 +8,6 @@ import Check from './Check.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import EllipsoidGeodesic from './EllipsoidGeodesic.js';
@@ -126,7 +125,7 @@ import WebMercatorProjection from './WebMercatorProjection.js';
this._scene3DOnly = false;
}
- defineProperties(GroundPolylineGeometry.prototype, {
+ Object.defineProperties(GroundPolylineGeometry.prototype, {
/**
* The number of elements used to pack the object into an array.
* @memberof GroundPolylineGeometry.prototype
diff --git a/Source/Core/Heap.js b/Source/Core/Heap.js
index ed181a03936c..0682f132a44a 100644
--- a/Source/Core/Heap.js
+++ b/Source/Core/Heap.js
@@ -1,7 +1,6 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
/**
* Array implementation of a heap.
@@ -25,7 +24,7 @@ import defineProperties from './defineProperties.js';
this._maximumLength = undefined;
}
- defineProperties(Heap.prototype, {
+ Object.defineProperties(Heap.prototype, {
/**
* Gets the length of the heap.
*
diff --git a/Source/Core/HeightmapEncoding.js b/Source/Core/HeightmapEncoding.js
index 37f77ff14977..5e64cd476a8b 100644
--- a/Source/Core/HeightmapEncoding.js
+++ b/Source/Core/HeightmapEncoding.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* The encoding that is used for a heightmap
@@ -24,4 +23,4 @@ import freezeObject from './freezeObject.js';
*/
LERC: 1
};
-export default freezeObject(HeightmapEncoding);
+export default Object.freeze(HeightmapEncoding);
diff --git a/Source/Core/HeightmapTerrainData.js b/Source/Core/HeightmapTerrainData.js
index 608f37872c4e..1c3e5dc5c261 100644
--- a/Source/Core/HeightmapTerrainData.js
+++ b/Source/Core/HeightmapTerrainData.js
@@ -3,7 +3,6 @@ import BoundingSphere from './BoundingSphere.js';
import Cartesian3 from './Cartesian3.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import GeographicProjection from './GeographicProjection.js';
import HeightmapEncoding from './HeightmapEncoding.js';
@@ -134,7 +133,7 @@ import TerrainProvider from './TerrainProvider.js';
this._mesh = undefined;
}
- defineProperties(HeightmapTerrainData.prototype, {
+ Object.defineProperties(HeightmapTerrainData.prototype, {
/**
* An array of credits for this tile.
* @memberof HeightmapTerrainData.prototype
diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js
index 7bcdc623a7cd..043f64e44ce0 100644
--- a/Source/Core/HeightmapTessellator.js
+++ b/Source/Core/HeightmapTessellator.js
@@ -7,7 +7,6 @@ import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import EllipsoidalOccluder from './EllipsoidalOccluder.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import Matrix4 from './Matrix4.js';
import OrientedBoundingBox from './OrientedBoundingBox.js';
@@ -30,7 +29,7 @@ import WebMercatorProjection from './WebMercatorProjection.js';
*
* @constant
*/
- HeightmapTessellator.DEFAULT_STRUCTURE = freezeObject({
+ HeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({
heightScale : 1.0,
heightOffset : 0.0,
elementsPerHeight : 1,
diff --git a/Source/Core/HermiteSpline.js b/Source/Core/HermiteSpline.js
index a5f00e25d008..746a13620aaa 100644
--- a/Source/Core/HermiteSpline.js
+++ b/Source/Core/HermiteSpline.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Cartesian4 from './Cartesian4.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import LinearSpline from './LinearSpline.js';
import Matrix4 from './Matrix4.js';
@@ -196,7 +195,7 @@ import TridiagonalSystemSolver from './TridiagonalSystemSolver.js';
this._lastTimeIndex = 0;
}
- defineProperties(HermiteSpline.prototype, {
+ Object.defineProperties(HermiteSpline.prototype, {
/**
* An array of times for the control points.
*
diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js
index 8aee42784101..21fbf6d3a087 100644
--- a/Source/Core/IndexDatatype.js
+++ b/Source/Core/IndexDatatype.js
@@ -1,6 +1,5 @@
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import WebGLConstants from './WebGLConstants.js';
@@ -158,4 +157,4 @@ import WebGLConstants from './WebGLConstants.js';
return new Uint16Array(sourceArray, byteOffset, length);
};
-export default freezeObject(IndexDatatype);
+export default Object.freeze(IndexDatatype);
diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js
index a5b82e4970d4..89eda3504ee1 100644
--- a/Source/Core/Intersect.js
+++ b/Source/Core/Intersect.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* This enumerated type is used in determining where, relative to the frustum, an
@@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js';
*/
INSIDE : 1
};
-export default freezeObject(Intersect);
+export default Object.freeze(Intersect);
diff --git a/Source/Core/Ion.js b/Source/Core/Ion.js
index 5a5a832cdd73..db5b785d6aea 100644
--- a/Source/Core/Ion.js
+++ b/Source/Core/Ion.js
@@ -3,7 +3,7 @@ import defined from './defined.js';
import Resource from './Resource.js';
var defaultTokenCredit;
- var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYmFmMDZjZi03ZTIzLTRmNDYtYmM4MS1hZmUyOTNlZWQ4N2MiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgwNzQ2MDQzfQ.I05JcRTUCUA1RWX2y0oQa_p4dFV6tgaAKHrCU5AjlgI';
+ var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmRiYzgzMy1hODQ3LTRkMDktYjE0Ni0zNTViMTdmNGEyZWEiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgzMTYzMTYwfQ.blu_ATsUNqSYK0fIBrNRvxq9HiCzY5Ul_4v_4-3F5QY';
/**
* Default settings for accessing the Cesium ion API.
diff --git a/Source/Core/IonResource.js b/Source/Core/IonResource.js
index 8d802cad8ee8..eea166480cf8 100644
--- a/Source/Core/IonResource.js
+++ b/Source/Core/IonResource.js
@@ -4,7 +4,6 @@ import Check from './Check.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ion from './Ion.js';
import Resource from './Resource.js';
import RuntimeError from './RuntimeError.js';
@@ -101,7 +100,7 @@ import RuntimeError from './RuntimeError.js';
});
};
- defineProperties(IonResource.prototype, {
+ Object.defineProperties(IonResource.prototype, {
/**
* Gets the credits required for attribution of the asset.
*
diff --git a/Source/Core/Iso8601.js b/Source/Core/Iso8601.js
index ee5b0b8e1faf..9d0ca91cf63d 100644
--- a/Source/Core/Iso8601.js
+++ b/Source/Core/Iso8601.js
@@ -1,10 +1,9 @@
-import freezeObject from './freezeObject.js';
import JulianDate from './JulianDate.js';
import TimeInterval from './TimeInterval.js';
- var MINIMUM_VALUE = freezeObject(JulianDate.fromIso8601('0000-01-01T00:00:00Z'));
- var MAXIMUM_VALUE = freezeObject(JulianDate.fromIso8601('9999-12-31T24:00:00Z'));
- var MAXIMUM_INTERVAL = freezeObject(new TimeInterval({
+ var MINIMUM_VALUE = Object.freeze(JulianDate.fromIso8601('0000-01-01T00:00:00Z'));
+ var MAXIMUM_VALUE = Object.freeze(JulianDate.fromIso8601('9999-12-31T24:00:00Z'));
+ var MAXIMUM_INTERVAL = Object.freeze(new TimeInterval({
start : MINIMUM_VALUE,
stop : MAXIMUM_VALUE
}));
diff --git a/Source/Core/KeyboardEventModifier.js b/Source/Core/KeyboardEventModifier.js
index dd26f08c3641..5992e4f75b5c 100644
--- a/Source/Core/KeyboardEventModifier.js
+++ b/Source/Core/KeyboardEventModifier.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* This enumerated type is for representing keyboard modifiers. These are keys
@@ -31,4 +30,4 @@ import freezeObject from './freezeObject.js';
*/
ALT : 2
};
-export default freezeObject(KeyboardEventModifier);
+export default Object.freeze(KeyboardEventModifier);
diff --git a/Source/Core/LinearSpline.js b/Source/Core/LinearSpline.js
index 0ac9ab9cfa3f..b2e3a2aa96e3 100644
--- a/Source/Core/LinearSpline.js
+++ b/Source/Core/LinearSpline.js
@@ -1,7 +1,6 @@
import Cartesian3 from './Cartesian3.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Spline from './Spline.js';
@@ -64,7 +63,7 @@ import Spline from './Spline.js';
this._lastTimeIndex = 0;
}
- defineProperties(LinearSpline.prototype, {
+ Object.defineProperties(LinearSpline.prototype, {
/**
* An array of times for the control points.
*
diff --git a/Source/Core/ManagedArray.js b/Source/Core/ManagedArray.js
index 65d151602a37..f45a5f1a472d 100644
--- a/Source/Core/ManagedArray.js
+++ b/Source/Core/ManagedArray.js
@@ -1,6 +1,5 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
-import defineProperties from './defineProperties.js';
/**
* A wrapper around arrays so that the internal length of the array can be manually managed.
@@ -17,7 +16,7 @@ import defineProperties from './defineProperties.js';
this._length = length;
}
- defineProperties(ManagedArray.prototype, {
+ Object.defineProperties(ManagedArray.prototype, {
/**
* Gets or sets the length of the array.
* If the set length is greater than the length of the internal array, the internal array is resized.
diff --git a/Source/Core/MapProjection.js b/Source/Core/MapProjection.js
index 9f4a1489f5a3..6daae86147c5 100644
--- a/Source/Core/MapProjection.js
+++ b/Source/Core/MapProjection.js
@@ -1,4 +1,3 @@
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -15,7 +14,7 @@ import DeveloperError from './DeveloperError.js';
DeveloperError.throwInstantiationError();
}
- defineProperties(MapProjection.prototype, {
+ Object.defineProperties(MapProjection.prototype, {
/**
* Gets the {@link Ellipsoid}.
*
diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js
index f6679a79cfff..d9bc7f92353a 100644
--- a/Source/Core/Matrix2.js
+++ b/Source/Core/Matrix2.js
@@ -2,8 +2,6 @@ import Cartesian2 from './Cartesian2.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import freezeObject from './freezeObject.js';
/**
* A 2x2 matrix, indexable as a column-major order array.
@@ -750,7 +748,7 @@ import freezeObject from './freezeObject.js';
* @type {Matrix2}
* @constant
*/
- Matrix2.IDENTITY = freezeObject(new Matrix2(1.0, 0.0,
+ Matrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0,
0.0, 1.0));
/**
@@ -759,7 +757,7 @@ import freezeObject from './freezeObject.js';
* @type {Matrix2}
* @constant
*/
- Matrix2.ZERO = freezeObject(new Matrix2(0.0, 0.0,
+ Matrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0,
0.0, 0.0));
/**
@@ -810,7 +808,7 @@ import freezeObject from './freezeObject.js';
*/
Matrix2.COLUMN1ROW1 = 3;
- defineProperties(Matrix2.prototype, {
+ Object.defineProperties(Matrix2.prototype, {
/**
* Gets the number of items in the collection.
* @memberof Matrix2.prototype
diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js
index 743da429dc7c..996b7222c8fa 100644
--- a/Source/Core/Matrix3.js
+++ b/Source/Core/Matrix3.js
@@ -2,9 +2,7 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
/**
@@ -1342,7 +1340,7 @@ import CesiumMath from './Math.js';
* @type {Matrix3}
* @constant
*/
- Matrix3.IDENTITY = freezeObject(new Matrix3(1.0, 0.0, 0.0,
+ Matrix3.IDENTITY = Object.freeze(new Matrix3(1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0));
@@ -1352,7 +1350,7 @@ import CesiumMath from './Math.js';
* @type {Matrix3}
* @constant
*/
- Matrix3.ZERO = freezeObject(new Matrix3(0.0, 0.0, 0.0,
+ Matrix3.ZERO = Object.freeze(new Matrix3(0.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0));
@@ -1428,7 +1426,7 @@ import CesiumMath from './Math.js';
*/
Matrix3.COLUMN2ROW2 = 8;
- defineProperties(Matrix3.prototype, {
+ Object.defineProperties(Matrix3.prototype, {
/**
* Gets the number of items in the collection.
* @memberof Matrix3.prototype
diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js
index 3d2eeaea1a51..8c497050e40d 100644
--- a/Source/Core/Matrix4.js
+++ b/Source/Core/Matrix4.js
@@ -3,8 +3,6 @@ import Cartesian4 from './Cartesian4.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import Matrix3 from './Matrix3.js';
import RuntimeError from './RuntimeError.js';
@@ -2388,7 +2386,7 @@ import RuntimeError from './RuntimeError.js';
* @type {Matrix4}
* @constant
*/
- Matrix4.IDENTITY = freezeObject(new Matrix4(1.0, 0.0, 0.0, 0.0,
+ Matrix4.IDENTITY = Object.freeze(new Matrix4(1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0));
@@ -2399,7 +2397,7 @@ import RuntimeError from './RuntimeError.js';
* @type {Matrix4}
* @constant
*/
- Matrix4.ZERO = freezeObject(new Matrix4(0.0, 0.0, 0.0, 0.0,
+ Matrix4.ZERO = Object.freeze(new Matrix4(0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0));
@@ -2532,7 +2530,7 @@ import RuntimeError from './RuntimeError.js';
*/
Matrix4.COLUMN3ROW3 = 15;
- defineProperties(Matrix4.prototype, {
+ Object.defineProperties(Matrix4.prototype, {
/**
* Gets the number of items in the collection.
* @memberof Matrix4.prototype
diff --git a/Source/Core/Occluder.js b/Source/Core/Occluder.js
index 0041ad6261f9..b690797c186b 100644
--- a/Source/Core/Occluder.js
+++ b/Source/Core/Occluder.js
@@ -2,7 +2,6 @@ import BoundingSphere from './BoundingSphere.js';
import Cartesian3 from './Cartesian3.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import CesiumMath from './Math.js';
@@ -51,7 +50,7 @@ import Visibility from './Visibility.js';
var scratchCartesian3 = new Cartesian3();
- defineProperties(Occluder.prototype, {
+ Object.defineProperties(Occluder.prototype, {
/**
* The position of the occluder.
* @memberof Occluder.prototype
diff --git a/Source/Core/OffsetGeometryInstanceAttribute.js b/Source/Core/OffsetGeometryInstanceAttribute.js
index 7e1d8ec55896..e6f8cfd09f98 100644
--- a/Source/Core/OffsetGeometryInstanceAttribute.js
+++ b/Source/Core/OffsetGeometryInstanceAttribute.js
@@ -2,7 +2,6 @@ import Check from './Check.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
/**
* Value and type information for per-instance geometry attribute that determines the geometry instance offset
@@ -32,7 +31,7 @@ import defineProperties from './defineProperties.js';
this.value = new Float32Array([x, y, z]);
}
- defineProperties(OffsetGeometryInstanceAttribute.prototype, {
+ Object.defineProperties(OffsetGeometryInstanceAttribute.prototype, {
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link OffsetGeometryInstanceAttribute#value}.
diff --git a/Source/Core/OpenCageGeocoderService.js b/Source/Core/OpenCageGeocoderService.js
index 4b00c7c73fb2..88dab9add823 100644
--- a/Source/Core/OpenCageGeocoderService.js
+++ b/Source/Core/OpenCageGeocoderService.js
@@ -3,7 +3,6 @@ import Check from './Check.js';
import combine from './combine.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Rectangle from './Rectangle.js';
import Resource from './Resource.js';
@@ -51,7 +50,7 @@ import Resource from './Resource.js';
this._params = defaultValue(params, {});
}
- defineProperties(OpenCageGeocoderService.prototype, {
+ Object.defineProperties(OpenCageGeocoderService.prototype, {
/**
* The Resource used to access the OpenCage endpoint.
* @type {Resource}
diff --git a/Source/Core/OrthographicFrustum.js b/Source/Core/OrthographicFrustum.js
index 9fa793ea3dcd..19932800130f 100644
--- a/Source/Core/OrthographicFrustum.js
+++ b/Source/Core/OrthographicFrustum.js
@@ -1,7 +1,6 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import CesiumMath from './Math.js';
import OrthographicOffCenterFrustum from './OrthographicOffCenterFrustum.js';
@@ -160,7 +159,7 @@ import OrthographicOffCenterFrustum from './OrthographicOffCenterFrustum.js';
}
}
- defineProperties(OrthographicFrustum.prototype, {
+ Object.defineProperties(OrthographicFrustum.prototype, {
/**
* Gets the orthographic projection matrix computed from the view frustum.
* @memberof OrthographicFrustum.prototype
diff --git a/Source/Core/OrthographicOffCenterFrustum.js b/Source/Core/OrthographicOffCenterFrustum.js
index 6ca8971b60a6..e1a9a821bf9a 100644
--- a/Source/Core/OrthographicOffCenterFrustum.js
+++ b/Source/Core/OrthographicOffCenterFrustum.js
@@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js';
import CullingVolume from './CullingVolume.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import CesiumMath from './Math.js';
import Matrix4 from './Matrix4.js';
@@ -126,7 +125,7 @@ import Matrix4 from './Matrix4.js';
}
}
- defineProperties(OrthographicOffCenterFrustum.prototype, {
+ Object.defineProperties(OrthographicOffCenterFrustum.prototype, {
/**
* Gets the orthographic projection matrix computed from the view frustum.
* @memberof OrthographicOffCenterFrustum.prototype
diff --git a/Source/Core/PeliasGeocoderService.js b/Source/Core/PeliasGeocoderService.js
index 951a4c77dde9..26db199fe194 100644
--- a/Source/Core/PeliasGeocoderService.js
+++ b/Source/Core/PeliasGeocoderService.js
@@ -1,7 +1,6 @@
import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import GeocodeType from './GeocodeType.js';
import Rectangle from './Rectangle.js';
import Resource from './Resource.js';
@@ -33,7 +32,7 @@ import Resource from './Resource.js';
this._url.appendForwardSlash();
}
- defineProperties(PeliasGeocoderService.prototype, {
+ Object.defineProperties(PeliasGeocoderService.prototype, {
/**
* The Resource used to access the Pelias endpoint.
* @type {Resource}
diff --git a/Source/Core/PerspectiveFrustum.js b/Source/Core/PerspectiveFrustum.js
index 64dd216bb5dd..e8bd3aca74dc 100644
--- a/Source/Core/PerspectiveFrustum.js
+++ b/Source/Core/PerspectiveFrustum.js
@@ -1,7 +1,6 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import CesiumMath from './Math.js';
import PerspectiveOffCenterFrustum from './PerspectiveOffCenterFrustum.js';
@@ -203,7 +202,7 @@ import PerspectiveOffCenterFrustum from './PerspectiveOffCenterFrustum.js';
}
}
- defineProperties(PerspectiveFrustum.prototype, {
+ Object.defineProperties(PerspectiveFrustum.prototype, {
/**
* Gets the perspective projection matrix computed from the view frustum.
* @memberof PerspectiveFrustum.prototype
diff --git a/Source/Core/PerspectiveOffCenterFrustum.js b/Source/Core/PerspectiveOffCenterFrustum.js
index 19d2cf37e47f..176ac3ce0104 100644
--- a/Source/Core/PerspectiveOffCenterFrustum.js
+++ b/Source/Core/PerspectiveOffCenterFrustum.js
@@ -3,7 +3,6 @@ import Cartesian4 from './Cartesian4.js';
import CullingVolume from './CullingVolume.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import CesiumMath from './Math.js';
import Matrix4 from './Matrix4.js';
@@ -130,7 +129,7 @@ import Matrix4 from './Matrix4.js';
}
}
- defineProperties(PerspectiveOffCenterFrustum.prototype, {
+ Object.defineProperties(PerspectiveOffCenterFrustum.prototype, {
/**
* Gets the perspective projection matrix computed from the view frustum.
* @memberof PerspectiveOffCenterFrustum.prototype
diff --git a/Source/Core/PixelFormat.js b/Source/Core/PixelFormat.js
index 3d9c1f94cdef..a1f99b88ca87 100644
--- a/Source/Core/PixelFormat.js
+++ b/Source/Core/PixelFormat.js
@@ -1,5 +1,4 @@
import PixelDatatype from '../Renderer/PixelDatatype.js';
-import freezeObject from './freezeObject.js';
import WebGLConstants from './WebGLConstants.js';
/**
@@ -324,4 +323,4 @@ import WebGLConstants from './WebGLConstants.js';
return flipped;
}
};
-export default freezeObject(PixelFormat);
+export default Object.freeze(PixelFormat);
diff --git a/Source/Core/Plane.js b/Source/Core/Plane.js
index 3304a9aed5bc..40a69873e670 100644
--- a/Source/Core/Plane.js
+++ b/Source/Core/Plane.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Check from './Check.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import Matrix4 from './Matrix4.js';
@@ -240,7 +239,7 @@ import Matrix4 from './Matrix4.js';
* @type {Plane}
* @constant
*/
- Plane.ORIGIN_XY_PLANE = freezeObject(new Plane(Cartesian3.UNIT_Z, 0.0));
+ Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Z, 0.0));
/**
* A constant initialized to the YZ plane passing through the origin, with normal in positive X.
@@ -248,7 +247,7 @@ import Matrix4 from './Matrix4.js';
* @type {Plane}
* @constant
*/
- Plane.ORIGIN_YZ_PLANE = freezeObject(new Plane(Cartesian3.UNIT_X, 0.0));
+ Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_X, 0.0));
/**
* A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
@@ -256,5 +255,5 @@ import Matrix4 from './Matrix4.js';
* @type {Plane}
* @constant
*/
- Plane.ORIGIN_ZX_PLANE = freezeObject(new Plane(Cartesian3.UNIT_Y, 0.0));
+ Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Y, 0.0));
export default Plane;
diff --git a/Source/Core/PolygonGeometry.js b/Source/Core/PolygonGeometry.js
index 9979b582095e..62d0a7a836c3 100644
--- a/Source/Core/PolygonGeometry.js
+++ b/Source/Core/PolygonGeometry.js
@@ -9,7 +9,6 @@ import Check from './Check.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import EllipsoidGeodesic from './EllipsoidGeodesic.js';
@@ -1049,7 +1048,7 @@ import WindingOrder from './WindingOrder.js';
return Geometry._textureCoordinateRotationPoints(positions, stRotation, ellipsoid, boundingRectangle);
}
- defineProperties(PolygonGeometry.prototype, {
+ Object.defineProperties(PolygonGeometry.prototype, {
/**
* @private
*/
diff --git a/Source/Core/PolylinePipeline.js b/Source/Core/PolylinePipeline.js
index ab1a1aadd30b..3f6aac973ddb 100644
--- a/Source/Core/PolylinePipeline.js
+++ b/Source/Core/PolylinePipeline.js
@@ -7,7 +7,6 @@ import Ellipsoid from './Ellipsoid.js';
import EllipsoidGeodesic from './EllipsoidGeodesic.js';
import EllipsoidRhumbLine from './EllipsoidRhumbLine.js';
import IntersectionTests from './IntersectionTests.js';
-import isArray from './isArray.js';
import CesiumMath from './Math.js';
import Matrix4 from './Matrix4.js';
import Plane from './Plane.js';
@@ -260,7 +259,7 @@ import Plane from './Plane.js';
var length = positions.length;
var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
var height = defaultValue(options.height, 0);
- var hasHeightArray = isArray(height);
+ var hasHeightArray = Array.isArray(height);
if (length < 1) {
return [];
@@ -351,7 +350,7 @@ import Plane from './Plane.js';
var length = positions.length;
var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
var height = defaultValue(options.height, 0);
- var hasHeightArray = isArray(height);
+ var hasHeightArray = Array.isArray(height);
if (length < 1) {
return [];
diff --git a/Source/Core/PolylineVolumeGeometry.js b/Source/Core/PolylineVolumeGeometry.js
index 7c57caabbaa1..7a63ba7ce9cb 100644
--- a/Source/Core/PolylineVolumeGeometry.js
+++ b/Source/Core/PolylineVolumeGeometry.js
@@ -142,7 +142,7 @@ import WindingOrder from './WindingOrder.js';
geometry = GeometryPipeline.computeTangentAndBitangent(geometry);
} catch (e) {
oneTimeWarning('polyline-volume-tangent-bitangent', 'Unable to compute tangents and bitangents for polyline volume geometry');
- //TODO https://github.com/AnalyticalGraphicsInc/cesium/issues/3609
+ //TODO https://github.com/CesiumGS/cesium/issues/3609
}
if (!vertexFormat.tangent) {
diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js
index 899f3282b655..96e680e55ea9 100644
--- a/Source/Core/PrimitiveType.js
+++ b/Source/Core/PrimitiveType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
import WebGLConstants from './WebGLConstants.js';
/**
@@ -80,4 +79,4 @@ import WebGLConstants from './WebGLConstants.js';
primitiveType === PrimitiveType.TRIANGLE_FAN;
}
};
-export default freezeObject(PrimitiveType);
+export default Object.freeze(PrimitiveType);
diff --git a/Source/Core/QuantizedMeshTerrainData.js b/Source/Core/QuantizedMeshTerrainData.js
index 5cae490b0664..988fb96a6a72 100644
--- a/Source/Core/QuantizedMeshTerrainData.js
+++ b/Source/Core/QuantizedMeshTerrainData.js
@@ -4,7 +4,6 @@ import Cartesian2 from './Cartesian2.js';
import Cartesian3 from './Cartesian3.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import IndexDatatype from './IndexDatatype.js';
import Intersections2D from './Intersections2D.js';
@@ -182,7 +181,7 @@ import TerrainMesh from './TerrainMesh.js';
this._mesh = undefined;
}
- defineProperties(QuantizedMeshTerrainData.prototype, {
+ Object.defineProperties(QuantizedMeshTerrainData.prototype, {
/**
* An array of credits for this tile.
* @memberof QuantizedMeshTerrainData.prototype
diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js
index 7297fa322d57..0639c163958b 100644
--- a/Source/Core/Quaternion.js
+++ b/Source/Core/Quaternion.js
@@ -3,7 +3,6 @@ import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import FeatureDetection from './FeatureDetection.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
import Matrix3 from './Matrix3.js';
@@ -967,7 +966,7 @@ import Matrix3 from './Matrix3.js';
* @type {Quaternion}
* @constant
*/
- Quaternion.ZERO = freezeObject(new Quaternion(0.0, 0.0, 0.0, 0.0));
+ Quaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));
/**
* An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
@@ -975,7 +974,7 @@ import Matrix3 from './Matrix3.js';
* @type {Quaternion}
* @constant
*/
- Quaternion.IDENTITY = freezeObject(new Quaternion(0.0, 0.0, 0.0, 1.0));
+ Quaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));
/**
* Duplicates this Quaternion instance.
diff --git a/Source/Core/QuaternionSpline.js b/Source/Core/QuaternionSpline.js
index 19fbd5bb23a3..afc7f5fd94a7 100644
--- a/Source/Core/QuaternionSpline.js
+++ b/Source/Core/QuaternionSpline.js
@@ -1,6 +1,5 @@
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Quaternion from './Quaternion.js';
import Spline from './Spline.js';
@@ -69,7 +68,7 @@ import Spline from './Spline.js';
this._lastTimeIndex = 0;
}
- defineProperties(QuaternionSpline.prototype, {
+ Object.defineProperties(QuaternionSpline.prototype, {
/**
* An array of times for the control points.
*
diff --git a/Source/Core/Queue.js b/Source/Core/Queue.js
index 6c27bd2572aa..cc6c7f30439e 100644
--- a/Source/Core/Queue.js
+++ b/Source/Core/Queue.js
@@ -1,4 +1,3 @@
-import defineProperties from './defineProperties.js';
/**
* A queue that can enqueue items at the end, and dequeue items from the front.
@@ -12,7 +11,7 @@ import defineProperties from './defineProperties.js';
this._length = 0;
}
- defineProperties(Queue.prototype, {
+ Object.defineProperties(Queue.prototype, {
/**
* The length of the queue.
*
diff --git a/Source/Core/Rectangle.js b/Source/Core/Rectangle.js
index 6bd3ba7ad638..346bcc004647 100644
--- a/Source/Core/Rectangle.js
+++ b/Source/Core/Rectangle.js
@@ -2,9 +2,7 @@ import Cartographic from './Cartographic.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
-import freezeObject from './freezeObject.js';
import CesiumMath from './Math.js';
/**
@@ -54,7 +52,7 @@ import CesiumMath from './Math.js';
this.north = defaultValue(north, 0.0);
}
- defineProperties(Rectangle.prototype, {
+ Object.defineProperties(Rectangle.prototype, {
/**
* Gets the width of the rectangle in radians.
* @memberof Rectangle.prototype
@@ -867,5 +865,5 @@ import CesiumMath from './Math.js';
* @type {Rectangle}
* @constant
*/
- Rectangle.MAX_VALUE = freezeObject(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO));
+ Rectangle.MAX_VALUE = Object.freeze(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO));
export default Rectangle;
diff --git a/Source/Core/RectangleGeometry.js b/Source/Core/RectangleGeometry.js
index c6dc0f1fac07..a4da85203282 100644
--- a/Source/Core/RectangleGeometry.js
+++ b/Source/Core/RectangleGeometry.js
@@ -7,7 +7,6 @@ import Check from './Check.js';
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import Geometry from './Geometry.js';
@@ -1169,7 +1168,7 @@ import VertexFormat from './VertexFormat.js';
return result;
}
- defineProperties(RectangleGeometry.prototype, {
+ Object.defineProperties(RectangleGeometry.prototype, {
/**
* @private
*/
diff --git a/Source/Core/ReferenceFrame.js b/Source/Core/ReferenceFrame.js
index a7c37b79cd55..70eb4fcfd7cf 100644
--- a/Source/Core/ReferenceFrame.js
+++ b/Source/Core/ReferenceFrame.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Constants for identifying well-known reference frames.
@@ -22,4 +21,4 @@ import freezeObject from './freezeObject.js';
*/
INERTIAL : 1
};
-export default freezeObject(ReferenceFrame);
+export default Object.freeze(ReferenceFrame);
diff --git a/Source/Core/RequestScheduler.js b/Source/Core/RequestScheduler.js
index 0bc21591fcc7..6c1138bde60b 100644
--- a/Source/Core/RequestScheduler.js
+++ b/Source/Core/RequestScheduler.js
@@ -3,7 +3,6 @@ import when from '../ThirdParty/when.js';
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Event from './Event.js';
import Heap from './Heap.js';
import isBlobUri from './isBlobUri.js';
@@ -94,7 +93,7 @@ import RequestState from './RequestState.js';
*/
RequestScheduler.requestCompletedEvent = requestCompletedEvent;
- defineProperties(RequestScheduler, {
+ Object.defineProperties(RequestScheduler, {
/**
* Returns the statistics used by the request scheduler.
*
diff --git a/Source/Core/RequestState.js b/Source/Core/RequestState.js
index 32ea53af0110..15efccad847d 100644
--- a/Source/Core/RequestState.js
+++ b/Source/Core/RequestState.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* State of the request.
@@ -54,4 +53,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
FAILED : 5
};
-export default freezeObject(RequestState);
+export default Object.freeze(RequestState);
diff --git a/Source/Core/RequestType.js b/Source/Core/RequestType.js
index 0f2e577dbd4d..7e7bbd9a054f 100644
--- a/Source/Core/RequestType.js
+++ b/Source/Core/RequestType.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* An enum identifying the type of request. Used for finer grained logging and priority sorting.
@@ -38,4 +37,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
OTHER : 3
};
-export default freezeObject(RequestType);
+export default Object.freeze(RequestType);
diff --git a/Source/Core/Resource.js b/Source/Core/Resource.js
index 941fc1a42c36..04463a4856c5 100644
--- a/Source/Core/Resource.js
+++ b/Source/Core/Resource.js
@@ -6,9 +6,7 @@ import clone from './clone.js';
import combine from './combine.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import getAbsoluteUri from './getAbsoluteUri.js';
import getBaseUri from './getBaseUri.js';
import getExtensionFromUri from './getExtensionFromUri.js';
@@ -385,7 +383,7 @@ import TrustedServers from './TrustedServers.js';
return supportsImageBitmapOptionsPromise;
};
- defineProperties(Resource, {
+ Object.defineProperties(Resource, {
/**
* Returns true if blobs are supported.
*
@@ -401,7 +399,7 @@ import TrustedServers from './TrustedServers.js';
}
});
- defineProperties(Resource.prototype, {
+ Object.defineProperties(Resource.prototype, {
/**
* Query parameters appended to the url.
*
@@ -1831,7 +1829,7 @@ import TrustedServers from './TrustedServers.js';
Resource.supportsImageBitmapOptions()
.then(function(supportsImageBitmap) {
// We can only use ImageBitmap if we can flip on decode.
- // See: https://github.com/AnalyticalGraphicsInc/cesium/pull/7579#issuecomment-466146898
+ // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898
if (!(supportsImageBitmap && preferImageBitmap)) {
loadImageElement(url, crossOrigin, deferred);
return;
@@ -1899,15 +1897,10 @@ import TrustedServers from './TrustedServers.js';
}
function loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType) {
-
- // Specifically use the Node version of require to avoid conflicts with the global
- // require defined in the built version of Cesium.
- var nodeRequire = global.require; // eslint-disable-line
-
// Note: only the 'json' and 'text' responseTypes transforms the loaded buffer
- var URL = nodeRequire('url').parse(url);
- var http = URL.protocol === 'https:' ? nodeRequire('https') : nodeRequire('http');
- var zlib = nodeRequire('zlib');
+ var URL = require('url').parse(url); // eslint-disable-line
+ var http = URL.protocol === 'https:' ? require('https') : require('http'); // eslint-disable-line
+ var zlib = require('zlib'); // eslint-disable-line
var options = {
protocol : URL.protocol,
hostname : URL.hostname,
@@ -2068,7 +2061,7 @@ import TrustedServers from './TrustedServers.js';
* @type {Resource}
* @constant
*/
- Resource.DEFAULT = freezeObject(new Resource({
+ Resource.DEFAULT = Object.freeze(new Resource({
url: (typeof document === 'undefined') ? '' : document.location.href.split('?')[0]
}));
diff --git a/Source/Core/ScreenSpaceEventHandler.js b/Source/Core/ScreenSpaceEventHandler.js
index 1d5e6b8bdb70..0a4dc8487cdc 100644
--- a/Source/Core/ScreenSpaceEventHandler.js
+++ b/Source/Core/ScreenSpaceEventHandler.js
@@ -53,7 +53,13 @@ import ScreenSpaceEventType from './ScreenSpaceEventType.js';
function listener(e) {
callback(screenSpaceEventHandler, e);
}
- element.addEventListener(domType, listener, false);
+
+ if (FeatureDetection.isInternetExplorer()) {
+ element.addEventListener(domType, listener, false);
+ }
+ else {
+ element.addEventListener(domType, listener, { capture: false, passive: false });
+ }
screenSpaceEventHandler._removalFunctions.push(function() {
element.removeEventListener(domType, listener, false);
diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js
index 83d4929c4f3e..457722443f80 100644
--- a/Source/Core/ScreenSpaceEventType.js
+++ b/Source/Core/ScreenSpaceEventType.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
@@ -126,4 +125,4 @@ import freezeObject from './freezeObject.js';
*/
PINCH_MOVE : 19
};
-export default freezeObject(ScreenSpaceEventType);
+export default Object.freeze(ScreenSpaceEventType);
diff --git a/Source/Core/ShowGeometryInstanceAttribute.js b/Source/Core/ShowGeometryInstanceAttribute.js
index 6c0f9c8f4dce..e13a12ef04b7 100644
--- a/Source/Core/ShowGeometryInstanceAttribute.js
+++ b/Source/Core/ShowGeometryInstanceAttribute.js
@@ -1,7 +1,6 @@
import ComponentDatatype from './ComponentDatatype.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -44,7 +43,7 @@ import DeveloperError from './DeveloperError.js';
this.value = ShowGeometryInstanceAttribute.toValue(show);
}
- defineProperties(ShowGeometryInstanceAttribute.prototype, {
+ Object.defineProperties(ShowGeometryInstanceAttribute.prototype, {
/**
* The datatype of each component in the attribute, e.g., individual elements in
* {@link ColorGeometryInstanceAttribute#value}.
diff --git a/Source/Core/TerrainData.js b/Source/Core/TerrainData.js
index c1a52bfab7f9..572424bd283b 100644
--- a/Source/Core/TerrainData.js
+++ b/Source/Core/TerrainData.js
@@ -1,4 +1,3 @@
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -16,7 +15,7 @@ import DeveloperError from './DeveloperError.js';
DeveloperError.throwInstantiationError();
}
- defineProperties(TerrainData.prototype, {
+ Object.defineProperties(TerrainData.prototype, {
/**
* An array of credits for this tile.
* @memberof TerrainData.prototype
diff --git a/Source/Core/TerrainProvider.js b/Source/Core/TerrainProvider.js
index c234fed8ab33..0e82db0b45ae 100644
--- a/Source/Core/TerrainProvider.js
+++ b/Source/Core/TerrainProvider.js
@@ -1,5 +1,4 @@
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import IndexDatatype from './IndexDatatype.js';
import CesiumMath from './Math.js';
@@ -21,7 +20,7 @@ import CesiumMath from './Math.js';
DeveloperError.throwInstantiationError();
}
- defineProperties(TerrainProvider.prototype, {
+ Object.defineProperties(TerrainProvider.prototype, {
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
diff --git a/Source/Core/TerrainQuantization.js b/Source/Core/TerrainQuantization.js
index b97807c37b68..e8cb9abded23 100644
--- a/Source/Core/TerrainQuantization.js
+++ b/Source/Core/TerrainQuantization.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* This enumerated type is used to determine how the vertices of the terrain mesh are compressed.
@@ -24,4 +23,4 @@ import freezeObject from './freezeObject.js';
*/
BITS12 : 1
};
-export default freezeObject(TerrainQuantization);
+export default Object.freeze(TerrainQuantization);
diff --git a/Source/Core/TileAvailability.js b/Source/Core/TileAvailability.js
index 3f39c058e94a..a050362199a1 100644
--- a/Source/Core/TileAvailability.js
+++ b/Source/Core/TileAvailability.js
@@ -1,7 +1,6 @@
import binarySearch from './binarySearch.js';
import Cartographic from './Cartographic.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Rectangle from './Rectangle.js';
/**
@@ -215,7 +214,7 @@ import Rectangle from './Rectangle.js';
this._ne = undefined;
}
- defineProperties(QuadtreeNode.prototype, {
+ Object.defineProperties(QuadtreeNode.prototype, {
nw: {
get: function() {
if (!this._nw) {
diff --git a/Source/Core/TilingScheme.js b/Source/Core/TilingScheme.js
index d79b4db78b90..3a5ba25a6816 100644
--- a/Source/Core/TilingScheme.js
+++ b/Source/Core/TilingScheme.js
@@ -1,4 +1,3 @@
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
/**
@@ -20,7 +19,7 @@ import DeveloperError from './DeveloperError.js';
//>>includeEnd('debug');
}
- defineProperties(TilingScheme.prototype, {
+ Object.defineProperties(TilingScheme.prototype, {
/**
* Gets the ellipsoid that is tiled by the tiling scheme.
* @memberof TilingScheme.prototype
diff --git a/Source/Core/TimeConstants.js b/Source/Core/TimeConstants.js
index f75616d67a82..447437bb3918 100644
--- a/Source/Core/TimeConstants.js
+++ b/Source/Core/TimeConstants.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Constants for time conversions like those done by {@link JulianDate}.
@@ -82,4 +81,4 @@ import freezeObject from './freezeObject.js';
*/
MODIFIED_JULIAN_DATE_DIFFERENCE : 2400000.5
};
-export default freezeObject(TimeConstants);
+export default Object.freeze(TimeConstants);
diff --git a/Source/Core/TimeInterval.js b/Source/Core/TimeInterval.js
index ac5b100f6b7e..55b4eba3de19 100644
--- a/Source/Core/TimeInterval.js
+++ b/Source/Core/TimeInterval.js
@@ -1,9 +1,7 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
import JulianDate from './JulianDate.js';
/**
@@ -94,7 +92,7 @@ import JulianDate from './JulianDate.js';
this.isStopIncluded = defaultValue(options.isStopIncluded, true);
}
- defineProperties(TimeInterval.prototype, {
+ Object.defineProperties(TimeInterval.prototype, {
/**
* Gets whether or not this interval is empty.
* @memberof TimeInterval.prototype
@@ -373,7 +371,7 @@ import JulianDate from './JulianDate.js';
* @type {TimeInterval}
* @constant
*/
- TimeInterval.EMPTY = freezeObject(new TimeInterval({
+ TimeInterval.EMPTY = Object.freeze(new TimeInterval({
start : new JulianDate(),
stop : new JulianDate(),
isStartIncluded : false,
diff --git a/Source/Core/TimeIntervalCollection.js b/Source/Core/TimeIntervalCollection.js
index f0f6690e95dc..799ded2176bc 100644
--- a/Source/Core/TimeIntervalCollection.js
+++ b/Source/Core/TimeIntervalCollection.js
@@ -1,7 +1,6 @@
import binarySearch from './binarySearch.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Event from './Event.js';
import GregorianDate from './GregorianDate.js';
@@ -33,7 +32,7 @@ import TimeInterval from './TimeInterval.js';
}
}
- defineProperties(TimeIntervalCollection.prototype, {
+ Object.defineProperties(TimeIntervalCollection.prototype, {
/**
* Gets an event that is raised whenever the collection of intervals change.
* @memberof TimeIntervalCollection.prototype
diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js
index 785519b15000..bdcf41fb9079 100644
--- a/Source/Core/TimeStandard.js
+++ b/Source/Core/TimeStandard.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Provides the type of time standards which JulianDate can take as input.
@@ -29,4 +28,4 @@ import freezeObject from './freezeObject.js';
*/
TAI : 1
};
-export default freezeObject(TimeStandard);
+export default Object.freeze(TimeStandard);
diff --git a/Source/Core/VRTheWorldTerrainProvider.js b/Source/Core/VRTheWorldTerrainProvider.js
index dc024ba8ae6a..aa24478ce44f 100644
--- a/Source/Core/VRTheWorldTerrainProvider.js
+++ b/Source/Core/VRTheWorldTerrainProvider.js
@@ -2,7 +2,6 @@ import when from '../ThirdParty/when.js';
import Credit from './Credit.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import Event from './Event.js';
@@ -126,7 +125,7 @@ import TileProviderError from './TileProviderError.js';
requestMetadata();
}
- defineProperties(VRTheWorldTerrainProvider.prototype, {
+ Object.defineProperties(VRTheWorldTerrainProvider.prototype, {
/**
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
diff --git a/Source/Core/VertexFormat.js b/Source/Core/VertexFormat.js
index b491b919c099..4da08f2ff5cf 100644
--- a/Source/Core/VertexFormat.js
+++ b/Source/Core/VertexFormat.js
@@ -1,7 +1,6 @@
import defaultValue from './defaultValue.js';
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
/**
* A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
@@ -107,7 +106,7 @@ import freezeObject from './freezeObject.js';
*
* @see VertexFormat#position
*/
- VertexFormat.POSITION_ONLY = freezeObject(new VertexFormat({
+ VertexFormat.POSITION_ONLY = Object.freeze(new VertexFormat({
position : true
}));
@@ -121,7 +120,7 @@ import freezeObject from './freezeObject.js';
* @see VertexFormat#position
* @see VertexFormat#normal
*/
- VertexFormat.POSITION_AND_NORMAL = freezeObject(new VertexFormat({
+ VertexFormat.POSITION_AND_NORMAL = Object.freeze(new VertexFormat({
position : true,
normal : true
}));
@@ -138,7 +137,7 @@ import freezeObject from './freezeObject.js';
* @see VertexFormat#normal
* @see VertexFormat#st
*/
- VertexFormat.POSITION_NORMAL_AND_ST = freezeObject(new VertexFormat({
+ VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(new VertexFormat({
position : true,
normal : true,
st : true
@@ -154,7 +153,7 @@ import freezeObject from './freezeObject.js';
* @see VertexFormat#position
* @see VertexFormat#st
*/
- VertexFormat.POSITION_AND_ST = freezeObject(new VertexFormat({
+ VertexFormat.POSITION_AND_ST = Object.freeze(new VertexFormat({
position : true,
st : true
}));
@@ -168,7 +167,7 @@ import freezeObject from './freezeObject.js';
* @see VertexFormat#position
* @see VertexFormat#color
*/
- VertexFormat.POSITION_AND_COLOR = freezeObject(new VertexFormat({
+ VertexFormat.POSITION_AND_COLOR = Object.freeze(new VertexFormat({
position : true,
color : true
}));
@@ -185,7 +184,7 @@ import freezeObject from './freezeObject.js';
* @see VertexFormat#tangent
* @see VertexFormat#bitangent
*/
- VertexFormat.ALL = freezeObject(new VertexFormat({
+ VertexFormat.ALL = Object.freeze(new VertexFormat({
position : true,
normal : true,
st : true,
diff --git a/Source/Core/VideoSynchronizer.js b/Source/Core/VideoSynchronizer.js
index 8b41189c22ba..68168672a555 100644
--- a/Source/Core/VideoSynchronizer.js
+++ b/Source/Core/VideoSynchronizer.js
@@ -1,6 +1,5 @@
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import destroyObject from './destroyObject.js';
import Iso8601 from './Iso8601.js';
import JulianDate from './JulianDate.js';
@@ -54,7 +53,7 @@ import JulianDate from './JulianDate.js';
this._firstTickAfterSeek = false;
}
- defineProperties(VideoSynchronizer.prototype, {
+ Object.defineProperties(VideoSynchronizer.prototype, {
/**
* Gets or sets the clock used to drive the video element.
*
diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js
index 509a9abe8a6e..ebae8d8b89c0 100644
--- a/Source/Core/Visibility.js
+++ b/Source/Core/Visibility.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* This enumerated type is used in determining to what extent an object, the occludee,
@@ -33,4 +32,4 @@ import freezeObject from './freezeObject.js';
*/
FULL : 1
};
-export default freezeObject(Visibility);
+export default Object.freeze(Visibility);
diff --git a/Source/Core/WebGLConstants.js b/Source/Core/WebGLConstants.js
index f17056855cd5..90f68cc37c4e 100644
--- a/Source/Core/WebGLConstants.js
+++ b/Source/Core/WebGLConstants.js
@@ -1,9 +1,8 @@
-import freezeObject from './freezeObject.js';
/**
* Enum containing WebGL Constant values by name.
* for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
- * (For example, in [Safari 9]{@link https://github.com/AnalyticalGraphicsInc/cesium/issues/2989}).
+ * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
*
* These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
* and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
@@ -607,4 +606,4 @@ import freezeObject from './freezeObject.js';
// Extensions
MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF
};
-export default freezeObject(WebGLConstants);
+export default Object.freeze(WebGLConstants);
diff --git a/Source/Core/WebMercatorProjection.js b/Source/Core/WebMercatorProjection.js
index 1483ee8176f4..1753620d5d62 100644
--- a/Source/Core/WebMercatorProjection.js
+++ b/Source/Core/WebMercatorProjection.js
@@ -2,7 +2,6 @@ import Cartesian3 from './Cartesian3.js';
import Cartographic from './Cartographic.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Ellipsoid from './Ellipsoid.js';
import CesiumMath from './Math.js';
@@ -25,7 +24,7 @@ import CesiumMath from './Math.js';
this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;
}
- defineProperties(WebMercatorProjection.prototype, {
+ Object.defineProperties(WebMercatorProjection.prototype, {
/**
* Gets the {@link Ellipsoid}.
*
diff --git a/Source/Core/WebMercatorTilingScheme.js b/Source/Core/WebMercatorTilingScheme.js
index 6efd02dd8400..593a039d0112 100644
--- a/Source/Core/WebMercatorTilingScheme.js
+++ b/Source/Core/WebMercatorTilingScheme.js
@@ -1,7 +1,6 @@
import Cartesian2 from './Cartesian2.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import Ellipsoid from './Ellipsoid.js';
import Rectangle from './Rectangle.js';
import WebMercatorProjection from './WebMercatorProjection.js';
@@ -54,7 +53,7 @@ import WebMercatorProjection from './WebMercatorProjection.js';
northeast.longitude, northeast.latitude);
}
- defineProperties(WebMercatorTilingScheme.prototype, {
+ Object.defineProperties(WebMercatorTilingScheme.prototype, {
/**
* Gets the ellipsoid that is tiled by this tiling scheme.
* @memberof WebMercatorTilingScheme.prototype
diff --git a/Source/Core/WeightSpline.js b/Source/Core/WeightSpline.js
index cb4747974677..7130b174c4b8 100644
--- a/Source/Core/WeightSpline.js
+++ b/Source/Core/WeightSpline.js
@@ -1,7 +1,6 @@
import Check from './Check.js';
import defaultValue from './defaultValue.js';
import defined from './defined.js';
-import defineProperties from './defineProperties.js';
import DeveloperError from './DeveloperError.js';
import Spline from './Spline.js';
@@ -60,7 +59,7 @@ import Spline from './Spline.js';
this._lastTimeIndex = 0;
}
- defineProperties(WeightSpline.prototype, {
+ Object.defineProperties(WeightSpline.prototype, {
/**
* An array of times for the control weights.
*
diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js
index d99cec6a60c1..9452e3f2cf47 100644
--- a/Source/Core/WindingOrder.js
+++ b/Source/Core/WindingOrder.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
import WebGLConstants from './WebGLConstants.js';
/**
@@ -31,4 +30,4 @@ import WebGLConstants from './WebGLConstants.js';
windingOrder === WindingOrder.COUNTER_CLOCKWISE;
}
};
-export default freezeObject(WindingOrder);
+export default Object.freeze(WindingOrder);
diff --git a/Source/Core/defaultValue.js b/Source/Core/defaultValue.js
index cdce75d3b442..9e452636d46a 100644
--- a/Source/Core/defaultValue.js
+++ b/Source/Core/defaultValue.js
@@ -1,4 +1,3 @@
-import freezeObject from './freezeObject.js';
/**
* Returns the first parameter if not undefined, otherwise the second parameter.
@@ -25,5 +24,5 @@ import freezeObject from './freezeObject.js';
* an object literal.
* @type {Object}
*/
- defaultValue.EMPTY_OBJECT = freezeObject({});
+ defaultValue.EMPTY_OBJECT = Object.freeze({});
export default defaultValue;
diff --git a/Source/Core/defineProperties.js b/Source/Core/defineProperties.js
deleted file mode 100644
index e34e42fc10a2..000000000000
--- a/Source/Core/defineProperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import defined from './defined.js';
-
- var definePropertyWorks = (function() {
- try {
- return 'x' in Object.defineProperty({}, 'x', {});
- } catch (e) {
- return false;
- }
- })();
-
- /**
- * Defines properties on an object, using Object.defineProperties if available,
- * otherwise returns the object unchanged. This function should be used in
- * setup code to prevent errors from completely halting JavaScript execution
- * in legacy browsers.
- *
- * @private
- *
- * @exports defineProperties
- */
- var defineProperties = Object.defineProperties;
- if (!definePropertyWorks || !defined(defineProperties)) {
- defineProperties = function(o) {
- return o;
- };
- }
-export default defineProperties;
diff --git a/Source/Core/deprecationWarning.js b/Source/Core/deprecationWarning.js
index 3ac1c6ab1635..d714024b8220 100644
--- a/Source/Core/deprecationWarning.js
+++ b/Source/Core/deprecationWarning.js
@@ -26,7 +26,7 @@ import oneTimeWarning from './oneTimeWarning.js';
* };
*
* // Deprecated property
- * defineProperties(Bar.prototype, {
+ * Object.defineProperties(Bar.prototype, {
* prop : {
* get : function() {
* deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.');
diff --git a/Source/Core/freezeObject.js b/Source/Core/freezeObject.js
deleted file mode 100644
index bd771b4ee081..000000000000
--- a/Source/Core/freezeObject.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import defined from './defined.js';
-
- /**
- * Freezes an object, using Object.freeze if available, otherwise returns
- * the object unchanged. This function should be used in setup code to prevent
- * errors from completely halting JavaScript execution in legacy browsers.
- *
- * @private
- *
- * @exports freezeObject
- */
- var freezeObject = Object.freeze;
- if (!defined(freezeObject)) {
- freezeObject = function(o) {
- return o;
- };
- }
-export default freezeObject;
diff --git a/Source/Core/isArray.js b/Source/Core/isArray.js
index 30211cb09968..142118d38d15 100644
--- a/Source/Core/isArray.js
+++ b/Source/Core/isArray.js
@@ -1,4 +1,5 @@
import defined from './defined.js';
+import deprecationWarning from './deprecationWarning.js';
/**
* Tests an object to see if it is an array.
@@ -6,6 +7,8 @@ import defined from './defined.js';
*
* @param {*} value The value to test.
* @returns {Boolean} true if the value is an array, false otherwise.
+ * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/8526.
+ * Use `Array.isArray` instead
*/
var isArray = Array.isArray;
if (!defined(isArray)) {
@@ -13,4 +16,9 @@ import defined from './defined.js';
return Object.prototype.toString.call(value) === '[object Array]';
};
}
-export default isArray;
+
+ function isArrayFunction(value) {
+ deprecationWarning('isArray', 'isArray will be removed in Cesium 1.69. Use the native `Array.isArray` function instead.');
+ return isArray(value);
+ }
+export default isArrayFunction;
diff --git a/Source/Core/objectToQuery.js b/Source/Core/objectToQuery.js
index feaeca762826..974fe27618c1 100644
--- a/Source/Core/objectToQuery.js
+++ b/Source/Core/objectToQuery.js
@@ -1,6 +1,5 @@
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import isArray from './isArray.js';
/**
* Converts an object representing a set of name/value pairs into a query string,
@@ -36,7 +35,7 @@ import isArray from './isArray.js';
var value = obj[propName];
var part = encodeURIComponent(propName) + '=';
- if (isArray(value)) {
+ if (Array.isArray(value)) {
for (var i = 0, len = value.length; i < len; ++i) {
result += part + encodeURIComponent(value[i]) + '&';
}
@@ -51,7 +50,7 @@ import isArray from './isArray.js';
// This function used to replace %20 with + which is more compact and readable.
// However, some servers didn't properly handle + as a space.
- // https://github.com/AnalyticalGraphicsInc/cesium/issues/2192
+ // https://github.com/CesiumGS/cesium/issues/2192
return result;
}
diff --git a/Source/Core/queryToObject.js b/Source/Core/queryToObject.js
index 20469ae1c2d3..dad5b383ffb9 100644
--- a/Source/Core/queryToObject.js
+++ b/Source/Core/queryToObject.js
@@ -1,6 +1,5 @@
import defined from './defined.js';
import DeveloperError from './DeveloperError.js';
-import isArray from './isArray.js';
/**
* Parses a query string into an object, where the keys and values of the object are the
@@ -50,7 +49,7 @@ import isArray from './isArray.js';
if (typeof resultValue === 'string') {
// expand the single value to an array
result[name] = [resultValue, value];
- } else if (isArray(resultValue)) {
+ } else if (Array.isArray(resultValue)) {
resultValue.push(value);
} else {
result[name] = value;
diff --git a/Source/DataSources/BillboardGraphics.js b/Source/DataSources/BillboardGraphics.js
index a0419397ad08..75aca39062c1 100644
--- a/Source/DataSources/BillboardGraphics.js
+++ b/Source/DataSources/BillboardGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
@@ -87,7 +86,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(BillboardGraphics.prototype, {
+ Object.defineProperties(BillboardGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof BillboardGraphics.prototype
diff --git a/Source/DataSources/BoundingSphereState.js b/Source/DataSources/BoundingSphereState.js
index 12c124103190..e08e1b7ebc84 100644
--- a/Source/DataSources/BoundingSphereState.js
+++ b/Source/DataSources/BoundingSphereState.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The state of a BoundingSphere computation being performed by a {@link Visualizer}.
@@ -25,4 +24,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
FAILED : 2
};
-export default freezeObject(BoundingSphereState);
+export default Object.freeze(BoundingSphereState);
diff --git a/Source/DataSources/BoxGeometryUpdater.js b/Source/DataSources/BoxGeometryUpdater.js
index 8b67e4a36b59..c087521528a6 100644
--- a/Source/DataSources/BoxGeometryUpdater.js
+++ b/Source/DataSources/BoxGeometryUpdater.js
@@ -5,7 +5,6 @@ import Check from '../Core/Check.js';
import Color from '../Core/Color.js';
import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
import GeometryInstance from '../Core/GeometryInstance.js';
@@ -61,7 +60,7 @@ import Property from './Property.js';
BoxGeometryUpdater.prototype.constructor = BoxGeometryUpdater;
}
- defineProperties(BoxGeometryUpdater.prototype, {
+ Object.defineProperties(BoxGeometryUpdater.prototype, {
/**
* Gets the terrain offset property
* @type {TerrainOffsetProperty}
diff --git a/Source/DataSources/BoxGraphics.js b/Source/DataSources/BoxGraphics.js
index 055f77b4384c..6cb57fcbcb66 100644
--- a/Source/DataSources/BoxGraphics.js
+++ b/Source/DataSources/BoxGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js';
@@ -52,7 +51,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(BoxGraphics.prototype, {
+ Object.defineProperties(BoxGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof BoxGraphics.prototype
diff --git a/Source/DataSources/CallbackProperty.js b/Source/DataSources/CallbackProperty.js
index 0cc83cdf5de4..19963f710a50 100644
--- a/Source/DataSources/CallbackProperty.js
+++ b/Source/DataSources/CallbackProperty.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -19,7 +18,7 @@ import Event from '../Core/Event.js';
this.setCallback(callback, isConstant);
}
- defineProperties(CallbackProperty.prototype, {
+ Object.defineProperties(CallbackProperty.prototype, {
/**
* Gets a value indicating if this property is constant.
* @memberof CallbackProperty.prototype
diff --git a/Source/DataSources/Cesium3DTilesetGraphics.js b/Source/DataSources/Cesium3DTilesetGraphics.js
index b9c7a9629db5..f1fc2d6f92dc 100644
--- a/Source/DataSources/Cesium3DTilesetGraphics.js
+++ b/Source/DataSources/Cesium3DTilesetGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
@@ -30,7 +29,7 @@ function Cesium3DTilesetGraphics(options) {
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
-defineProperties(Cesium3DTilesetGraphics.prototype, {
+Object.defineProperties(Cesium3DTilesetGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof Cesium3DTilesetGraphics.prototype
diff --git a/Source/DataSources/CheckerboardMaterialProperty.js b/Source/DataSources/CheckerboardMaterialProperty.js
index c7f8622b0d52..5dd01b97993c 100644
--- a/Source/DataSources/CheckerboardMaterialProperty.js
+++ b/Source/DataSources/CheckerboardMaterialProperty.js
@@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
import Property from './Property.js';
@@ -37,7 +36,7 @@ import Property from './Property.js';
this.repeat = options.repeat;
}
- defineProperties(CheckerboardMaterialProperty.prototype, {
+ Object.defineProperties(CheckerboardMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/ColorMaterialProperty.js b/Source/DataSources/ColorMaterialProperty.js
index 1e59beff78fd..1b0d0e30336b 100644
--- a/Source/DataSources/ColorMaterialProperty.js
+++ b/Source/DataSources/ColorMaterialProperty.js
@@ -1,6 +1,5 @@
import Color from '../Core/Color.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
import Property from './Property.js';
@@ -21,7 +20,7 @@ import Property from './Property.js';
this.color = color;
}
- defineProperties(ColorMaterialProperty.prototype, {
+ Object.defineProperties(ColorMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/CompositeEntityCollection.js b/Source/DataSources/CompositeEntityCollection.js
index 94642db5fbe6..ed081d3686e1 100644
--- a/Source/DataSources/CompositeEntityCollection.js
+++ b/Source/DataSources/CompositeEntityCollection.js
@@ -1,6 +1,5 @@
import createGuid from '../Core/createGuid.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import CesiumMath from '../Core/Math.js';
import Entity from './Entity.js';
@@ -130,7 +129,7 @@ import EntityCollection from './EntityCollection.js';
this._shouldRecomposite = false;
}
- defineProperties(CompositeEntityCollection.prototype, {
+ Object.defineProperties(CompositeEntityCollection.prototype, {
/**
* Gets the event that is fired when entities are added or removed from the collection.
* The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
diff --git a/Source/DataSources/CompositeMaterialProperty.js b/Source/DataSources/CompositeMaterialProperty.js
index 6ef3a17ba50f..4c1a3812562c 100644
--- a/Source/DataSources/CompositeMaterialProperty.js
+++ b/Source/DataSources/CompositeMaterialProperty.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import CompositeProperty from './CompositeProperty.js';
@@ -17,7 +16,7 @@ import Property from './Property.js';
this._composite.definitionChanged.addEventListener(CompositeMaterialProperty.prototype._raiseDefinitionChanged, this);
}
- defineProperties(CompositeMaterialProperty.prototype, {
+ Object.defineProperties(CompositeMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/CompositePositionProperty.js b/Source/DataSources/CompositePositionProperty.js
index 81c831f397d5..1f519ba750f0 100644
--- a/Source/DataSources/CompositePositionProperty.js
+++ b/Source/DataSources/CompositePositionProperty.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import ReferenceFrame from '../Core/ReferenceFrame.js';
@@ -22,7 +21,7 @@ import Property from './Property.js';
this._composite.definitionChanged.addEventListener(CompositePositionProperty.prototype._raiseDefinitionChanged, this);
}
- defineProperties(CompositePositionProperty.prototype, {
+ Object.defineProperties(CompositePositionProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/CompositeProperty.js b/Source/DataSources/CompositeProperty.js
index cd05487fa6be..308849002fd4 100644
--- a/Source/DataSources/CompositeProperty.js
+++ b/Source/DataSources/CompositeProperty.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import EventHelper from '../Core/EventHelper.js';
@@ -60,7 +59,7 @@ import Property from './Property.js';
this._intervals.changedEvent.addEventListener(CompositeProperty.prototype._intervalsChanged, this);
}
- defineProperties(CompositeProperty.prototype, {
+ Object.defineProperties(CompositeProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/ConstantPositionProperty.js b/Source/DataSources/ConstantPositionProperty.js
index 846bd303deba..11fccf90036a 100644
--- a/Source/DataSources/ConstantPositionProperty.js
+++ b/Source/DataSources/ConstantPositionProperty.js
@@ -1,7 +1,6 @@
import Cartesian3 from '../Core/Cartesian3.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import ReferenceFrame from '../Core/ReferenceFrame.js';
@@ -23,7 +22,7 @@ import PositionProperty from './PositionProperty.js';
this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);
}
- defineProperties(ConstantPositionProperty.prototype, {
+ Object.defineProperties(ConstantPositionProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/ConstantProperty.js b/Source/DataSources/ConstantProperty.js
index 4f70a9456fdc..f1c27ec56dc2 100644
--- a/Source/DataSources/ConstantProperty.js
+++ b/Source/DataSources/ConstantProperty.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
/**
@@ -20,7 +19,7 @@ import Event from '../Core/Event.js';
this.setValue(value);
}
- defineProperties(ConstantProperty.prototype, {
+ Object.defineProperties(ConstantProperty.prototype, {
/**
* Gets a value indicating if this property is constant.
* This property always returns true
.
diff --git a/Source/DataSources/CorridorGeometryUpdater.js b/Source/DataSources/CorridorGeometryUpdater.js
index 1b58ac5ec33c..520ded01c98c 100644
--- a/Source/DataSources/CorridorGeometryUpdater.js
+++ b/Source/DataSources/CorridorGeometryUpdater.js
@@ -174,7 +174,7 @@ import Property from './Property.js';
!Property.isConstant(corridor.outlineWidth) || //
!Property.isConstant(corridor.cornerType) || //
!Property.isConstant(corridor.zIndex) || //
- (this._onTerrain && !Property.isConstant(this._materialProperty));
+ (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty));
};
CorridorGeometryUpdater.prototype._setStaticOptions = function(entity, corridor) {
diff --git a/Source/DataSources/CorridorGraphics.js b/Source/DataSources/CorridorGraphics.js
index 80de75bea490..5f173ca6dbb0 100644
--- a/Source/DataSources/CorridorGraphics.js
+++ b/Source/DataSources/CorridorGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js';
@@ -79,7 +78,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(CorridorGraphics.prototype, {
+ Object.defineProperties(CorridorGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof CorridorGraphics.prototype
diff --git a/Source/DataSources/CustomDataSource.js b/Source/DataSources/CustomDataSource.js
index 8ba15a953509..501f65c2c45e 100644
--- a/Source/DataSources/CustomDataSource.js
+++ b/Source/DataSources/CustomDataSource.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import DataSource from './DataSource.js';
@@ -37,7 +36,7 @@ import EntityCollection from './EntityCollection.js';
this._entityCluster = new EntityCluster();
}
- defineProperties(CustomDataSource.prototype, {
+ Object.defineProperties(CustomDataSource.prototype, {
/**
* Gets or sets a human-readable name for this instance.
* @memberof CustomDataSource.prototype
diff --git a/Source/DataSources/CylinderGeometryUpdater.js b/Source/DataSources/CylinderGeometryUpdater.js
index 9f2973d6a5ef..95f15a049819 100644
--- a/Source/DataSources/CylinderGeometryUpdater.js
+++ b/Source/DataSources/CylinderGeometryUpdater.js
@@ -5,7 +5,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu
import CylinderGeometry from '../Core/CylinderGeometry.js';
import CylinderOutlineGeometry from '../Core/CylinderOutlineGeometry.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
import GeometryInstance from '../Core/GeometryInstance.js';
@@ -65,7 +64,7 @@ import Property from './Property.js';
CylinderGeometryUpdater.prototype.constructor = CylinderGeometryUpdater;
}
- defineProperties(CylinderGeometryUpdater.prototype, {
+ Object.defineProperties(CylinderGeometryUpdater.prototype, {
/**
* Gets the terrain offset property
* @type {TerrainOffsetProperty}
diff --git a/Source/DataSources/CylinderGraphics.js b/Source/DataSources/CylinderGraphics.js
index bc01dae16f54..a5c8a43a3272 100644
--- a/Source/DataSources/CylinderGraphics.js
+++ b/Source/DataSources/CylinderGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js';
@@ -63,7 +62,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(CylinderGraphics.prototype, {
+ Object.defineProperties(CylinderGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof CylinderGraphics.prototype
diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js
index 1490788fdebd..5d94af20a332 100644
--- a/Source/DataSources/CzmlDataSource.js
+++ b/Source/DataSources/CzmlDataSource.js
@@ -11,7 +11,6 @@ import Credit from '../Core/Credit.js';
import createGuid from '../Core/createGuid.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
import Ellipsoid from '../Core/Ellipsoid.js';
@@ -19,7 +18,6 @@ import Event from '../Core/Event.js';
import ExtrapolationType from '../Core/ExtrapolationType.js';
import getFilenameFromUri from '../Core/getFilenameFromUri.js';
import HermitePolynomialApproximation from '../Core/HermitePolynomialApproximation.js';
-import isArray from '../Core/isArray.js';
import Iso8601 from '../Core/Iso8601.js';
import JulianDate from '../Core/JulianDate.js';
import LagrangePolynomialApproximation from '../Core/LagrangePolynomialApproximation.js';
@@ -777,7 +775,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, len = packetData.length; i < len; ++i) {
processProperty(type, object, propertyName, packetData[i], interval, sourceUri, entityCollection);
}
@@ -951,7 +949,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, len = packetData.length; i < len; ++i) {
processPositionProperty(object, propertyName, packetData[i], interval, sourceUri, entityCollection);
}
@@ -1087,7 +1085,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, len = packetData.length; i < len; ++i) {
processMaterialProperty(object, propertyName, packetData[i], interval, sourceUri, entityCollection);
}
@@ -1149,7 +1147,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
}
var propertyData = propertiesData[key];
- if (isArray(propertyData)) {
+ if (Array.isArray(propertyData)) {
for (var i = 0, len = propertyData.length; i < len; ++i) {
processProperty(getPropertyType(propertyData[i]), entity.properties, key, propertyData[i], undefined, sourceUri, entityCollection);
}
@@ -1201,7 +1199,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, length = packetData.length; i < length; ++i) {
processArrayPacketData(object, propertyName, packetData[i], entityCollection);
}
@@ -1234,7 +1232,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, length = packetData.length; i < length; ++i) {
processPositionArrayPacketData(object, propertyName, packetData[i], entityCollection);
}
@@ -1284,7 +1282,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return;
}
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, length = packetData.length; i < length; ++i) {
processPositionArrayOfArraysPacketData(object, propertyName, packetData[i], entityCollection);
}
@@ -1300,7 +1298,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
}
var intervals;
- if (isArray(packetData)) {
+ if (Array.isArray(packetData)) {
for (var i = 0, len = packetData.length; i < len; ++i) {
if (!defined(intervals)) {
intervals = new TimeIntervalCollection();
@@ -1618,7 +1616,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
var i, len;
var nodeTransformationsData = modelData.nodeTransformations;
if (defined(nodeTransformationsData)) {
- if (isArray(nodeTransformationsData)) {
+ if (Array.isArray(nodeTransformationsData)) {
for (i = 0, len = nodeTransformationsData.length; i < len; ++i) {
processNodeTransformations(model, nodeTransformationsData[i], interval, sourceUri, entityCollection);
}
@@ -1629,7 +1627,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
var articulationsData = modelData.articulations;
if (defined(articulationsData)) {
- if (isArray(articulationsData)) {
+ if (Array.isArray(articulationsData)) {
for (i = 0, len = articulationsData.length; i < len; ++i) {
processArticulations(model, articulationsData[i], interval, sourceUri, entityCollection);
}
@@ -1766,7 +1764,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
this._definitionChanged = new Event();
}
- defineProperties(PolygonHierarchyProperty.prototype, {
+ Object.defineProperties(PolygonHierarchyProperty.prototype, {
isConstant : {
get : function() {
var positions = this.polygon._positions;
@@ -2190,7 +2188,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
return new CzmlDataSource().load(czml, options);
};
- defineProperties(CzmlDataSource.prototype, {
+ Object.defineProperties(CzmlDataSource.prototype, {
/**
* Gets a human-readable name for this instance.
* @memberof CzmlDataSource.prototype
@@ -2408,7 +2406,7 @@ import Cesium3DTilesetGraphics from './Cesium3DTilesetGraphics.js';
CzmlDataSource._processCzml = function(czml, entityCollection, sourceUri, updaterFunctions, dataSource) {
updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters);
- if (isArray(czml)) {
+ if (Array.isArray(czml)) {
for (var i = 0, len = czml.length; i < len; ++i) {
processCzmlPacket(czml[i], entityCollection, updaterFunctions, sourceUri, dataSource);
}
diff --git a/Source/DataSources/DataSource.js b/Source/DataSources/DataSource.js
index 873dc627551c..d219cb782151 100644
--- a/Source/DataSources/DataSource.js
+++ b/Source/DataSources/DataSource.js
@@ -1,4 +1,3 @@
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
/**
@@ -15,7 +14,7 @@ import DeveloperError from '../Core/DeveloperError.js';
DeveloperError.throwInstantiationError();
}
- defineProperties(DataSource.prototype, {
+ Object.defineProperties(DataSource.prototype, {
/**
* Gets a human-readable name for this instance.
* @memberof DataSource.prototype
diff --git a/Source/DataSources/DataSourceClock.js b/Source/DataSources/DataSourceClock.js
index 6ef2309f0965..56f1def5dc44 100644
--- a/Source/DataSources/DataSourceClock.js
+++ b/Source/DataSources/DataSourceClock.js
@@ -1,7 +1,6 @@
import Clock from '../Core/Clock.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import JulianDate from '../Core/JulianDate.js';
@@ -24,7 +23,7 @@ import createRawPropertyDescriptor from './createRawPropertyDescriptor.js';
this._multiplier = undefined;
}
- defineProperties(DataSourceClock.prototype, {
+ Object.defineProperties(DataSourceClock.prototype, {
/**
* Gets the event that is raised whenever a new property is assigned.
* @memberof DataSourceClock.prototype
diff --git a/Source/DataSources/DataSourceCollection.js b/Source/DataSources/DataSourceCollection.js
index 46bf07e16e05..c6e0de1abd3f 100644
--- a/Source/DataSources/DataSourceCollection.js
+++ b/Source/DataSources/DataSourceCollection.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -19,7 +18,7 @@ import when from '../ThirdParty/when.js';
this._dataSourceMoved = new Event();
}
- defineProperties(DataSourceCollection.prototype, {
+ Object.defineProperties(DataSourceCollection.prototype, {
/**
* Gets the number of data sources in this collection.
* @memberof DataSourceCollection.prototype
diff --git a/Source/DataSources/DataSourceDisplay.js b/Source/DataSources/DataSourceDisplay.js
index dfb03267ff05..b1c213795e1e 100644
--- a/Source/DataSources/DataSourceDisplay.js
+++ b/Source/DataSources/DataSourceDisplay.js
@@ -3,7 +3,6 @@ import BoundingSphere from '../Core/BoundingSphere.js';
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import EventHelper from '../Core/EventHelper.js';
import GroundPolylinePrimitive from '../Scene/GroundPolylinePrimitive.js';
@@ -117,7 +116,7 @@ import PolylineVisualizer from './PolylineVisualizer.js';
new PolylineVisualizer(scene, entities, dataSource._primitives, dataSource._groundPrimitives)];
};
- defineProperties(DataSourceDisplay.prototype, {
+ Object.defineProperties(DataSourceDisplay.prototype, {
/**
* Gets the scene associated with this display.
* @memberof DataSourceDisplay.prototype
diff --git a/Source/DataSources/EllipseGeometryUpdater.js b/Source/DataSources/EllipseGeometryUpdater.js
index 1100baaf4762..19ea7853030d 100644
--- a/Source/DataSources/EllipseGeometryUpdater.js
+++ b/Source/DataSources/EllipseGeometryUpdater.js
@@ -179,7 +179,7 @@ import Property from './Property.js';
!Property.isConstant(ellipse.outlineWidth) || //
!Property.isConstant(ellipse.numberOfVerticalLines) || //
!Property.isConstant(ellipse.zIndex) || //
- (this._onTerrain && !Property.isConstant(this._materialProperty));
+ (this._onTerrain && !Property.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty));
};
EllipseGeometryUpdater.prototype._setStaticOptions = function(entity, ellipse) {
diff --git a/Source/DataSources/EllipseGraphics.js b/Source/DataSources/EllipseGraphics.js
index 37f802eef14d..4a73b08ba741 100644
--- a/Source/DataSources/EllipseGraphics.js
+++ b/Source/DataSources/EllipseGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js';
@@ -85,7 +84,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(EllipseGraphics.prototype, {
+ Object.defineProperties(EllipseGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof EllipseGraphics.prototype
diff --git a/Source/DataSources/EllipsoidGeometryUpdater.js b/Source/DataSources/EllipsoidGeometryUpdater.js
index ffcad0a2fece..bb31b14fa7a7 100644
--- a/Source/DataSources/EllipsoidGeometryUpdater.js
+++ b/Source/DataSources/EllipsoidGeometryUpdater.js
@@ -4,7 +4,6 @@ import Color from '../Core/Color.js';
import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
import EllipsoidGeometry from '../Core/EllipsoidGeometry.js';
@@ -77,7 +76,7 @@ import Property from './Property.js';
EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater;
}
- defineProperties(EllipsoidGeometryUpdater.prototype, {
+ Object.defineProperties(EllipsoidGeometryUpdater.prototype, {
/**
* Gets the terrain offset property
* @type {TerrainOffsetProperty}
diff --git a/Source/DataSources/EllipsoidGraphics.js b/Source/DataSources/EllipsoidGraphics.js
index 0354d6a3b46b..4d15841529f5 100644
--- a/Source/DataSources/EllipsoidGraphics.js
+++ b/Source/DataSources/EllipsoidGraphics.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import createMaterialPropertyDescriptor from './createMaterialPropertyDescriptor.js';
@@ -76,7 +75,7 @@ import createPropertyDescriptor from './createPropertyDescriptor.js';
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
- defineProperties(EllipsoidGraphics.prototype, {
+ Object.defineProperties(EllipsoidGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof EllipsoidGraphics.prototype
diff --git a/Source/DataSources/Entity.js b/Source/DataSources/Entity.js
index 1a33d20ed803..1fa41b85e7f3 100644
--- a/Source/DataSources/Entity.js
+++ b/Source/DataSources/Entity.js
@@ -4,7 +4,6 @@ import Check from '../Core/Check.js';
import createGuid from '../Core/createGuid.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import CesiumMath from '../Core/Math.js';
@@ -183,7 +182,7 @@ import WallGraphics from './WallGraphics.js';
entity._definitionChanged.raiseEvent(entity, 'isShowing', isShowing, !isShowing);
}
- defineProperties(Entity.prototype, {
+ Object.defineProperties(Entity.prototype, {
/**
* The availability, if any, associated with this object.
* If availability is undefined, it is assumed that this object's
diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js
index 724793cbf621..8967584b6dc8 100644
--- a/Source/DataSources/EntityCluster.js
+++ b/Source/DataSources/EntityCluster.js
@@ -3,7 +3,6 @@ import Cartesian2 from '../Core/Cartesian2.js';
import Cartesian3 from '../Core/Cartesian3.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import EllipsoidalOccluder from '../Core/EllipsoidalOccluder.js';
import Event from '../Core/Event.js';
import Matrix4 from '../Core/Matrix4.js';
@@ -400,7 +399,7 @@ import kdbush from '../ThirdParty/kdbush.js';
this._removeEventListener = scene.camera.changed.addEventListener(cluster);
};
- defineProperties(EntityCluster.prototype, {
+ Object.defineProperties(EntityCluster.prototype, {
/**
* Gets or sets whether clustering is enabled.
* @memberof EntityCluster.prototype
diff --git a/Source/DataSources/EntityCollection.js b/Source/DataSources/EntityCollection.js
index 912ffb2143e8..49361318d9f8 100644
--- a/Source/DataSources/EntityCollection.js
+++ b/Source/DataSources/EntityCollection.js
@@ -1,7 +1,6 @@
import AssociativeArray from '../Core/AssociativeArray.js';
import createGuid from '../Core/createGuid.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import Iso8601 from '../Core/Iso8601.js';
@@ -106,7 +105,7 @@ import Entity from './Entity.js';
*/
EntityCollection.collectionChangedEventCallback = undefined;
- defineProperties(EntityCollection.prototype, {
+ Object.defineProperties(EntityCollection.prototype, {
/**
* Gets the event that is fired when entities are added or removed from the collection.
* The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
diff --git a/Source/DataSources/EntityView.js b/Source/DataSources/EntityView.js
index 01cb2b41c092..dd897f3c1af2 100644
--- a/Source/DataSources/EntityView.js
+++ b/Source/DataSources/EntityView.js
@@ -2,7 +2,6 @@ import Cartesian3 from '../Core/Cartesian3.js';
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Ellipsoid from '../Core/Ellipsoid.js';
import HeadingPitchRange from '../Core/HeadingPitchRange.js';
import JulianDate from '../Core/JulianDate.js';
@@ -229,7 +228,7 @@ import SceneMode from '../Scene/SceneMode.js';
}
// STATIC properties defined here, not per-instance.
- defineProperties(EntityView, {
+ Object.defineProperties(EntityView, {
/**
* Gets or sets a camera offset that will be used to
* initialize subsequent EntityViews.
diff --git a/Source/DataSources/GeoJsonDataSource.js b/Source/DataSources/GeoJsonDataSource.js
index 22d3804a342e..e2a51fae6150 100644
--- a/Source/DataSources/GeoJsonDataSource.js
+++ b/Source/DataSources/GeoJsonDataSource.js
@@ -5,7 +5,6 @@ import createGuid from '../Core/createGuid.js';
import Credit from '../Core/Credit.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import getFilenameFromUri from '../Core/getFilenameFromUri.js';
@@ -506,7 +505,7 @@ import PolylineGraphics from './PolylineGraphics.js';
return new GeoJsonDataSource().load(data, options);
};
- defineProperties(GeoJsonDataSource, {
+ Object.defineProperties(GeoJsonDataSource, {
/**
* Gets or sets the default size of the map pin created for each point, in pixels.
* @memberof GeoJsonDataSource
@@ -651,7 +650,7 @@ import PolylineGraphics from './PolylineGraphics.js';
}
});
- defineProperties(GeoJsonDataSource.prototype, {
+ Object.defineProperties(GeoJsonDataSource.prototype, {
/**
* Gets or sets a human-readable name for this instance.
* @memberof GeoJsonDataSource.prototype
diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js
index 89c71ba9652a..d1d7d165fa81 100644
--- a/Source/DataSources/GeometryUpdater.js
+++ b/Source/DataSources/GeometryUpdater.js
@@ -2,7 +2,6 @@ import Check from '../Core/Check.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
@@ -72,7 +71,7 @@ import Property from './Property.js';
this._supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(options.scene);
}
- defineProperties(GeometryUpdater.prototype, {
+ Object.defineProperties(GeometryUpdater.prototype, {
/**
* Gets the unique ID associated with this updater
* @memberof GeometryUpdater.prototype
diff --git a/Source/DataSources/GeometryVisualizer.js b/Source/DataSources/GeometryVisualizer.js
index 1d13d09fb4fd..d6e744a61cd3 100644
--- a/Source/DataSources/GeometryVisualizer.js
+++ b/Source/DataSources/GeometryVisualizer.js
@@ -141,7 +141,7 @@ import WallGeometryUpdater from './WallGeometryUpdater.js';
if (supportsMaterialsforEntitiesOnTerrain) {
for (i = 0; i < numberOfClassificationTypes; ++i) {
groundMaterialBatches.push(new StaticGroundGeometryPerMaterialBatch(groundPrimitives, i, MaterialAppearance));
- groundColorBatches[i] = new StaticGroundGeometryPerMaterialBatch(groundPrimitives, i, PerInstanceColorAppearance);
+ groundColorBatches[i] = new StaticGroundGeometryColorBatch(groundPrimitives, i);
}
} else {
for (i = 0; i < numberOfClassificationTypes; ++i) {
diff --git a/Source/DataSources/GridMaterialProperty.js b/Source/DataSources/GridMaterialProperty.js
index 010e1d963de2..da154b012d72 100644
--- a/Source/DataSources/GridMaterialProperty.js
+++ b/Source/DataSources/GridMaterialProperty.js
@@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
import Property from './Property.js';
@@ -48,7 +47,7 @@ import Property from './Property.js';
this.lineOffset = options.lineOffset;
}
- defineProperties(GridMaterialProperty.prototype, {
+ Object.defineProperties(GridMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/GroundGeometryUpdater.js b/Source/DataSources/GroundGeometryUpdater.js
index bf3eac291769..40e422da30e3 100644
--- a/Source/DataSources/GroundGeometryUpdater.js
+++ b/Source/DataSources/GroundGeometryUpdater.js
@@ -1,7 +1,6 @@
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import GeometryOffsetAttribute from '../Core/GeometryOffsetAttribute.js';
import oneTimeWarning from '../Core/oneTimeWarning.js';
@@ -37,7 +36,7 @@ import TerrainOffsetProperty from './TerrainOffsetProperty.js';
GroundGeometryUpdater.prototype.constructor = GroundGeometryUpdater;
}
- defineProperties(GroundGeometryUpdater.prototype, {
+ Object.defineProperties(GroundGeometryUpdater.prototype, {
/**
* Gets the zindex
* @type {Number}
diff --git a/Source/DataSources/ImageMaterialProperty.js b/Source/DataSources/ImageMaterialProperty.js
index e88131490ef4..71b950cc4512 100644
--- a/Source/DataSources/ImageMaterialProperty.js
+++ b/Source/DataSources/ImageMaterialProperty.js
@@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
import createPropertyDescriptor from './createPropertyDescriptor.js';
import Property from './Property.js';
@@ -41,7 +40,7 @@ import Property from './Property.js';
this.transparent = options.transparent;
}
- defineProperties(ImageMaterialProperty.prototype, {
+ Object.defineProperties(ImageMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
* constant if getValue always returns the same result for the current definition.
diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js
index a1a8bd2764cb..105a8122d070 100644
--- a/Source/DataSources/KmlDataSource.js
+++ b/Source/DataSources/KmlDataSource.js
@@ -12,7 +12,6 @@ import createGuid from '../Core/createGuid.js';
import Credit from '../Core/Credit.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Ellipsoid from '../Core/Ellipsoid.js';
import Event from '../Core/Event.js';
@@ -191,7 +190,7 @@ import WallGraphics from './WallGraphics.js';
this._timeThreshold = 1000; // Initial load is 1 second
}
- defineProperties(DeferredLoading.prototype, {
+ Object.defineProperties(DeferredLoading.prototype, {
dataSource : {
get : function() {
return this._dataSource;
@@ -1353,6 +1352,9 @@ import WallGraphics from './WallGraphics.js';
if (defined(zIndex)) {
oneTimeWarning('kml-gx:drawOrder', 'KML - gx:drawOrder is not supported in LineStrings when clampToGround is false');
}
+ if (dataSource._clampToGround && !tessellate) {
+ oneTimeWarning('kml-line-tesselate', 'Ignoring clampToGround for KML lines without the tessellate flag.');
+ }
polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics();
entity.polyline = polyline;
@@ -2533,7 +2535,7 @@ import WallGraphics from './WallGraphics.js';
*
* KML support in Cesium is incomplete, but a large amount of the standard,
* as well as Google's gx
extension namespace, is supported. See Github issue
- * {@link https://github.com/AnalyticalGraphicsInc/cesium/issues/873|#873} for a
+ * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
* detailed list of what is and isn't support. Cesium will also write information to the
* console when it encounters most unsupported features.
*
diff --git a/Source/Renderer/Framebuffer.js b/Source/Renderer/Framebuffer.js
index 4c7118b7d247..066d3cdf224b 100644
--- a/Source/Renderer/Framebuffer.js
+++ b/Source/Renderer/Framebuffer.js
@@ -1,7 +1,6 @@
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import PixelFormat from '../Core/PixelFormat.js';
@@ -236,7 +235,7 @@ import PixelDatatype from './PixelDatatype.js';
this._unBind();
}
- defineProperties(Framebuffer.prototype, {
+ Object.defineProperties(Framebuffer.prototype, {
/**
* The status of the framebuffer. If the status is not WebGLConstants.FRAMEBUFFER_COMPLETE,
* a {@link DeveloperError} will be thrown when attempting to render to the framebuffer.
diff --git a/Source/Renderer/MipmapHint.js b/Source/Renderer/MipmapHint.js
index 53c12419a5c6..87e8b2e79c62 100644
--- a/Source/Renderer/MipmapHint.js
+++ b/Source/Renderer/MipmapHint.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -15,4 +14,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(mipmapHint === MipmapHint.NICEST));
}
};
-export default freezeObject(MipmapHint);
+export default Object.freeze(MipmapHint);
diff --git a/Source/Renderer/Pass.js b/Source/Renderer/Pass.js
index 2d9a3d0df1b7..c4e7b8e01900 100644
--- a/Source/Renderer/Pass.js
+++ b/Source/Renderer/Pass.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The render pass for a command.
@@ -25,4 +24,4 @@ import freezeObject from '../Core/freezeObject.js';
OVERLAY : 9,
NUMBER_OF_PASSES : 10
};
-export default freezeObject(Pass);
+export default Object.freeze(Pass);
diff --git a/Source/Renderer/PixelDatatype.js b/Source/Renderer/PixelDatatype.js
index 0f9e2b5bb2e8..f1df40a430a3 100644
--- a/Source/Renderer/PixelDatatype.js
+++ b/Source/Renderer/PixelDatatype.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -51,4 +50,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5));
}
};
-export default freezeObject(PixelDatatype);
+export default Object.freeze(PixelDatatype);
diff --git a/Source/Renderer/RenderState.js b/Source/Renderer/RenderState.js
index 8cba2cab37eb..d0221b58b945 100644
--- a/Source/Renderer/RenderState.js
+++ b/Source/Renderer/RenderState.js
@@ -734,7 +734,7 @@ import freezeRenderState from './freezeRenderState.js';
var scissorTest = (defined(passState.scissorTest)) ? passState.scissorTest : renderState.scissorTest;
// Our scissor rectangle can get out of sync with the GL scissor rectangle on clears.
- // Seems to be a problem only on ANGLE. See https://github.com/AnalyticalGraphicsInc/cesium/issues/2994
+ // Seems to be a problem only on ANGLE. See https://github.com/CesiumGS/cesium/issues/2994
if ((previousScissorTest !== scissorTest) || clear) {
applyScissorTest(gl, renderState, passState);
}
diff --git a/Source/Renderer/Renderbuffer.js b/Source/Renderer/Renderbuffer.js
index 616a600216d6..d9ad6e7f8651 100644
--- a/Source/Renderer/Renderbuffer.js
+++ b/Source/Renderer/Renderbuffer.js
@@ -1,7 +1,6 @@
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import ContextLimits from './ContextLimits.js';
@@ -54,7 +53,7 @@ import RenderbufferFormat from './RenderbufferFormat.js';
gl.bindRenderbuffer(gl.RENDERBUFFER, null);
}
- defineProperties(Renderbuffer.prototype, {
+ Object.defineProperties(Renderbuffer.prototype, {
format: {
get : function() {
return this._format;
diff --git a/Source/Renderer/RenderbufferFormat.js b/Source/Renderer/RenderbufferFormat.js
index 209cff56e615..e182eff32380 100644
--- a/Source/Renderer/RenderbufferFormat.js
+++ b/Source/Renderer/RenderbufferFormat.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -21,4 +20,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(renderbufferFormat === RenderbufferFormat.DEPTH_STENCIL));
}
};
-export default freezeObject(RenderbufferFormat);
+export default Object.freeze(RenderbufferFormat);
diff --git a/Source/Renderer/Sampler.js b/Source/Renderer/Sampler.js
index 7ac700d67576..447c2d3cf603 100644
--- a/Source/Renderer/Sampler.js
+++ b/Source/Renderer/Sampler.js
@@ -1,7 +1,6 @@
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import TextureMagnificationFilter from './TextureMagnificationFilter.js';
import TextureMinificationFilter from './TextureMinificationFilter.js';
@@ -46,7 +45,7 @@ import TextureWrap from './TextureWrap.js';
this._maximumAnisotropy = maximumAnisotropy;
}
- defineProperties(Sampler.prototype, {
+ Object.defineProperties(Sampler.prototype, {
wrapS : {
get : function() {
return this._wrapS;
@@ -84,4 +83,11 @@ import TextureWrap from './TextureWrap.js';
(left._magnificationFilter === right._magnificationFilter) &&
(left._maximumAnisotropy === right._maximumAnisotropy));
};
+
+ Sampler.NEAREST = Object.freeze(new Sampler({
+ wrapS : TextureWrap.CLAMP_TO_EDGE,
+ wrapT : TextureWrap.CLAMP_TO_EDGE,
+ minificationFilter : TextureMinificationFilter.NEAREST,
+ magnificationFilter : TextureMagnificationFilter.NEAREST
+ }));
export default Sampler;
diff --git a/Source/Renderer/ShaderCache.js b/Source/Renderer/ShaderCache.js
index ddae1d890af0..940bf8616313 100644
--- a/Source/Renderer/ShaderCache.js
+++ b/Source/Renderer/ShaderCache.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import ShaderProgram from './ShaderProgram.js';
import ShaderSource from './ShaderSource.js';
@@ -14,7 +13,7 @@ import ShaderSource from './ShaderSource.js';
this._shadersToRelease = {};
}
- defineProperties(ShaderCache.prototype, {
+ Object.defineProperties(ShaderCache.prototype, {
numberOfShaders : {
get : function() {
return this._numberOfShaders;
diff --git a/Source/Renderer/ShaderProgram.js b/Source/Renderer/ShaderProgram.js
index c9b92fa0e36b..c4f04d165b2f 100644
--- a/Source/Renderer/ShaderProgram.js
+++ b/Source/Renderer/ShaderProgram.js
@@ -1,7 +1,6 @@
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import RuntimeError from '../Core/RuntimeError.js';
@@ -80,7 +79,7 @@ import createUniformArray from './createUniformArray.js';
return options.context.shaderCache.replaceShaderProgram(options);
};
- defineProperties(ShaderProgram.prototype, {
+ Object.defineProperties(ShaderProgram.prototype, {
/**
* GLSL source for the shader program's vertex shader.
* @memberof ShaderProgram.prototype
diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js
index 8cb16d776e7f..f4aa7bd5bad2 100644
--- a/Source/Renderer/Texture.js
+++ b/Source/Renderer/Texture.js
@@ -3,7 +3,6 @@ import Check from '../Core/Check.js';
import createGuid from '../Core/createGuid.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import CesiumMath from '../Core/Math.js';
@@ -346,7 +345,7 @@ import TextureMinificationFilter from './TextureMinificationFilter.js';
return texture;
};
- defineProperties(Texture.prototype, {
+ Object.defineProperties(Texture.prototype, {
/**
* A unique id for the texture
* @memberof Texture.prototype
diff --git a/Source/Renderer/TextureCache.js b/Source/Renderer/TextureCache.js
index 03f1dc36d16e..fbf92085ff35 100644
--- a/Source/Renderer/TextureCache.js
+++ b/Source/Renderer/TextureCache.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
/**
@@ -11,7 +10,7 @@ import destroyObject from '../Core/destroyObject.js';
this._texturesToRelease = {};
}
- defineProperties(TextureCache.prototype, {
+ Object.defineProperties(TextureCache.prototype, {
numberOfTextures : {
get : function() {
return this._numberOfTextures;
diff --git a/Source/Renderer/TextureMagnificationFilter.js b/Source/Renderer/TextureMagnificationFilter.js
index abff1542da2b..1bc96a18f562 100644
--- a/Source/Renderer/TextureMagnificationFilter.js
+++ b/Source/Renderer/TextureMagnificationFilter.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -37,4 +36,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(textureMagnificationFilter === TextureMagnificationFilter.LINEAR));
}
};
-export default freezeObject(TextureMagnificationFilter);
+export default Object.freeze(TextureMagnificationFilter);
diff --git a/Source/Renderer/TextureMinificationFilter.js b/Source/Renderer/TextureMinificationFilter.js
index f3e81d963157..90db4ee93cf3 100644
--- a/Source/Renderer/TextureMinificationFilter.js
+++ b/Source/Renderer/TextureMinificationFilter.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -86,4 +85,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR));
}
};
-export default freezeObject(TextureMinificationFilter);
+export default Object.freeze(TextureMinificationFilter);
diff --git a/Source/Renderer/TextureWrap.js b/Source/Renderer/TextureWrap.js
index d78cf625e868..c5e09ad6a9c9 100644
--- a/Source/Renderer/TextureWrap.js
+++ b/Source/Renderer/TextureWrap.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -15,4 +14,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
(textureWrap === TextureWrap.MIRRORED_REPEAT));
}
};
-export default freezeObject(TextureWrap);
+export default Object.freeze(TextureWrap);
diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js
index b643eb3ed313..298e123004a7 100644
--- a/Source/Renderer/UniformState.js
+++ b/Source/Renderer/UniformState.js
@@ -6,7 +6,7 @@ import Cartographic from '../Core/Cartographic.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
+import Ellipsoid from '../Core/Ellipsoid.js';
import EncodedCartesian3 from '../Core/EncodedCartesian3.js';
import CesiumMath from '../Core/Math.js';
import Matrix3 from '../Core/Matrix3.js';
@@ -44,9 +44,9 @@ import SunLight from '../Scene/SunLight.js';
this._entireFrustum = new Cartesian2();
this._currentFrustum = new Cartesian2();
this._frustumPlanes = new Cartesian4();
- this._log2FarDistance = undefined;
- this._log2FarPlusOne = undefined;
- this._log2NearDistance = undefined;
+ this._farDepthFromNearPlusOne = undefined;
+ this._log2FarDepthFromNearPlusOne = undefined;
+ this._oneOverLog2FarDepthFromNearPlusOne = undefined;
this._frameState = undefined;
this._temeToPseudoFixed = Matrix3.clone(Matrix4.IDENTITY);
@@ -136,6 +136,7 @@ import SunLight from '../Scene/SunLight.js';
this._pass = undefined;
this._mode = undefined;
this._mapProjection = undefined;
+ this._ellipsoid = undefined;
this._cameraDirection = new Cartesian3();
this._cameraRight = new Cartesian3();
this._cameraUp = new Cartesian3();
@@ -164,7 +165,7 @@ import SunLight from '../Scene/SunLight.js';
this._minimumDisableDepthTestDistance = undefined;
}
- defineProperties(UniformState.prototype, {
+ Object.defineProperties(UniformState.prototype, {
/**
* @memberof UniformState.prototype
* @type {FrameState}
@@ -638,35 +639,38 @@ import SunLight from '../Scene/SunLight.js';
},
/**
- * The log2 of the current frustum's far distance. Used to compute the log depth.
+ * The far plane's distance from the near plane, plus 1.0.
+ *
* @memberof UniformState.prototype
* @type {Number}
*/
- log2FarDistance : {
+ farDepthFromNearPlusOne : {
get : function() {
- return this._log2FarDistance;
+ return this._farDepthFromNearPlusOne;
}
},
/**
- * The log2 of 1 + the current frustum's far distance. Used to reverse log depth.
+ * The log2 of {@link UniformState#farDepthFromNearPlusOne}.
+ *
* @memberof UniformState.prototype
* @type {Number}
*/
- log2FarPlusOne : {
+ log2FarDepthFromNearPlusOne : {
get : function() {
- return this._log2FarPlusOne;
+ return this._log2FarDepthFromNearPlusOne;
}
},
/**
- * The log2 current frustum's near distance. Used when writing log depth in the fragment shader.
+ * 1.0 divided by {@link UniformState#log2FarDepthFromNearPlusOne}.
+ *
* @memberof UniformState.prototype
* @type {Number}
*/
- log2NearDistance : {
+ oneOverLog2FarDepthFromNearPlusOne : {
get : function() {
- return this._log2NearDistance;
+ return this._oneOverLog2FarDepthFromNearPlusOne;
}
},
@@ -996,6 +1000,18 @@ import SunLight from '../Scene/SunLight.js';
get : function() {
return this._orthographicIn3D;
}
+ },
+
+ /**
+ * The current ellipsoid.
+ *
+ * @memberOf UniformState.prototype
+ * @type {Ellipsoid}
+ */
+ ellipsoid : {
+ get : function() {
+ return defaultValue(this._ellipsoid, Ellipsoid.WGS84);
+ }
}
});
@@ -1110,9 +1126,9 @@ import SunLight from '../Scene/SunLight.js';
this._currentFrustum.x = frustum.near;
this._currentFrustum.y = frustum.far;
- this._log2FarDistance = 2.0 / CesiumMath.log2(frustum.far + 1.0);
- this._log2FarPlusOne = CesiumMath.log2(frustum.far + 1.0);
- this._log2NearDistance = CesiumMath.log2(frustum.near);
+ this._farDepthFromNearPlusOne = (frustum.far - frustum.near) + 1.0;
+ this._log2FarDepthFromNearPlusOne = CesiumMath.log2(this._farDepthFromNearPlusOne);
+ this._oneOverLog2FarDepthFromNearPlusOne = 1.0 / this._log2FarDepthFromNearPlusOne;
if (defined(frustum._offCenterFrustum)) {
frustum = frustum._offCenterFrustum;
@@ -1141,6 +1157,7 @@ import SunLight from '../Scene/SunLight.js';
UniformState.prototype.update = function(frameState) {
this._mode = frameState.mode;
this._mapProjection = frameState.mapProjection;
+ this._ellipsoid = frameState.mapProjection.ellipsoid;
this._pixelRatio = frameState.pixelRatio;
var camera = frameState.camera;
diff --git a/Source/Renderer/VertexArray.js b/Source/Renderer/VertexArray.js
index 29520452579e..e03cade7dc80 100644
--- a/Source/Renderer/VertexArray.js
+++ b/Source/Renderer/VertexArray.js
@@ -2,7 +2,6 @@ import Check from '../Core/Check.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Geometry from '../Core/Geometry.js';
@@ -624,7 +623,7 @@ import ContextLimits from './ContextLimits.js';
});
};
- defineProperties(VertexArray.prototype, {
+ Object.defineProperties(VertexArray.prototype, {
numberOfAttributes : {
get : function() {
return this._attributes.length;
diff --git a/Source/Renderer/freezeRenderState.js b/Source/Renderer/freezeRenderState.js
index abd065214b16..71de888fdb3e 100644
--- a/Source/Renderer/freezeRenderState.js
+++ b/Source/Renderer/freezeRenderState.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* Returns frozen renderState as well as all of the object literal properties. This function is deep object freeze
@@ -24,6 +23,6 @@ import freezeObject from '../Core/freezeObject.js';
renderState[propName] = freezeRenderState(renderState[propName]);
}
}
- return freezeObject(renderState);
+ return Object.freeze(renderState);
}
export default freezeRenderState;
diff --git a/Source/Scene/Appearance.js b/Source/Scene/Appearance.js
index 6fcb5b3810bb..19720803a6e6 100644
--- a/Source/Scene/Appearance.js
+++ b/Source/Scene/Appearance.js
@@ -2,7 +2,6 @@ import clone from '../Core/clone.js';
import combine from '../Core/combine.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import BlendingState from './BlendingState.js';
import CullFace from './CullFace.js';
@@ -41,7 +40,7 @@ import CullFace from './CullFace.js';
*
* @type Material
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric}
+ * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}
*/
this.material = options.material;
@@ -60,7 +59,7 @@ import CullFace from './CullFace.js';
this._closed = defaultValue(options.closed, false);
}
- defineProperties(Appearance.prototype, {
+ Object.defineProperties(Appearance.prototype, {
/**
* The GLSL source code for the vertex shader.
*
diff --git a/Source/Scene/ArcGisMapServerImageryProvider.js b/Source/Scene/ArcGisMapServerImageryProvider.js
index 1ba31ba133e4..cd619b390b3e 100644
--- a/Source/Scene/ArcGisMapServerImageryProvider.js
+++ b/Source/Scene/ArcGisMapServerImageryProvider.js
@@ -4,7 +4,6 @@ import Cartographic from '../Core/Cartographic.js';
import Credit from '../Core/Credit.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import GeographicProjection from '../Core/GeographicProjection.js';
@@ -263,7 +262,7 @@ import ImageryProvider from './ImageryProvider.js';
return resource;
}
- defineProperties(ArcGisMapServerImageryProvider.prototype, {
+ Object.defineProperties(ArcGisMapServerImageryProvider.prototype, {
/**
* Gets the URL of the ArcGIS MapServer.
* @memberof ArcGisMapServerImageryProvider.prototype
diff --git a/Source/Scene/AttributeType.js b/Source/Scene/AttributeType.js
index 0a6e8abbb696..4680c605285b 100644
--- a/Source/Scene/AttributeType.js
+++ b/Source/Scene/AttributeType.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* An enum describing the attribute type for glTF and 3D Tiles.
@@ -64,4 +63,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
MAT4 : 'MAT4'
};
-export default freezeObject(AttributeType);
+export default Object.freeze(AttributeType);
diff --git a/Source/Scene/AutoExposure.js b/Source/Scene/AutoExposure.js
index e1796ce3ccb4..1f1432b4ed46 100644
--- a/Source/Scene/AutoExposure.js
+++ b/Source/Scene/AutoExposure.js
@@ -1,7 +1,6 @@
import Cartesian2 from '../Core/Cartesian2.js';
import Color from '../Core/Color.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import PixelFormat from '../Core/PixelFormat.js';
import ClearCommand from '../Renderer/ClearCommand.js';
@@ -9,9 +8,6 @@ import Framebuffer from '../Renderer/Framebuffer.js';
import PixelDatatype from '../Renderer/PixelDatatype.js';
import Sampler from '../Renderer/Sampler.js';
import Texture from '../Renderer/Texture.js';
-import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js';
-import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js';
-import TextureWrap from '../Renderer/TextureWrap.js';
/**
* A post process stage that will get the luminance value at each pixel and
@@ -68,7 +64,7 @@ import TextureWrap from '../Renderer/TextureWrap.js';
this.maximumLuminance = 10.0;
}
- defineProperties(AutoExposure.prototype, {
+ Object.defineProperties(AutoExposure.prototype, {
/**
* Determines if this post-process stage is ready to be executed. A stage is only executed when both ready
* and {@link AutoExposure#enabled} are true
. A stage will not be ready while it is waiting on textures
@@ -139,12 +135,6 @@ import TextureWrap from '../Renderer/TextureWrap.js';
var pixelFormat = PixelFormat.RGBA;
var pixelDatatype = context.halfFloatingPointTexture ? PixelDatatype.HALF_FLOAT : PixelDatatype.FLOAT;
- var sampler = new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- });
var length = Math.ceil(Math.log(Math.max(width, height)) / Math.log(3.0));
var framebuffers = new Array(length);
@@ -159,7 +149,7 @@ import TextureWrap from '../Renderer/TextureWrap.js';
height : height,
pixelFormat : pixelFormat,
pixelDatatype : pixelDatatype,
- sampler : sampler
+ sampler : Sampler.NEAREST
})]
});
}
@@ -173,7 +163,7 @@ import TextureWrap from '../Renderer/TextureWrap.js';
height : lastTexture.height,
pixelFormat : pixelFormat,
pixelDatatype : pixelDatatype,
- sampler : sampler
+ sampler : Sampler.NEAREST
})]
});
diff --git a/Source/Scene/Axis.js b/Source/Scene/Axis.js
index ad25abe3e7f2..353ab54d5751 100644
--- a/Source/Scene/Axis.js
+++ b/Source/Scene/Axis.js
@@ -1,5 +1,4 @@
import Check from '../Core/Check.js';
-import freezeObject from '../Core/freezeObject.js';
import CesiumMath from '../Core/Math.js';
import Matrix3 from '../Core/Matrix3.js';
import Matrix4 from '../Core/Matrix4.js';
@@ -97,4 +96,4 @@ import Matrix4 from '../Core/Matrix4.js';
return Axis[name];
}
};
-export default freezeObject(Axis);
+export default Object.freeze(Axis);
diff --git a/Source/Scene/BatchTable.js b/Source/Scene/BatchTable.js
index d123cc1c683b..ec61aadf3855 100644
--- a/Source/Scene/BatchTable.js
+++ b/Source/Scene/BatchTable.js
@@ -4,7 +4,6 @@ import Cartesian4 from '../Core/Cartesian4.js';
import combine from '../Core/combine.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import PixelFormat from '../Core/PixelFormat.js';
@@ -12,8 +11,6 @@ import ContextLimits from '../Renderer/ContextLimits.js';
import PixelDatatype from '../Renderer/PixelDatatype.js';
import Sampler from '../Renderer/Sampler.js';
import Texture from '../Renderer/Texture.js';
-import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js';
-import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js';
/**
* Creates a texture to look up per instance attributes for batched primitives. For example, store each primitive's pick color in the texture.
@@ -119,7 +116,7 @@ import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'
this._batchValuesDirty = false;
}
- defineProperties(BatchTable.prototype, {
+ Object.defineProperties(BatchTable.prototype, {
/**
* The attribute descriptions.
* @memberOf BatchTable.prototype
@@ -341,10 +338,7 @@ import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'
pixelDatatype : batchTable._pixelDatatype,
width : dimensions.x,
height : dimensions.y,
- sampler : new Sampler({
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- }),
+ sampler : Sampler.NEAREST,
flipY : false
});
}
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 6b8ed57baf8c..c41239b26d0e 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -3,7 +3,6 @@ import Color from '../Core/Color.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import deprecationWarning from '../Core/deprecationWarning.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
@@ -22,8 +21,8 @@ import ModelUtility from './ModelUtility.js';
/**
* Represents the contents of a
- * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel|Batched 3D Model}
- * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset.
+ * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel|Batched 3D Model}
+ * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset.
*
* Implements the {@link Cesium3DTileContent} interface. *
@@ -56,7 +55,7 @@ import ModelUtility from './ModelUtility.js'; // This can be overridden for testing purposes Batched3DModel3DTileContent._deprecationWarning = deprecationWarning; - defineProperties(Batched3DModel3DTileContent.prototype, { + Object.defineProperties(Batched3DModel3DTileContent.prototype, { featuresLength : { get : function() { return this._batchTable.featuresLength; @@ -242,7 +241,7 @@ import ModelUtility from './ModelUtility.js'; batchTableBinaryByteLength = 0; featureTableJsonByteLength = 0; featureTableBinaryByteLength = 0; - Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); + Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); } else if (batchTableBinaryByteLength >= 570425344) { // Second legacy check byteOffset -= sizeOfUint32; @@ -251,7 +250,7 @@ import ModelUtility from './ModelUtility.js'; batchTableBinaryByteLength = featureTableBinaryByteLength; featureTableJsonByteLength = 0; featureTableBinaryByteLength = 0; - Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); + Batched3DModel3DTileContent._deprecationWarning('b3dm-legacy-header', 'This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.'); } var featureTableJson; diff --git a/Source/Scene/Billboard.js b/Source/Scene/Billboard.js index fa47d2956735..720eb199e478 100644 --- a/Source/Scene/Billboard.js +++ b/Source/Scene/Billboard.js @@ -7,7 +7,6 @@ import Color from '../Core/Color.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -206,7 +205,7 @@ import VerticalOrigin from './VerticalOrigin.js'; } } - defineProperties(Billboard.prototype, { + Object.defineProperties(Billboard.prototype, { /** * Determines if this billboard will be shown. Use this to hide or show a billboard, instead * of removing it and re-adding it to the collection. diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index 8083dec61d1a..9ce98213dc20 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -6,7 +6,6 @@ import Color from '../Core/Color.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import EncodedCartesian3 from '../Core/EncodedCartesian3.js'; @@ -316,7 +315,7 @@ import VerticalOrigin from './VerticalOrigin.js'; } } - defineProperties(BillboardCollection.prototype, { + Object.defineProperties(BillboardCollection.prototype, { /** * Returns the number of billboards in this collection. This is commonly used with * {@link BillboardCollection#get} to iterate over all the billboards diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index 95445a84cae9..0e5c7cd78514 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -4,7 +4,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import CesiumMath from '../Core/Math.js'; @@ -205,7 +204,7 @@ import ImageryProvider from './ImageryProvider.js'; } } - defineProperties(BingMapsImageryProvider.prototype, { + Object.defineProperties(BingMapsImageryProvider.prototype, { /** * Gets the name of the BingMaps server url hosting the imagery. * @memberof BingMapsImageryProvider.prototype @@ -617,7 +616,7 @@ import ImageryProvider from './ImageryProvider.js'; BingMapsImageryProvider._logoUrl = undefined; - defineProperties(BingMapsImageryProvider, { + Object.defineProperties(BingMapsImageryProvider, { /** * Gets or sets the URL to the Bing logo for display in the credit. * @memberof BingMapsImageryProvider diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index 8aa3e45891e7..fab2f34d8847 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * The types of imagery provided by Bing Maps. @@ -21,7 +20,7 @@ import freezeObject from '../Core/freezeObject.js'; * * @type {String} * @constant - * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/7128. + * @deprecated See https://github.com/CesiumGS/cesium/issues/7128. * Use `BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND` instead */ AERIAL_WITH_LABELS : 'AerialWithLabels', @@ -39,7 +38,7 @@ import freezeObject from '../Core/freezeObject.js'; * * @type {String} * @constant - * @deprecated See https://github.com/AnalyticalGraphicsInc/cesium/issues/7128. + * @deprecated See https://github.com/CesiumGS/cesium/issues/7128. * Use `BingMapsStyle.ROAD_ON_DEMAND` instead */ ROAD : 'Road', @@ -92,4 +91,4 @@ import freezeObject from '../Core/freezeObject.js'; */ COLLINS_BART : 'CollinsBart' }; -export default freezeObject(BingMapsStyle); +export default Object.freeze(BingMapsStyle); diff --git a/Source/Scene/BlendEquation.js b/Source/Scene/BlendEquation.js index cff57f7efb71..38f7316ff06b 100644 --- a/Source/Scene/BlendEquation.js +++ b/Source/Scene/BlendEquation.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -51,4 +50,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ MAX : WebGLConstants.MAX }; -export default freezeObject(BlendEquation); +export default Object.freeze(BlendEquation); diff --git a/Source/Scene/BlendFunction.js b/Source/Scene/BlendFunction.js index 50f817a24f63..be425dd9f01c 100644 --- a/Source/Scene/BlendFunction.js +++ b/Source/Scene/BlendFunction.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import WebGLConstants from '../Core/WebGLConstants.js'; /** @@ -127,4 +126,4 @@ import WebGLConstants from '../Core/WebGLConstants.js'; */ SOURCE_ALPHA_SATURATE : WebGLConstants.SRC_ALPHA_SATURATE }; -export default freezeObject(BlendFunction); +export default Object.freeze(BlendFunction); diff --git a/Source/Scene/BlendOption.js b/Source/Scene/BlendOption.js index 74e0f9f0c7fa..13fc9fc8343a 100644 --- a/Source/Scene/BlendOption.js +++ b/Source/Scene/BlendOption.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. @@ -27,4 +26,4 @@ import freezeObject from '../Core/freezeObject.js'; */ OPAQUE_AND_TRANSLUCENT : 2 }; -export default freezeObject(BlendOption); +export default Object.freeze(BlendOption); diff --git a/Source/Scene/BlendingState.js b/Source/Scene/BlendingState.js index 56d167bd77e0..46551894a695 100644 --- a/Source/Scene/BlendingState.js +++ b/Source/Scene/BlendingState.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; import BlendEquation from './BlendEquation.js'; import BlendFunction from './BlendFunction.js'; @@ -19,7 +18,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - DISABLED : freezeObject({ + DISABLED : Object.freeze({ enabled : false }), @@ -29,7 +28,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - ALPHA_BLEND : freezeObject({ + ALPHA_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -45,7 +44,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - PRE_MULTIPLIED_ALPHA_BLEND : freezeObject({ + PRE_MULTIPLIED_ALPHA_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -61,7 +60,7 @@ import BlendFunction from './BlendFunction.js'; * @type {Object} * @constant */ - ADDITIVE_BLEND : freezeObject({ + ADDITIVE_BLEND : Object.freeze({ enabled : true, equationRgb : BlendEquation.ADD, equationAlpha : BlendEquation.ADD, @@ -71,4 +70,4 @@ import BlendFunction from './BlendFunction.js'; functionDestinationAlpha : BlendFunction.ONE }) }; -export default freezeObject(BlendingState); +export default Object.freeze(BlendingState); diff --git a/Source/Scene/BoxEmitter.js b/Source/Scene/BoxEmitter.js index d10abdd4b5ae..c00991bf494a 100644 --- a/Source/Scene/BoxEmitter.js +++ b/Source/Scene/BoxEmitter.js @@ -1,7 +1,6 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; -import defineProperties from '../Core/defineProperties.js'; import CesiumMath from '../Core/Math.js'; var defaultDimensions = new Cartesian3(1.0, 1.0, 1.0); @@ -28,7 +27,7 @@ import CesiumMath from '../Core/Math.js'; this._dimensions = Cartesian3.clone(dimensions); } - defineProperties(BoxEmitter.prototype, { + Object.defineProperties(BoxEmitter.prototype, { /** * The width, height and depth dimensions of the box in meters. * @memberof BoxEmitter.prototype diff --git a/Source/Scene/BrdfLutGenerator.js b/Source/Scene/BrdfLutGenerator.js index 0e0c789569ab..1828ed58b102 100644 --- a/Source/Scene/BrdfLutGenerator.js +++ b/Source/Scene/BrdfLutGenerator.js @@ -1,6 +1,5 @@ import BoundingRectangle from '../Core/BoundingRectangle.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import Framebuffer from '../Renderer/Framebuffer.js'; @@ -8,9 +7,6 @@ import PixelDatatype from '../Renderer/PixelDatatype.js'; import RenderState from '../Renderer/RenderState.js'; import Sampler from '../Renderer/Sampler.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; -import TextureWrap from '../Renderer/TextureWrap.js'; import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; /** @@ -22,7 +18,7 @@ import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; this._drawCommand = undefined; } - defineProperties(BrdfLutGenerator.prototype, { + Object.defineProperties(BrdfLutGenerator.prototype, { colorTexture : { get : function() { return this._colorTexture; @@ -50,12 +46,7 @@ import BrdfLutGeneratorFS from '../Shaders/BrdfLutGeneratorFS.js'; height: 256, pixelFormat : PixelFormat.RGBA, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, - sampler : new Sampler({ - wrapS : TextureWrap.CLAMP_TO_EDGE, - wrapT : TextureWrap.CLAMP_TO_EDGE, - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); generator._colorTexture = colorTexture; diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index af5e69bbe713..413c9a7b7e40 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -5,7 +5,6 @@ import Cartesian4 from '../Core/Cartesian4.js'; import Cartographic from '../Core/Cartographic.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import EasingFunction from '../Core/EasingFunction.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -606,7 +605,7 @@ import SceneMode from './SceneMode.js'; var scratchHPRMatrix1 = new Matrix4(); var scratchHPRMatrix2 = new Matrix4(); - defineProperties(Camera.prototype, { + Object.defineProperties(Camera.prototype, { /** * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix. * @memberof Camera.prototype diff --git a/Source/Scene/CameraEventAggregator.js b/Source/Scene/CameraEventAggregator.js index 28bf632a2d4b..33acfed2f32e 100644 --- a/Source/Scene/CameraEventAggregator.js +++ b/Source/Scene/CameraEventAggregator.js @@ -1,6 +1,5 @@ import Cartesian2 from '../Core/Cartesian2.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import KeyboardEventModifier from '../Core/KeyboardEventModifier.js'; @@ -285,7 +284,7 @@ import CameraEventType from './CameraEventType.js'; } } - defineProperties(CameraEventAggregator.prototype, { + Object.defineProperties(CameraEventAggregator.prototype, { /** * Gets the current mouse position. * @memberof CameraEventAggregator.prototype diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index 940cf8de379d..83da142f4be4 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Enumerates the available input for interacting with the camera. @@ -46,4 +45,4 @@ import freezeObject from '../Core/freezeObject.js'; */ PINCH : 4 }; -export default freezeObject(CameraEventType); +export default Object.freeze(CameraEventType); diff --git a/Source/Scene/Cesium3DTile.js b/Source/Scene/Cesium3DTile.js index 96c4f848aa5a..9e062c118d3c 100644 --- a/Source/Scene/Cesium3DTile.js +++ b/Source/Scene/Cesium3DTile.js @@ -5,7 +5,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu import CullingVolume from '../Core/CullingVolume.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import Ellipsoid from '../Core/Ellipsoid.js'; @@ -336,7 +335,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; // This can be overridden for testing purposes Cesium3DTile._deprecationWarning = deprecationWarning; - defineProperties(Cesium3DTile.prototype, { + Object.defineProperties(Cesium3DTile.prototype, { /** * The tileset containing this tile. * @@ -420,7 +419,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * * @type {*} * @readonly - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.} */ extras : { get : function() { @@ -556,6 +555,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; if (defined(this._contentReadyToProcessPromise)) { return this._contentReadyToProcessPromise.promise; } + return undefined; } }, @@ -575,6 +575,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; if (defined(this._contentReadyPromise)) { return this._contentReadyPromise.promise; } + return undefined; } }, @@ -1211,8 +1212,8 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; this.geometricError = this._geometricError * uniformScale; }; - function applyDebugSettings(tile, tileset, frameState) { - if (!frameState.passes.render) { + function applyDebugSettings(tile, tileset, frameState, passOptions) { + if (!passOptions.isRender) { return; } @@ -1320,10 +1321,10 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * * @private */ - Cesium3DTile.prototype.update = function(tileset, frameState) { + Cesium3DTile.prototype.update = function(tileset, frameState, passOptions) { var initCommandLength = frameState.commandList.length; updateClippingPlanes(this, tileset); - applyDebugSettings(this, tileset, frameState); + applyDebugSettings(this, tileset, frameState, passOptions); updateContent(this, tileset, frameState); this._commandsLength = frameState.commandList.length - initCommandLength; diff --git a/Source/Scene/Cesium3DTileBatchTable.js b/Source/Scene/Cesium3DTileBatchTable.js index 2fdf11e3f221..b0045770c0c6 100644 --- a/Source/Scene/Cesium3DTileBatchTable.js +++ b/Source/Scene/Cesium3DTileBatchTable.js @@ -8,7 +8,6 @@ import combine from '../Core/combine.js'; import ComponentDatatype from '../Core/ComponentDatatype.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -23,8 +22,6 @@ import RenderState from '../Renderer/RenderState.js'; import Sampler from '../Renderer/Sampler.js'; import ShaderSource from '../Renderer/ShaderSource.js'; import Texture from '../Renderer/Texture.js'; -import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js'; -import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js'; import AttributeType from './AttributeType.js'; import BlendingState from './BlendingState.js'; import Cesium3DTileColorBlendMode from './Cesium3DTileColorBlendMode.js'; @@ -101,7 +98,7 @@ import StencilOperation from './StencilOperation.js'; // This can be overridden for testing purposes Cesium3DTileBatchTable._deprecationWarning = deprecationWarning; - defineProperties(Cesium3DTileBatchTable.prototype, { + Object.defineProperties(Cesium3DTileBatchTable.prototype, { memorySizeInBytes : { get : function() { var memory = 0; @@ -1330,13 +1327,14 @@ import StencilOperation from './StencilOperation.js'; return derivedCommand; } - function getDisableLogDepthFragmentShaderProgram(context, shaderProgram) { + function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) { var shader = context.shaderCache.getDerivedShaderProgram(shaderProgram, 'zBackfaceLogDepth'); if (!defined(shader)) { var fs = shaderProgram.fragmentShaderSource.clone(); fs.defines = defined(fs.defines) ? fs.defines.slice(0) : []; - fs.defines.push('DISABLE_LOG_DEPTH_FRAGMENT_WRITE'); + fs.defines.push('POLYGON_OFFSET'); + fs.sources.unshift('#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n'); shader = context.shaderCache.createDerivedShaderProgram(shaderProgram, 'zBackfaceLogDepth', { vertexShaderSource : shaderProgram.vertexShaderSource, fragmentShaderSource : fs, @@ -1374,9 +1372,17 @@ import StencilOperation from './StencilOperation.js'; derivedCommand.renderState = RenderState.fromCache(rs); derivedCommand.castShadows = false; derivedCommand.receiveShadows = false; - // Disable the depth writes in the fragment shader. The back face commands were causing the higher resolution + derivedCommand.uniformMap = clone(command.uniformMap); + + var polygonOffset = new Cartesian2(5.0, 5.0); + derivedCommand.uniformMap.u_polygonOffset = function() { + return polygonOffset; + }; + + // Make the log depth depth fragment write account for the polygon offset, too. + // Otherwise, the back face commands will cause the higher resolution // tiles to disappear. - derivedCommand.shaderProgram = getDisableLogDepthFragmentShaderProgram(context, command.shaderProgram); + derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram(context, command.shaderProgram); return derivedCommand; } @@ -1436,10 +1442,7 @@ import StencilOperation from './StencilOperation.js'; arrayBufferView : bytes }, flipY : false, - sampler : new Sampler({ - minificationFilter : TextureMinificationFilter.NEAREST, - magnificationFilter : TextureMagnificationFilter.NEAREST - }) + sampler : Sampler.NEAREST }); } diff --git a/Source/Scene/Cesium3DTileColorBlendMode.js b/Source/Scene/Cesium3DTileColorBlendMode.js index 782f052d9656..167d91dcbe65 100644 --- a/Source/Scene/Cesium3DTileColorBlendMode.js +++ b/Source/Scene/Cesium3DTileColorBlendMode.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from @@ -51,4 +50,4 @@ import freezeObject from '../Core/freezeObject.js'; */ MIX : 2 }; -export default freezeObject(Cesium3DTileColorBlendMode); +export default Object.freeze(Cesium3DTileColorBlendMode); diff --git a/Source/Scene/Cesium3DTileContent.js b/Source/Scene/Cesium3DTileContent.js index eeb4fe455319..673b65c78965 100644 --- a/Source/Scene/Cesium3DTileContent.js +++ b/Source/Scene/Cesium3DTileContent.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -30,7 +29,7 @@ import DeveloperError from '../Core/DeveloperError.js'; this.featurePropertiesDirty = false; } - defineProperties(Cesium3DTileContent.prototype, { + Object.defineProperties(Cesium3DTileContent.prototype, { /** * Gets the number of features in the tile. * @@ -40,7 +39,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * @readonly */ featuresLength : { - get : function() { + get : function() { // eslint-disable-line getter-return DeveloperError.throwInstantiationError(); } }, @@ -52,7 +51,7 @@ import DeveloperError from '../Core/DeveloperError.js'; * equals the number of groups of points as distinguished by theBATCH_ID
feature table semantic.
*
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/PointCloud#batched-points}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/PointCloud#batched-points}
*
* @memberof Cesium3DTileContent.prototype
*
@@ -60,7 +59,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
pointsLength : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -74,7 +73,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
trianglesLength : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -88,7 +87,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
geometryByteLength : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -102,7 +101,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
texturesByteLength : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -116,7 +115,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
batchTableByteLength : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -125,7 +124,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* Gets the array of {@link Cesium3DTileContent} objects that represent the
* content a composite's inner tiles, which can also be composites.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Composite}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Composite}
*
* @memberof Cesium3DTileContent.prototype
*
@@ -133,7 +132,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
innerContents : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -147,7 +146,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
readyPromise : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -161,7 +160,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
tileset : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -175,7 +174,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
tile : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -188,7 +187,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @readonly
*/
url : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
},
@@ -206,7 +205,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* @private
*/
batchTable : {
- get : function() {
+ get : function() { // eslint-disable-line getter-return
DeveloperError.throwInstantiationError();
}
}
@@ -232,7 +231,7 @@ import DeveloperError from '../Core/DeveloperError.js';
* Features in a tile are ordered by batchId
, an index used to retrieve their metadata from the batch table.
*
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/BatchTable}.
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/BatchTable}.
*
* @param {Number} batchId The batchId for the feature.
* @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
diff --git a/Source/Scene/Cesium3DTileContentState.js b/Source/Scene/Cesium3DTileContentState.js
index 9de389d87cd7..5379a9de79e4 100644
--- a/Source/Scene/Cesium3DTileContentState.js
+++ b/Source/Scene/Cesium3DTileContentState.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* @private
@@ -11,4 +10,4 @@ import freezeObject from '../Core/freezeObject.js';
EXPIRED : 4, // Is expired and will be unloaded once new content is loaded.
FAILED : 5 // Request failed.
};
-export default freezeObject(Cesium3DTileContentState);
+export default Object.freeze(Cesium3DTileContentState);
diff --git a/Source/Scene/Cesium3DTileFeature.js b/Source/Scene/Cesium3DTileFeature.js
index 8b678f7df39b..67204e2ed9d5 100644
--- a/Source/Scene/Cesium3DTileFeature.js
+++ b/Source/Scene/Cesium3DTileFeature.js
@@ -1,6 +1,5 @@
import Color from '../Core/Color.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
/**
* A feature of a {@link Cesium3DTileset}.
@@ -43,7 +42,7 @@ import defineProperties from '../Core/defineProperties.js';
this._color = undefined; // for calling getColor
}
- defineProperties(Cesium3DTileFeature.prototype, {
+ Object.defineProperties(Cesium3DTileFeature.prototype, {
/**
* Gets or sets if the feature will be shown. This is set for all features
* when a style's show is evaluated.
@@ -147,7 +146,7 @@ import defineProperties from '../Core/defineProperties.js';
* Returns whether the feature contains this property. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
*
* @param {String} name The case-sensitive name of the property.
* @returns {Boolean} Whether the feature contains this property.
@@ -160,7 +159,7 @@ import defineProperties from '../Core/defineProperties.js';
* Returns an array of property names for the feature. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @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.
* @returns {String[]} The names of the feature's properties.
@@ -173,7 +172,7 @@ import defineProperties from '../Core/defineProperties.js';
* Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
*
* @param {String} name The case-sensitive name of the property.
* @returns {*} The value of the property or undefined
if the property does not exist.
diff --git a/Source/Scene/Cesium3DTileOptimizationHint.js b/Source/Scene/Cesium3DTileOptimizationHint.js
index 142f07c52e8f..ae6e6a30a716 100644
--- a/Source/Scene/Cesium3DTileOptimizationHint.js
+++ b/Source/Scene/Cesium3DTileOptimizationHint.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* Hint defining optimization support for a 3D tile
@@ -12,4 +11,4 @@ import freezeObject from '../Core/freezeObject.js';
USE_OPTIMIZATION: 1,
SKIP_OPTIMIZATION: 0
};
-export default freezeObject(Cesium3DTileOptimizationHint);
+export default Object.freeze(Cesium3DTileOptimizationHint);
diff --git a/Source/Scene/Cesium3DTilePass.js b/Source/Scene/Cesium3DTilePass.js
index 04a1be803efa..8a5359b109f1 100644
--- a/Source/Scene/Cesium3DTilePass.js
+++ b/Source/Scene/Cesium3DTilePass.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import Cesium3DTilesetMostDetailedTraversal from './Cesium3DTilesetMostDetailedTraversal.js';
import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js';
@@ -21,56 +20,56 @@ import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js';
var passOptions = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);
- passOptions[Cesium3DTilePass.RENDER] = freezeObject({
+ passOptions[Cesium3DTilePass.RENDER] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : true,
requestTiles : true,
ignoreCommands : false
});
- passOptions[Cesium3DTilePass.PICK] = freezeObject({
+ passOptions[Cesium3DTilePass.PICK] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : false,
requestTiles : false,
ignoreCommands : false
});
- passOptions[Cesium3DTilePass.SHADOW] = freezeObject({
+ passOptions[Cesium3DTilePass.SHADOW] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : false,
requestTiles : true,
ignoreCommands : false
});
- passOptions[Cesium3DTilePass.PRELOAD] = freezeObject({
+ passOptions[Cesium3DTilePass.PRELOAD] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : false,
requestTiles : true,
ignoreCommands : true
});
- passOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = freezeObject({
+ passOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : false,
requestTiles : true,
ignoreCommands : true
});
- passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = freezeObject({
+ passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = Object.freeze({
traversal : Cesium3DTilesetTraversal,
isRender : false,
requestTiles : true,
ignoreCommands : true
});
- passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = freezeObject({
+ passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = Object.freeze({
traversal : Cesium3DTilesetMostDetailedTraversal,
isRender : false,
requestTiles : true,
ignoreCommands : true
});
- passOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = freezeObject({
+ passOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = Object.freeze({
traversal : Cesium3DTilesetMostDetailedTraversal,
isRender : false,
requestTiles : false,
@@ -80,4 +79,4 @@ import Cesium3DTilesetTraversal from './Cesium3DTilesetTraversal.js';
Cesium3DTilePass.getPassOptions = function(pass) {
return passOptions[pass];
};
-export default freezeObject(Cesium3DTilePass);
+export default Object.freeze(Cesium3DTilePass);
diff --git a/Source/Scene/Cesium3DTilePointFeature.js b/Source/Scene/Cesium3DTilePointFeature.js
index 5f4229be1e49..83951c56bfef 100644
--- a/Source/Scene/Cesium3DTilePointFeature.js
+++ b/Source/Scene/Cesium3DTilePointFeature.js
@@ -2,7 +2,6 @@ import Cartographic from '../Core/Cartographic.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import createBillboardPointCallback from './createBillboardPointCallback.js';
/**
@@ -67,7 +66,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js';
var scratchCartographic = new Cartographic();
- defineProperties(Cesium3DTilePointFeature.prototype, {
+ Object.defineProperties(Cesium3DTilePointFeature.prototype, {
/**
* Gets or sets if the feature will be shown. This is set for all features
* when a style's show is evaluated.
@@ -672,7 +671,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js';
* Returns whether the feature contains this property. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
*
* @param {String} name The case-sensitive name of the property.
* @returns {Boolean} Whether the feature contains this property.
@@ -685,7 +684,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js';
* Returns an array of property names for the feature. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @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.
* @returns {String[]} The names of the feature's properties.
@@ -698,7 +697,7 @@ import createBillboardPointCallback from './createBillboardPointCallback.js';
* Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
* class and inherited classes when using a batch table hierarchy.
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy}
*
* @param {String} name The case-sensitive name of the property.
* @returns {*} The value of the property or undefined
if the property does not exist.
diff --git a/Source/Scene/Cesium3DTileRefine.js b/Source/Scene/Cesium3DTileRefine.js
index e1939e5dca62..c8261f430acb 100644
--- a/Source/Scene/Cesium3DTileRefine.js
+++ b/Source/Scene/Cesium3DTileRefine.js
@@ -1,9 +1,8 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The refinement approach for a tile.
* - * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#refinement|Refinement} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#refinement|Refinement} * in the 3D Tiles spec. *
* @@ -28,4 +27,4 @@ import freezeObject from '../Core/freezeObject.js'; */ REPLACE : 1 }; -export default freezeObject(Cesium3DTileRefine); +export default Object.freeze(Cesium3DTileRefine); diff --git a/Source/Scene/Cesium3DTileStyle.js b/Source/Scene/Cesium3DTileStyle.js index 08f483f4e3ec..ee0fb241f861 100644 --- a/Source/Scene/Cesium3DTileStyle.js +++ b/Source/Scene/Cesium3DTileStyle.js @@ -1,7 +1,6 @@ import clone from '../Core/clone.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Resource from '../Core/Resource.js'; import when from '../ThirdParty/when.js'; @@ -12,7 +11,7 @@ import Expression from './Expression.js'; * A style that is applied to a {@link Cesium3DTileset}. ** Evaluates an expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *
* * @alias Cesium3DTileStyle @@ -41,7 +40,7 @@ import Expression from './Expression.js'; * pointSize : '${Temperature} * 2.0' * }); * - * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} */ function Cesium3DTileStyle(style) { this._style = {}; @@ -172,10 +171,10 @@ import Expression from './Expression.js'; return expression; } - defineProperties(Cesium3DTileStyle.prototype, { + Object.defineProperties(Cesium3DTileStyle.prototype, { /** * Gets the object defining the style using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. * * @memberof Cesium3DTileStyle.prototype * diff --git a/Source/Scene/Cesium3DTileStyleEngine.js b/Source/Scene/Cesium3DTileStyleEngine.js index a7929a637e73..9bfc13833c22 100644 --- a/Source/Scene/Cesium3DTileStyleEngine.js +++ b/Source/Scene/Cesium3DTileStyleEngine.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; /** * @private @@ -10,7 +9,7 @@ import defineProperties from '../Core/defineProperties.js'; this._lastStyleTime = 0; // The "time" when the last style was assigned } - defineProperties(Cesium3DTileStyleEngine.prototype, { + Object.defineProperties(Cesium3DTileStyleEngine.prototype, { style : { get : function() { return this._style; @@ -26,7 +25,7 @@ import defineProperties from '../Core/defineProperties.js'; this._styleDirty = true; }; - Cesium3DTileStyleEngine.prototype.applyStyle = function(tileset, frameState) { + Cesium3DTileStyleEngine.prototype.applyStyle = function(tileset, passOptions) { if (!tileset.ready) { return; } @@ -37,8 +36,8 @@ import defineProperties from '../Core/defineProperties.js'; var styleDirty = this._styleDirty; - if (frameState.passes.render) { - // Don't reset until the color pass, e.g., for mouse-over picking + if (passOptions.isRender) { + // Don't reset until the render pass this._styleDirty = false; } diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 6acea1c705c6..d121042d8bbf 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -6,7 +6,6 @@ import Check from '../Core/Check.js'; import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import deprecationWarning from '../Core/deprecationWarning.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; @@ -46,7 +45,7 @@ import TileBoundingSphere from './TileBoundingSphere.js'; import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** - * A {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles tileset}, + * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset}, * used for streaming massive heterogeneous 3D geospatial datasets. * * @alias Cesium3DTileset @@ -75,7 +74,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; * @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 {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=true] Optimization option. Determines if level of detail skipping should be applied during the traversal. + * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal. * @param {Number} [options.baseScreenSpaceError=1024] WhenskipLevelOfDetail
is true
, the screen space error that must be reached before skipping levels of detail.
* @param {Number} [options.skipScreenSpaceErrorFactor=16] When skipLevelOfDetail
is true
, a multiplier defining the minimum screen space error to skip. Used in conjunction with skipLevels
to determine which tiles to load.
* @param {Number} [options.skipLevels=1] When skipLevelOfDetail
is true
, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with skipScreenSpaceErrorFactor
to determine which tiles to load.
@@ -132,7 +131,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
* dynamicScreenSpaceErrorHeightFalloff : 0.25
* }));
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles specification}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles specification}
*/
function Cesium3DTileset(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
@@ -575,7 +574,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
* @type {Boolean}
* @default true
*/
- this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, true);
+ this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, false);
this._skipLevelOfDetail = this.skipLevelOfDetail;
this._disableSkipLevelOfDetail = false;
@@ -882,7 +881,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
});
}
- defineProperties(Cesium3DTileset.prototype, {
+ Object.defineProperties(Cesium3DTileset.prototype, {
/**
* NOTE: This getter exists so that `Picking.js` can differentiate between
* PrimitiveCollection and Cesium3DTileset objects without inflating
@@ -898,7 +897,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
/**
* Gets the tileset's asset object property, which contains metadata about the tileset.
* - * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#reference-asset|asset schema reference} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference} * in the 3D Tiles spec for the full set of properties. *
* @@ -939,7 +938,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties. *- * See the {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#reference-properties|properties schema reference} + * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference} * in the 3D Tiles spec for the full set of properties. *
* @@ -1065,7 +1064,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; /** * The style, defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, * applied to each feature in the tileset. *
* Assign undefined
to remove the style, which will restore the visual
@@ -1099,7 +1098,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
* }
* });
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
*/
style : {
get : function() {
@@ -1439,7 +1438,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
* @type {*}
* @readonly
*
- * @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}
*/
extras : {
get : function() {
@@ -1949,9 +1948,10 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
tileset._tileDebugLabels.update(frameState);
}
- function updateTiles(tileset, frameState, isRender) {
- tileset._styleEngine.applyStyle(tileset, frameState);
+ function updateTiles(tileset, frameState, passOptions) {
+ tileset._styleEngine.applyStyle(tileset, passOptions);
+ var isRender = passOptions.isRender;
var statistics = tileset._statistics;
var commandList = frameState.commandList;
var numberOfInitialCommands = commandList.length;
@@ -1988,13 +1988,13 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
if (isRender) {
tileVisible.raiseEvent(tile);
}
- tile.update(tileset, frameState);
+ tile.update(tileset, frameState, passOptions);
statistics.incrementSelectionCounts(tile.content);
++statistics.selected;
}
for (i = 0; i < emptyLength; ++i) {
tile = emptyTiles[i];
- tile.update(tileset, frameState);
+ tile.update(tileset, frameState, passOptions);
}
var addedCommandsLength = commandList.length - lengthBeforeUpdate;
@@ -2051,7 +2051,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
tileset.pointCloudShading.attenuation &&
tileset.pointCloudShading.eyeDomeLighting &&
(addedCommandsLength > 0)) {
- tileset._pointCloudEyeDomeLighting.update(frameState, numberOfInitialCommands, tileset.pointCloudShading);
+ tileset._pointCloudEyeDomeLighting.update(frameState, numberOfInitialCommands, tileset.pointCloudShading, tileset.boundingSphere);
}
if (isRender) {
@@ -2202,7 +2202,7 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
requestTiles(tileset);
}
- updateTiles(tileset, frameState, isRender);
+ updateTiles(tileset, frameState, passOptions);
// Update pass statistics
Cesium3DTilesetStatistics.clone(statistics, passStatistics);
diff --git a/Source/Scene/CircleEmitter.js b/Source/Scene/CircleEmitter.js
index 82985cfb3768..bc9460ecf17a 100644
--- a/Source/Scene/CircleEmitter.js
+++ b/Source/Scene/CircleEmitter.js
@@ -1,7 +1,6 @@
import Cartesian3 from '../Core/Cartesian3.js';
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
-import defineProperties from '../Core/defineProperties.js';
import CesiumMath from '../Core/Math.js';
/**
@@ -23,7 +22,7 @@ import CesiumMath from '../Core/Math.js';
this._radius = defaultValue(radius, 1.0);
}
- defineProperties(CircleEmitter.prototype, {
+ Object.defineProperties(CircleEmitter.prototype, {
/**
* The radius of the circle in meters.
* @memberof CircleEmitter.prototype
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index cd8b98655515..792f8ce52f0e 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -7,7 +7,6 @@ import combine from '../Core/combine.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import FeatureDetection from '../Core/FeatureDetection.js';
@@ -218,7 +217,7 @@ import Vector3DTilePrimitive from './Vector3DTilePrimitive.js';
this._rtcCenter2D = undefined; // in projected world coordinates
}
- defineProperties(ClassificationModel.prototype, {
+ Object.defineProperties(ClassificationModel.prototype, {
/**
* The object for the glTF JSON, including properties with default values omitted
* from the JSON provided to this model.
diff --git a/Source/Scene/ClassificationPrimitive.js b/Source/Scene/ClassificationPrimitive.js
index dab4fd28e875..5045ed0cf0d5 100644
--- a/Source/Scene/ClassificationPrimitive.js
+++ b/Source/Scene/ClassificationPrimitive.js
@@ -2,11 +2,9 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu
import combine from '../Core/combine.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import GeometryInstance from '../Core/GeometryInstance.js';
-import isArray from '../Core/isArray.js';
import DrawCommand from '../Renderer/DrawCommand.js';
import Pass from '../Renderer/Pass.js';
import RenderState from '../Renderer/RenderState.js';
@@ -26,8 +24,6 @@ import StencilConstants from './StencilConstants.js';
import StencilFunction from './StencilFunction.js';
import StencilOperation from './StencilOperation.js';
- var ClassificationPrimitiveReadOnlyInstanceAttributes = ['color'];
-
/**
* A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
*
@@ -172,11 +168,6 @@ import StencilOperation from './StencilOperation.js';
this.appearance = options.appearance;
- var readOnlyAttributes;
- if (defined(geometryInstances) && isArray(geometryInstances) && geometryInstances.length > 1) {
- readOnlyAttributes = ClassificationPrimitiveReadOnlyInstanceAttributes;
- }
-
this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;
this._updateAndQueueCommandsFunction = options._updateAndQueueCommandsFunction;
@@ -191,7 +182,6 @@ import StencilOperation from './StencilOperation.js';
allowPicking : defaultValue(options.allowPicking, true),
asynchronous : defaultValue(options.asynchronous, true),
compressVertices : defaultValue(options.compressVertices, true),
- _readOnlyInstanceAttributes : readOnlyAttributes,
_createBoundingVolumeFunction : undefined,
_createRenderStatesFunction : undefined,
_createShaderProgramFunction : undefined,
@@ -201,7 +191,7 @@ import StencilOperation from './StencilOperation.js';
};
}
- defineProperties(ClassificationPrimitive.prototype, {
+ Object.defineProperties(ClassificationPrimitive.prototype, {
/**
* When true
, geometry vertices are optimized for the pre and post-vertex-shader caches.
*
@@ -533,14 +523,9 @@ import StencilOperation from './StencilOperation.js';
}
var extrudedDefine = classificationPrimitive._extruded ? 'EXTRUDED_GEOMETRY' : '';
- // Tesselation on ClassificationPrimitives tends to be low,
- // which causes problems when interpolating log depth from vertices.
- // So force computing and writing logarithmic depth in the fragment shader.
- // Re-enable at far distances to avoid z-fighting.
- var disableGlPositionLogDepth = 'ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT';
var vsSource = new ShaderSource({
- defines : [extrudedDefine, disableGlPositionLogDepth],
+ defines : [extrudedDefine],
sources : [vs]
});
var fsSource = new ShaderSource({
@@ -564,7 +549,7 @@ import StencilOperation from './StencilOperation.js';
vsPick = Primitive._updatePickColorAttribute(vsPick);
var pickFS3D = shadowVolumeAppearance.createPickFragmentShader(false);
- var pickVS3D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine, disableGlPositionLogDepth], vsPick, false, frameState.mapProjection);
+ var pickVS3D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine], vsPick, false, frameState.mapProjection);
classificationPrimitive._spPick = ShaderProgram.replaceCache({
context : context,
@@ -580,7 +565,7 @@ import StencilOperation from './StencilOperation.js';
var pickProgram2D = context.shaderCache.getDerivedShaderProgram(classificationPrimitive._spPick, '2dPick');
if (!defined(pickProgram2D)) {
var pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true);
- var pickVS2D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine, disableGlPositionLogDepth], vsPick, true, frameState.mapProjection);
+ var pickVS2D = shadowVolumeAppearance.createPickVertexShader([extrudedDefine], vsPick, true, frameState.mapProjection);
pickProgram2D = context.shaderCache.createDerivedShaderProgram(classificationPrimitive._spPick, '2dPick', {
vertexShaderSource : pickVS2D,
@@ -601,7 +586,7 @@ import StencilOperation from './StencilOperation.js';
vs = Primitive._appendShowToShader(primitive, vs);
vsSource = new ShaderSource({
- defines : [extrudedDefine, disableGlPositionLogDepth],
+ defines : [extrudedDefine],
sources : [vs]
});
@@ -615,7 +600,7 @@ import StencilOperation from './StencilOperation.js';
// Create a fragment shader that computes only required material hookups using screen space techniques
var fsColorSource = shadowVolumeAppearance.createFragmentShader(false);
- var vsColorSource = shadowVolumeAppearance.createVertexShader([extrudedDefine, disableGlPositionLogDepth], vs, false, frameState.mapProjection);
+ var vsColorSource = shadowVolumeAppearance.createVertexShader([extrudedDefine], vs, false, frameState.mapProjection);
classificationPrimitive._spColor = ShaderProgram.replaceCache({
context : context,
@@ -632,7 +617,7 @@ import StencilOperation from './StencilOperation.js';
var colorProgram2D = context.shaderCache.getDerivedShaderProgram(classificationPrimitive._spColor, '2dColor');
if (!defined(colorProgram2D)) {
var fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true);
- var vsColorSource2D = shadowVolumeAppearance.createVertexShader([extrudedDefine, disableGlPositionLogDepth], vs, true, frameState.mapProjection);
+ var vsColorSource2D = shadowVolumeAppearance.createVertexShader([extrudedDefine], vs, true, frameState.mapProjection);
colorProgram2D = context.shaderCache.createDerivedShaderProgram(classificationPrimitive._spColor, '2dColor', {
vertexShaderSource : vsColorSource2D,
@@ -1002,7 +987,7 @@ import StencilOperation from './StencilOperation.js';
var primitiveOptions = this._primitiveOptions;
if (!defined(this._primitive)) {
- var instances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ var instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
var length = instances.length;
var i;
diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js
index 57bc3241aa49..a5355da0f4e5 100644
--- a/Source/Scene/ClassificationType.js
+++ b/Source/Scene/ClassificationType.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* Whether a classification affects terrain, 3D Tiles or both.
@@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
NUMBER_OF_CLASSIFICATION_TYPES : 3
};
-export default freezeObject(ClassificationType);
+export default Object.freeze(ClassificationType);
diff --git a/Source/Scene/ClippingPlane.js b/Source/Scene/ClippingPlane.js
index 7d35781409bf..17e47f1cdda9 100644
--- a/Source/Scene/ClippingPlane.js
+++ b/Source/Scene/ClippingPlane.js
@@ -1,7 +1,6 @@
import Cartesian3 from '../Core/Cartesian3.js';
import Check from '../Core/Check.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
/**
* A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
@@ -29,7 +28,7 @@ import defineProperties from '../Core/defineProperties.js';
this.index = -1; // to be set by ClippingPlaneCollection
}
- defineProperties(ClippingPlane.prototype, {
+ Object.defineProperties(ClippingPlane.prototype, {
/**
* The shortest distance from the origin to the plane. The sign of
* distance
determines which side of the plane the origin
@@ -126,7 +125,7 @@ import defineProperties from '../Core/defineProperties.js';
this._cartesian3 = Cartesian3.clone(normal);
}
- defineProperties(UpdateChangedCartesian3.prototype, {
+ Object.defineProperties(UpdateChangedCartesian3.prototype, {
x : {
get : function() {
return this._cartesian3.x;
diff --git a/Source/Scene/ClippingPlaneCollection.js b/Source/Scene/ClippingPlaneCollection.js
index b5abd6304900..957dbb8f5c44 100644
--- a/Source/Scene/ClippingPlaneCollection.js
+++ b/Source/Scene/ClippingPlaneCollection.js
@@ -6,7 +6,6 @@ import Check from '../Core/Check.js';
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -18,9 +17,6 @@ import ContextLimits from '../Renderer/ContextLimits.js';
import PixelDatatype from '../Renderer/PixelDatatype.js';
import Sampler from '../Renderer/Sampler.js';
import Texture from '../Renderer/Texture.js';
-import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js';
-import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js';
-import TextureWrap from '../Renderer/TextureWrap.js';
import ClippingPlane from './ClippingPlane.js';
/**
@@ -153,7 +149,7 @@ import ClippingPlane from './ClippingPlane.js';
return (value === Intersect.INSIDE);
}
- defineProperties(ClippingPlaneCollection.prototype, {
+ Object.defineProperties(ClippingPlaneCollection.prototype, {
/**
* Returns the number of planes in this collection. This is commonly used with
* {@link ClippingPlaneCollection#get} to iterate over all the planes
@@ -491,13 +487,6 @@ import ClippingPlane from './ClippingPlane.js';
// Allocate in the Y direction, since texture may be as wide as context texture support.
requiredResolution.y *= 2;
- var sampler = new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- });
-
if (useFloatTexture) {
clippingPlanesTexture = new Texture({
context : context,
@@ -505,7 +494,7 @@ import ClippingPlane from './ClippingPlane.js';
height : requiredResolution.y,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.FLOAT,
- sampler : sampler,
+ sampler : Sampler.NEAREST,
flipY : false
});
this._float32View = new Float32Array(requiredResolution.x * requiredResolution.y * 4);
@@ -516,7 +505,7 @@ import ClippingPlane from './ClippingPlane.js';
height : requiredResolution.y,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.UNSIGNED_BYTE,
- sampler : sampler,
+ sampler : Sampler.NEAREST,
flipY : false
});
this._uint8View = new Uint8Array(requiredResolution.x * requiredResolution.y * 4);
diff --git a/Source/Scene/ColorBlendMode.js b/Source/Scene/ColorBlendMode.js
index b71559bf95d5..3d1df4564f80 100644
--- a/Source/Scene/ColorBlendMode.js
+++ b/Source/Scene/ColorBlendMode.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import CesiumMath from '../Core/Math.js';
/**
@@ -31,4 +30,4 @@ import CesiumMath from '../Core/Math.js';
return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0);
}
};
-export default freezeObject(ColorBlendMode);
+export default Object.freeze(ColorBlendMode);
diff --git a/Source/Scene/Composite3DTileContent.js b/Source/Scene/Composite3DTileContent.js
index ca6283cf75a3..2ce307951a8e 100644
--- a/Source/Scene/Composite3DTileContent.js
+++ b/Source/Scene/Composite3DTileContent.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import getMagic from '../Core/getMagic.js';
import RuntimeError from '../Core/RuntimeError.js';
@@ -8,8 +7,8 @@ import when from '../ThirdParty/when.js';
/**
* Represents the contents of a
- * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Composite|Composite}
- * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset.
+ * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Composite|Composite}
+ * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset.
*
* Implements the {@link Cesium3DTileContent} interface. *
@@ -29,7 +28,7 @@ import when from '../ThirdParty/when.js'; initialize(this, arrayBuffer, byteOffset, factory); } - defineProperties(Composite3DTileContent.prototype, { + Object.defineProperties(Composite3DTileContent.prototype, { featurePropertiesDirty : { get : function() { var contents = this._contents; diff --git a/Source/Scene/ConditionsExpression.js b/Source/Scene/ConditionsExpression.js index 534ac1bf0092..720b7d55358a 100644 --- a/Source/Scene/ConditionsExpression.js +++ b/Source/Scene/ConditionsExpression.js @@ -1,13 +1,12 @@ import clone from '../Core/clone.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import Expression from './Expression.js'; /** * An expression for a style applied to a {@link Cesium3DTileset}. ** Evaluates a conditions expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *
*
* Implements the {@link StyleExpression} interface.
@@ -37,7 +36,7 @@ import Expression from './Expression.js';
setRuntime(this, defines);
}
- defineProperties(ConditionsExpression.prototype, {
+ Object.defineProperties(ConditionsExpression.prototype, {
/**
* Gets the conditions expression defined in the 3D Tiles Styling language.
*
@@ -82,7 +81,7 @@ import Expression from './Expression.js';
/**
* Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
* the expression in the
- * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
+ * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
* is of type Boolean
, Number
, or String
, the corresponding JavaScript
* primitive type will be returned. If the result is a RegExp
, a Javascript RegExp
* object will be returned. If the result is a Cartesian2
, Cartesian3
, or Cartesian4
,
diff --git a/Source/Scene/ConeEmitter.js b/Source/Scene/ConeEmitter.js
index b49e5fff8ce1..d678649deb1d 100644
--- a/Source/Scene/ConeEmitter.js
+++ b/Source/Scene/ConeEmitter.js
@@ -1,7 +1,6 @@
import Cartesian3 from '../Core/Cartesian3.js';
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
-import defineProperties from '../Core/defineProperties.js';
import CesiumMath from '../Core/Math.js';
var defaultAngle = CesiumMath.toRadians(30.0);
@@ -19,7 +18,7 @@ import CesiumMath from '../Core/Math.js';
this._angle = defaultValue(angle, defaultAngle);
}
- defineProperties(ConeEmitter.prototype, {
+ Object.defineProperties(ConeEmitter.prototype, {
/**
* The angle of the cone in radians.
* @memberof CircleEmitter.prototype
diff --git a/Source/Scene/CreditDisplay.js b/Source/Scene/CreditDisplay.js
index a872df9e2f8c..5216c38378c3 100644
--- a/Source/Scene/CreditDisplay.js
+++ b/Source/Scene/CreditDisplay.js
@@ -4,7 +4,6 @@ import Check from '../Core/Check.js';
import Credit from '../Core/Credit.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
var mobileWidth = 576;
@@ -499,7 +498,7 @@ import destroyObject from '../Core/destroyObject.js';
return defaultCredit;
}
- defineProperties(CreditDisplay, {
+ Object.defineProperties(CreditDisplay, {
/**
* Gets or sets the Cesium logo credit.
* @memberof CreditDisplay
diff --git a/Source/Scene/CullFace.js b/Source/Scene/CullFace.js
index 78960e9c6714..3b0f0bd8125e 100644
--- a/Source/Scene/CullFace.js
+++ b/Source/Scene/CullFace.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -31,4 +30,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
*/
FRONT_AND_BACK : WebGLConstants.FRONT_AND_BACK
};
-export default freezeObject(CullFace);
+export default Object.freeze(CullFace);
diff --git a/Source/Scene/DebugAppearance.js b/Source/Scene/DebugAppearance.js
index a4edd8790bee..44fd94b53588 100644
--- a/Source/Scene/DebugAppearance.js
+++ b/Source/Scene/DebugAppearance.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Appearance from './Appearance.js';
@@ -133,7 +132,7 @@ import Appearance from './Appearance.js';
this._glslDatatype = glslDatatype;
}
- defineProperties(DebugAppearance.prototype, {
+ Object.defineProperties(DebugAppearance.prototype, {
/**
* The GLSL source code for the vertex shader.
*
diff --git a/Source/Scene/DepthFunction.js b/Source/Scene/DepthFunction.js
index ca716f23fe0a..87bec2136c41 100644
--- a/Source/Scene/DepthFunction.js
+++ b/Source/Scene/DepthFunction.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
import WebGLConstants from '../Core/WebGLConstants.js';
/**
@@ -71,4 +70,4 @@ import WebGLConstants from '../Core/WebGLConstants.js';
*/
ALWAYS : WebGLConstants.ALWAYS
};
-export default freezeObject(DepthFunction);
+export default Object.freeze(DepthFunction);
diff --git a/Source/Scene/DepthPlane.js b/Source/Scene/DepthPlane.js
index bb7a7aa55425..8ba5fcdbbbcf 100644
--- a/Source/Scene/DepthPlane.js
+++ b/Source/Scene/DepthPlane.js
@@ -134,7 +134,6 @@ import SceneMode from './SceneMode.js';
fs.sources.push(extension);
fs.defines.push('LOG_DEPTH');
vs.defines.push('LOG_DEPTH');
- vs.defines.push('DISABLE_GL_POSITION_LOG_DEPTH');
}
this._sp = ShaderProgram.replaceCache({
diff --git a/Source/Scene/DiscardEmptyTileImagePolicy.js b/Source/Scene/DiscardEmptyTileImagePolicy.js
index 0fc35f008472..75a873b4d932 100644
--- a/Source/Scene/DiscardEmptyTileImagePolicy.js
+++ b/Source/Scene/DiscardEmptyTileImagePolicy.js
@@ -1,5 +1,4 @@
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
/**
* A policy for discarding tile images that contain no data (and so aren't actually images).
@@ -34,7 +33,7 @@ import defineProperties from '../Core/defineProperties.js';
var emptyImage;
- defineProperties(DiscardEmptyTileImagePolicy, {
+ Object.defineProperties(DiscardEmptyTileImagePolicy, {
/**
* Default value for representing an empty image.
* @type {Image}
diff --git a/Source/Scene/EllipsoidPrimitive.js b/Source/Scene/EllipsoidPrimitive.js
index c22639b52bf1..ed2b951d31b0 100644
--- a/Source/Scene/EllipsoidPrimitive.js
+++ b/Source/Scene/EllipsoidPrimitive.js
@@ -113,7 +113,7 @@ import SceneMode from './SceneMode.js';
/**
* The surface appearance of the ellipsoid. This can be one of several built-in {@link Material} objects or a custom material, scripted with
- * {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric}.
+ * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
*
* The default material is Material.ColorType
.
*
* Implements the {@link Cesium3DTileContent} interface. @@ -21,7 +20,7 @@ import destroyObject from '../Core/destroyObject.js'; this.featurePropertiesDirty = false; } - defineProperties(Empty3DTileContent.prototype, { + Object.defineProperties(Empty3DTileContent.prototype, { featuresLength : { get : function() { return 0; diff --git a/Source/Scene/Expression.js b/Source/Scene/Expression.js index 324f8b408e31..1b4da7d666ec 100644 --- a/Source/Scene/Expression.js +++ b/Source/Scene/Expression.js @@ -4,9 +4,7 @@ import Cartesian4 from '../Core/Cartesian4.js'; import Check from '../Core/Check.js'; import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; -import isArray from '../Core/isArray.js'; import CesiumMath from '../Core/Math.js'; import RuntimeError from '../Core/RuntimeError.js'; import jsep from '../ThirdParty/jsep.js'; @@ -16,7 +14,7 @@ import ExpressionNodeType from './ExpressionNodeType.js'; * An expression for a style applied to a {@link Cesium3DTileset}. *
* Evaluates an expression defined using the - * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. *
*
* Implements the {@link StyleExpression} interface.
@@ -59,7 +57,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
this._runtimeAst = createRuntimeAst(this, ast);
}
- defineProperties(Expression.prototype, {
+ Object.defineProperties(Expression.prototype, {
/**
* Gets the expression defined in the 3D Tiles Styling language.
*
@@ -125,7 +123,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
/**
* Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
* the expression in the
- * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
+ * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
* is of type Boolean
, Number
, or String
, the corresponding JavaScript
* primitive type will be returned. If the result is a RegExp
, a Javascript RegExp
* object will be returned. If the result is a Cartesian2
, Cartesian3
, or Cartesian4
,
@@ -1559,6 +1557,8 @@ import ExpressionNodeType from './ExpressionNodeType.js';
return expressions;
}
+ var nullSentinel = 'czm_infinity'; // null just needs to be some sentinel value that will cause "[expression] === null" to be false in nearly all cases. GLSL doesn't have a NaN constant so use czm_infinity.
+
Node.prototype.getShaderExpression = function(attributePrefix, shaderState, parent) {
var color;
var left;
@@ -1569,7 +1569,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
var value = this._value;
if (defined(this._left)) {
- if (isArray(this._left)) {
+ if (Array.isArray(this._left)) {
// Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR
left = getExpressionArray(this._left, attributePrefix, shaderState, this);
} else {
@@ -1585,7 +1585,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
test = this._test.getShaderExpression(attributePrefix, shaderState, this);
}
- if (isArray(this._value)) {
+ if (Array.isArray(this._value)) {
// For ARRAY type
value = getExpressionArray(this._value, attributePrefix, shaderState, this);
}
@@ -1603,7 +1603,13 @@ import ExpressionNodeType from './ExpressionNodeType.js';
return 'floor(' + left + ' + 0.5)';
} else if (defined(unaryFunctions[value])) {
return value + '(' + left + ')';
- } else if ((value === 'isNaN') || (value === 'isFinite') || (value === 'String') || (value === 'isExactClass') || (value === 'isClass') || (value === 'getExactClassName')) {
+ } else if (value === 'isNaN') {
+ // In GLSL 2.0 use isnan instead
+ return '(' + left + ' != ' + left + ')';
+ } else if (value === 'isFinite') {
+ // In GLSL 2.0 use isinf instead. GLSL doesn't have an infinity constant so use czm_infinity which is an arbitrarily big enough number.
+ return '(abs(' + left + ') < czm_infinity)';
+ } else if ((value === 'String') || (value === 'isExactClass') || (value === 'isClass') || (value === 'getExactClassName')) {
throw new RuntimeError('Error generating style shader: "' + value + '" is not supported.');
} else if (defined(unaryFunctions[value])) {
return value + '(' + left + ')';
@@ -1659,7 +1665,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
case ExpressionNodeType.VARIABLE_IN_STRING:
throw new RuntimeError('Error generating style shader: Converting a variable to a string is not supported.');
case ExpressionNodeType.LITERAL_NULL:
- throw new RuntimeError('Error generating style shader: null is not supported.');
+ return nullSentinel;
case ExpressionNodeType.LITERAL_BOOLEAN:
return value ? 'true' : 'false';
case ExpressionNodeType.LITERAL_NUMBER:
@@ -1745,7 +1751,7 @@ import ExpressionNodeType from './ExpressionNodeType.js';
case ExpressionNodeType.LITERAL_REGEX:
throw new RuntimeError('Error generating style shader: Regular expressions are not supported.');
case ExpressionNodeType.LITERAL_UNDEFINED:
- throw new RuntimeError('Error generating style shader: undefined is not supported.');
+ return nullSentinel;
case ExpressionNodeType.BUILTIN_VARIABLE:
if (value === 'tiles3d_tileset_time') {
return 'u_time';
diff --git a/Source/Scene/ExpressionNodeType.js b/Source/Scene/ExpressionNodeType.js
index f972c5b4cc08..c4348223a431 100644
--- a/Source/Scene/ExpressionNodeType.js
+++ b/Source/Scene/ExpressionNodeType.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* @private
@@ -24,4 +23,4 @@ import freezeObject from '../Core/freezeObject.js';
LITERAL_UNDEFINED : 17,
BUILTIN_VARIABLE : 18
};
-export default freezeObject(ExpressionNodeType);
+export default Object.freeze(ExpressionNodeType);
diff --git a/Source/Scene/FrameRateMonitor.js b/Source/Scene/FrameRateMonitor.js
index e4184c71e449..8f4fc5e188a9 100644
--- a/Source/Scene/FrameRateMonitor.js
+++ b/Source/Scene/FrameRateMonitor.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -154,7 +153,7 @@ import TimeConstants from '../Core/TimeConstants.js';
return scene._frameRateMonitor;
};
- defineProperties(FrameRateMonitor.prototype, {
+ Object.defineProperties(FrameRateMonitor.prototype, {
/**
* Gets the {@link Scene} instance for which to monitor performance.
* @memberof FrameRateMonitor.prototype
diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js
index f9343c143139..eba28e5326cd 100644
--- a/Source/Scene/FrameState.js
+++ b/Source/Scene/FrameState.js
@@ -127,6 +127,14 @@ import SceneMode from './SceneMode.js';
*/
this.camera = undefined;
+ /**
+ * Whether the camera is underground.
+ *
+ * @type {Boolean}
+ * @default false
+ */
+ this.cameraUnderground = false;
+
/**
* The culling volume.
*
diff --git a/Source/Scene/Geometry3DTileContent.js b/Source/Scene/Geometry3DTileContent.js
index 41443106946f..98378a93508e 100644
--- a/Source/Scene/Geometry3DTileContent.js
+++ b/Source/Scene/Geometry3DTileContent.js
@@ -1,7 +1,6 @@
import Cartesian3 from '../Core/Cartesian3.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import getStringFromTypedArray from '../Core/getStringFromTypedArray.js';
@@ -41,7 +40,7 @@ import Vector3DTileGeometry from './Vector3DTileGeometry.js';
initialize(this, arrayBuffer, byteOffset);
}
- defineProperties(Geometry3DTileContent.prototype, {
+ Object.defineProperties(Geometry3DTileContent.prototype, {
featuresLength : {
get : function() {
return defined(this._batchTable) ? this._batchTable.featuresLength : 0;
diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js
index 8a8798861334..6438308cd2e0 100644
--- a/Source/Scene/Globe.js
+++ b/Source/Scene/Globe.js
@@ -4,7 +4,6 @@ import Cartesian3 from '../Core/Cartesian3.js';
import Cartographic from '../Core/Cartographic.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Ellipsoid from '../Core/Ellipsoid.js';
@@ -26,7 +25,6 @@ import ImageryLayerCollection from './ImageryLayerCollection.js';
import QuadtreePrimitive from './QuadtreePrimitive.js';
import SceneMode from './SceneMode.js';
import ShadowMode from './ShadowMode.js';
-import TileSelectionResult from './TileSelectionResult.js';
/**
* The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
@@ -292,7 +290,7 @@ import TileSelectionResult from './TileSelectionResult.js';
this._zoomedOutOceanSpecularIntensity = undefined;
}
- defineProperties(Globe.prototype, {
+ Object.defineProperties(Globe.prototype, {
/**
* Gets an ellipsoid describing the shape of this globe.
* @memberof Globe.prototype
@@ -451,7 +449,7 @@ import TileSelectionResult from './TileSelectionResult.js';
/**
* Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with
- * {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric}.
+ * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
* @memberof Globe.prototype
* @type {Material}
*/
@@ -612,7 +610,7 @@ import TileSelectionResult from './TileSelectionResult.js';
var scratchGetHeightRay = new Ray();
function tileIfContainsCartographic(tile, cartographic) {
- return Rectangle.contains(tile.rectangle, cartographic) ? tile : undefined;
+ return defined(tile) && Rectangle.contains(tile.rectangle, cartographic) ? tile : undefined;
}
/**
@@ -650,12 +648,13 @@ import TileSelectionResult from './TileSelectionResult.js';
var tileWithMesh = tile;
- while (tile._lastSelectionResult === TileSelectionResult.REFINED) {
- tile = tileIfContainsCartographic(tile.southwestChild, cartographic) ||
- tileIfContainsCartographic(tile.southeastChild, cartographic) ||
- tileIfContainsCartographic(tile.northwestChild, cartographic) ||
- tile.northeastChild;
- if (defined(tile.data) && defined(tile.data.renderedMesh)) {
+ while (defined(tile)) {
+ tile = tileIfContainsCartographic(tile._southwestChild, cartographic) ||
+ tileIfContainsCartographic(tile._southeastChild, cartographic) ||
+ tileIfContainsCartographic(tile._northwestChild, cartographic) ||
+ tile._northeastChild;
+
+ if (defined(tile) && defined(tile.data) && defined(tile.data.renderedMesh)) {
tileWithMesh = tile;
}
}
diff --git a/Source/Scene/GlobeDepth.js b/Source/Scene/GlobeDepth.js
index 8e1c0ad5b8f2..1790a7cf70c2 100644
--- a/Source/Scene/GlobeDepth.js
+++ b/Source/Scene/GlobeDepth.js
@@ -1,7 +1,6 @@
import BoundingRectangle from '../Core/BoundingRectangle.js';
import Color from '../Core/Color.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import PixelFormat from '../Core/PixelFormat.js';
import ClearCommand from '../Renderer/ClearCommand.js';
@@ -11,9 +10,6 @@ import RenderState from '../Renderer/RenderState.js';
import Sampler from '../Renderer/Sampler.js';
import ShaderSource from '../Renderer/ShaderSource.js';
import Texture from '../Renderer/Texture.js';
-import TextureMagnificationFilter from '../Renderer/TextureMagnificationFilter.js';
-import TextureMinificationFilter from '../Renderer/TextureMinificationFilter.js';
-import TextureWrap from '../Renderer/TextureWrap.js';
import PassThrough from '../Shaders/PostProcessStages/PassThrough.js';
import PassThroughDepth from '../Shaders/PostProcessStages/PassThroughDepth.js';
import BlendingState from './BlendingState.js';
@@ -61,7 +57,7 @@ import StencilOperation from './StencilOperation.js';
this._debugGlobeDepthViewportCommand = undefined;
}
- defineProperties(GlobeDepth.prototype, {
+ Object.defineProperties(GlobeDepth.prototype, {
framebuffer : {
get : function() {
return this._globeColorFramebuffer;
@@ -133,12 +129,7 @@ import StencilOperation from './StencilOperation.js';
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.UNSIGNED_BYTE,
- sampler : new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- })
+ sampler : Sampler.NEAREST
});
globeDepth._tempCopyDepthFramebuffer = new Framebuffer({
context : context,
@@ -161,12 +152,7 @@ import StencilOperation from './StencilOperation.js';
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : pixelDatatype,
- sampler : new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- })
+ sampler : Sampler.NEAREST
});
globeDepth._depthStencilTexture = new Texture({
@@ -183,12 +169,7 @@ import StencilOperation from './StencilOperation.js';
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.UNSIGNED_BYTE,
- sampler : new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- })
+ sampler : Sampler.NEAREST
});
}
@@ -215,12 +196,7 @@ import StencilOperation from './StencilOperation.js';
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : pixelDatatype,
- sampler : new Sampler({
- wrapS : TextureWrap.CLAMP_TO_EDGE,
- wrapT : TextureWrap.CLAMP_TO_EDGE,
- minificationFilter : TextureMinificationFilter.NEAREST,
- magnificationFilter : TextureMagnificationFilter.NEAREST
- })
+ sampler : Sampler.NEAREST
});
globeDepth._primitiveColorFramebuffer = new Framebuffer({
diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js
index 7dc9086ad9a5..68c148a6963a 100644
--- a/Source/Scene/GlobeSurfaceShaderSet.js
+++ b/Source/Scene/GlobeSurfaceShaderSet.js
@@ -97,13 +97,6 @@ import SceneMode from './SceneMode.js';
quantizationDefine = 'QUANTIZATION_BITS12';
}
- var vertexLogDepth = 0;
- var vertexLogDepthDefine = '';
- if (!defined(surfaceTile.vertexArray) || !defined(surfaceTile.terrainData) || surfaceTile.terrainData._createdByUpsampling) {
- vertexLogDepth = 1;
- vertexLogDepthDefine = 'DISABLE_GL_POSITION_LOG_DEPTH';
- }
-
var cartographicLimitRectangleFlag = 0;
var cartographicLimitRectangleDefine = '';
if (clippedByBoundaries) {
@@ -139,12 +132,11 @@ import SceneMode from './SceneMode.js';
(quantization << 18) |
(applySplit << 19) |
(enableClippingPlanes << 20) |
- (vertexLogDepth << 21) |
- (cartographicLimitRectangleFlag << 22) |
- (imageryCutoutFlag << 23) |
- (colorCorrect << 24) |
- (highlightFillTile << 25) |
- (colorToAlpha << 26);
+ (cartographicLimitRectangleFlag << 21) |
+ (imageryCutoutFlag << 22) |
+ (colorCorrect << 23) |
+ (highlightFillTile << 24) |
+ (colorToAlpha << 25);
var currentClippingShaderState = 0;
if (defined(clippingPlanes) && clippingPlanes.length > 0) {
@@ -176,7 +168,7 @@ import SceneMode from './SceneMode.js';
fs.sources.unshift(getClippingFunction(clippingPlanes, frameState.context)); // Need to go before GlobeFS
}
- vs.defines.push(quantizationDefine, vertexLogDepthDefine);
+ vs.defines.push(quantizationDefine);
fs.defines.push('TEXTURE_UNITS ' + numberOfDayTextures, cartographicLimitRectangleDefine, imageryCutoutDefine);
if (applyBrightness) {
diff --git a/Source/Scene/GlobeSurfaceTile.js b/Source/Scene/GlobeSurfaceTile.js
index 4800762c7552..334bc97a5a50 100644
--- a/Source/Scene/GlobeSurfaceTile.js
+++ b/Source/Scene/GlobeSurfaceTile.js
@@ -2,7 +2,6 @@ import BoundingSphere from '../Core/BoundingSphere.js';
import Cartesian3 from '../Core/Cartesian3.js';
import Cartesian4 from '../Core/Cartesian4.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import IndexDatatype from '../Core/IndexDatatype.js';
import IntersectionTests from '../Core/IntersectionTests.js';
import OrientedBoundingBox from '../Core/OrientedBoundingBox.js';
@@ -73,7 +72,7 @@ import TerrainState from './TerrainState.js';
this.clippedByBoundaries = false;
}
- defineProperties(GlobeSurfaceTile.prototype, {
+ Object.defineProperties(GlobeSurfaceTile.prototype, {
/**
* Gets a value indicating whether or not this tile is eligible to be unloaded.
* Typically, a tile is ineligible to be unloaded while an asynchronous operation,
diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js
index 921e85905588..753128482905 100644
--- a/Source/Scene/GlobeSurfaceTileProvider.js
+++ b/Source/Scene/GlobeSurfaceTileProvider.js
@@ -10,7 +10,6 @@ import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribu
import combine from '../Core/combine.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -159,7 +158,7 @@ import TileSelectionResult from './TileSelectionResult.js';
this._hasFillTilesThisFrame = false;
}
- defineProperties(GlobeSurfaceTileProvider.prototype, {
+ Object.defineProperties(GlobeSurfaceTileProvider.prototype, {
/**
* Gets or sets the color of the globe when no imagery is available.
* @memberof GlobeSurfaceTileProvider.prototype
@@ -411,9 +410,7 @@ import TileSelectionResult from './TileSelectionResult.js';
},
blending : BlendingState.ALPHA_BLEND
});
- }
- if (!this.backFaceCulling && !defined(this._disableCullingRenderState)) {
var rs = clone(this._renderState, true);
rs.cull.enabled = false;
this._disableCullingRenderState = RenderState.fromCache(rs);
@@ -552,7 +549,7 @@ import TileSelectionResult from './TileSelectionResult.js';
var distance = this.computeDistanceToTile(tile, frameState);
tile._distance = distance;
- if (frameState.fog.enabled) {
+ if (frameState.fog.enabled && !frameState.cameraUnderground) {
if (CesiumMath.fog(distance, frameState.fog.density) >= 1.0) {
// Tile is completely in fog so return that it is not visible.
return Visibility.NONE;
@@ -614,7 +611,7 @@ import TileSelectionResult from './TileSelectionResult.js';
}
var ortho3D = frameState.mode === SceneMode.SCENE3D && frameState.camera.frustum instanceof OrthographicFrustum;
- if (frameState.mode === SceneMode.SCENE3D && !ortho3D && defined(occluders)) {
+ if (frameState.mode === SceneMode.SCENE3D && !ortho3D && defined(occluders) && !frameState.cameraUnderground) {
var occludeePointInScaledSpace = surfaceTile.occludeePointInScaledSpace;
if (!defined(occludeePointInScaledSpace)) {
return intersection;
@@ -1545,11 +1542,13 @@ import TileSelectionResult from './TileSelectionResult.js';
waterMaskTranslationAndScale = surfaceTile.fill.waterMaskTranslationAndScale;
}
+ var cameraUnderground = frameState.cameraUnderground;
+
var showReflectiveOcean = tileProvider.hasWaterMask && defined(waterMaskTexture);
var oceanNormalMap = tileProvider.oceanNormalMap;
var showOceanWaves = showReflectiveOcean && defined(oceanNormalMap);
var hasVertexNormals = tileProvider.terrainProvider.ready && tileProvider.terrainProvider.hasVertexNormals;
- var enableFog = frameState.fog.enabled;
+ var enableFog = frameState.fog.enabled && !cameraUnderground;
var showGroundAtmosphere = tileProvider.showGroundAtmosphere;
var castShadows = ShadowMode.castShadows(tileProvider.shadows);
var receiveShadows = ShadowMode.receiveShadows(tileProvider.shadows);
@@ -1674,8 +1673,10 @@ import TileSelectionResult from './TileSelectionResult.js';
var imageryIndex = 0;
var imageryLen = tileImageryCollection.length;
- var firstPassRenderState = tileProvider.backFaceCulling ? tileProvider._renderState : tileProvider._disableCullingRenderState;
- var otherPassesRenderState = tileProvider.backFaceCulling ? tileProvider._blendRenderState : tileProvider._disableCullingBlendRenderState;
+ var showSkirts = tileProvider.showSkirts && !cameraUnderground;
+ var backFaceCulling = tileProvider.backFaceCulling && !cameraUnderground;
+ var firstPassRenderState = backFaceCulling ? tileProvider._renderState : tileProvider._disableCullingRenderState;
+ var otherPassesRenderState = backFaceCulling ? tileProvider._blendRenderState : tileProvider._disableCullingBlendRenderState;
var renderState = firstPassRenderState;
var initialColor = tileProvider._firstPassInitialColor;
@@ -1922,7 +1923,7 @@ import TileSelectionResult from './TileSelectionResult.js';
surfaceShaderSetOptions.colorToAlpha = applyColorToAlpha;
var count = surfaceTile.renderedMesh.indices.length;
- if (!tileProvider.showSkirts) {
+ if (!showSkirts) {
count = surfaceTile.renderedMesh.indexCountWithoutSkirts;
}
diff --git a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js
index 4cbca27469ea..220fe1271437 100644
--- a/Source/Scene/GoogleEarthEnterpriseImageryProvider.js
+++ b/Source/Scene/GoogleEarthEnterpriseImageryProvider.js
@@ -2,7 +2,6 @@ import Credit from '../Core/Credit.js';
import decodeGoogleEarthEnterpriseData from '../Core/decodeGoogleEarthEnterpriseData.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import GeographicTilingScheme from '../Core/GeographicTilingScheme.js';
@@ -140,7 +139,7 @@ import when from '../ThirdParty/when.js';
});
}
- defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, {
+ Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, {
/**
* Gets the name of the Google Earth Enterprise server url hosting the imagery.
* @memberof GoogleEarthEnterpriseImageryProvider.prototype
diff --git a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js
index e8f1a6072ffb..d29615938f20 100644
--- a/Source/Scene/GoogleEarthEnterpriseMapsProvider.js
+++ b/Source/Scene/GoogleEarthEnterpriseMapsProvider.js
@@ -3,7 +3,6 @@ import Check from '../Core/Check.js';
import Credit from '../Core/Credit.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
import GeographicTilingScheme from '../Core/GeographicTilingScheme.js';
@@ -221,7 +220,7 @@ import ImageryProvider from './ImageryProvider.js';
requestMetadata();
}
- defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, {
+ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, {
/**
* Gets the URL of the Google Earth MapServer.
* @memberof GoogleEarthEnterpriseMapsProvider.prototype
@@ -582,7 +581,7 @@ import ImageryProvider from './ImageryProvider.js';
GoogleEarthEnterpriseMapsProvider._logoUrl = undefined;
- defineProperties(GoogleEarthEnterpriseMapsProvider, {
+ Object.defineProperties(GoogleEarthEnterpriseMapsProvider, {
/**
* Gets or sets the URL to the Google Earth logo for display in the credit.
* @memberof GoogleEarthEnterpriseMapsProvider
diff --git a/Source/Scene/GridImageryProvider.js b/Source/Scene/GridImageryProvider.js
index 5ceed292b615..d78286fd9e94 100644
--- a/Source/Scene/GridImageryProvider.js
+++ b/Source/Scene/GridImageryProvider.js
@@ -1,7 +1,6 @@
import Color from '../Core/Color.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import Event from '../Core/Event.js';
import GeographicTilingScheme from '../Core/GeographicTilingScheme.js';
import when from '../ThirdParty/when.js';
@@ -55,7 +54,7 @@ import when from '../ThirdParty/when.js';
this._readyPromise = when.resolve(true);
}
- defineProperties(GridImageryProvider.prototype, {
+ Object.defineProperties(GridImageryProvider.prototype, {
/**
* Gets the proxy used by this provider.
* @memberof GridImageryProvider.prototype
diff --git a/Source/Scene/GroundPolylinePrimitive.js b/Source/Scene/GroundPolylinePrimitive.js
index 383b4998b38c..5d6cdaef5fdb 100644
--- a/Source/Scene/GroundPolylinePrimitive.js
+++ b/Source/Scene/GroundPolylinePrimitive.js
@@ -2,13 +2,11 @@ import ApproximateTerrainHeights from '../Core/ApproximateTerrainHeights.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import GeometryInstance from '../Core/GeometryInstance.js';
import GeometryInstanceAttribute from '../Core/GeometryInstanceAttribute.js';
import GroundPolylineGeometry from '../Core/GroundPolylineGeometry.js';
-import isArray from '../Core/isArray.js';
import DrawCommand from '../Renderer/DrawCommand.js';
import Pass from '../Renderer/Pass.js';
import RenderState from '../Renderer/RenderState.js';
@@ -207,7 +205,7 @@ import StencilOperation from './StencilOperation.js';
});
}
- defineProperties(GroundPolylinePrimitive.prototype, {
+ Object.defineProperties(GroundPolylinePrimitive.prototype, {
/**
* Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
*
@@ -349,11 +347,7 @@ import StencilOperation from './StencilOperation.js';
// Helps with varying budget.
var fs = primitive._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS);
- // Tesselation on these volumes tends to be low,
- // which causes problems when interpolating log depth from vertices.
- // So force computing and writing log depth in the fragment shader.
- // Re-enable at far distances to avoid z-fighting.
- var vsDefines = ['ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT', 'GLOBE_MINIMUM_ALTITUDE ' + frameState.mapProjection.ellipsoid.minimumRadius.toFixed(1)];
+ var vsDefines = ['GLOBE_MINIMUM_ALTITUDE ' + frameState.mapProjection.ellipsoid.minimumRadius.toFixed(1)];
var colorDefine = '';
var materialShaderSource = '';
if (defined(appearance.material)) {
@@ -596,7 +590,7 @@ import StencilOperation from './StencilOperation.js';
var that = this;
var primitiveOptions = this._primitiveOptions;
if (!defined(this._primitive)) {
- var geometryInstances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ var geometryInstances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
var geometryInstancesLength = geometryInstances.length;
var groundInstances = new Array(geometryInstancesLength);
diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js
index e0087771a849..984ca5ca6458 100644
--- a/Source/Scene/GroundPrimitive.js
+++ b/Source/Scene/GroundPrimitive.js
@@ -5,11 +5,9 @@ import Cartographic from '../Core/Cartographic.js';
import Check from '../Core/Check.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import GeometryInstance from '../Core/GeometryInstance.js';
-import isArray from '../Core/isArray.js';
import OrientedBoundingBox from '../Core/OrientedBoundingBox.js';
import Rectangle from '../Core/Rectangle.js';
import when from '../ThirdParty/when.js';
@@ -119,7 +117,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js';
var appearance = options.appearance;
var geometryInstances = options.geometryInstances;
if (!defined(appearance) && defined(geometryInstances)) {
- var geometryInstancesArray = isArray(geometryInstances) ? geometryInstances : [geometryInstances];
+ var geometryInstancesArray = Array.isArray(geometryInstances) ? geometryInstances : [geometryInstances];
var geometryInstanceCount = geometryInstancesArray.length;
for (var i = 0; i < geometryInstanceCount; i++) {
var attributes = geometryInstancesArray[i].attributes;
@@ -237,7 +235,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js';
};
}
- defineProperties(GroundPrimitive.prototype, {
+ Object.defineProperties(GroundPrimitive.prototype, {
/**
* When true
, geometry vertices are optimized for the pre and post-vertex-shader caches.
*
@@ -619,7 +617,7 @@ import ShadowVolumeAppearance from './ShadowVolumeAppearance.js';
var geometry;
var instanceType;
- var instances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ var instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
var length = instances.length;
var groundInstances = new Array(length);
diff --git a/Source/Scene/HeightReference.js b/Source/Scene/HeightReference.js
index be5ffb823af2..40fbf5bd5041 100644
--- a/Source/Scene/HeightReference.js
+++ b/Source/Scene/HeightReference.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* Represents the position relative to the terrain.
@@ -27,4 +26,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
RELATIVE_TO_GROUND : 2
};
-export default freezeObject(HeightReference);
+export default Object.freeze(HeightReference);
diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js
index a382f9b0182d..aa78990d79b9 100644
--- a/Source/Scene/HorizontalOrigin.js
+++ b/Source/Scene/HorizontalOrigin.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
@@ -40,4 +39,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
RIGHT : -1
};
-export default freezeObject(HorizontalOrigin);
+export default Object.freeze(HorizontalOrigin);
diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js
index 4fced226f8b4..bf13c33ee4ac 100644
--- a/Source/Scene/ImageryLayer.js
+++ b/Source/Scene/ImageryLayer.js
@@ -2,7 +2,6 @@ import Cartesian2 from '../Core/Cartesian2.js';
import Cartesian4 from '../Core/Cartesian4.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import FeatureDetection from '../Core/FeatureDetection.js';
@@ -259,7 +258,7 @@ import TileImagery from './TileImagery.js';
this.colorToAlphaThreshold = defaultValue(options.colorToAlphaThreshold, ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD);
}
- defineProperties(ImageryLayer.prototype, {
+ Object.defineProperties(ImageryLayer.prototype, {
/**
* Gets the imagery provider for this layer.
@@ -1025,18 +1024,18 @@ import TileImagery from './TileImagery.js';
// output pixel. So we used a grid of 256x256 vertices, because most of our imagery
// tiles are 256x256. Fortunately the grid could be created and uploaded to the GPU just once and
// re-used for all reprojections, so the performance was virtually unchanged from our original fragment
- // shader approach. See https://github.com/AnalyticalGraphicsInc/cesium/pull/714.
+ // shader approach. See https://github.com/CesiumGS/cesium/pull/714.
//
- // Over a year later, we noticed (https://github.com/AnalyticalGraphicsInc/cesium/issues/2110)
+ // Over a year later, we noticed (https://github.com/CesiumGS/cesium/issues/2110)
// that our reprojection code was creating a rare but severe artifact on some GPUs (Intel HD 4600
// for one). The problem was that the GLSL sin function on these GPUs had a discontinuity at fine scales in
// a few places.
//
// We solved this by implementing a more reliable sin function based on the CORDIC algorithm
- // (https://github.com/AnalyticalGraphicsInc/cesium/pull/2111). Even though this was a fair
+ // (https://github.com/CesiumGS/cesium/pull/2111). Even though this was a fair
// amount of code to be executing per vertex, the performance seemed to be pretty good on most GPUs.
// Unfortunately, on some GPUs, the performance was absolutely terrible
- // (https://github.com/AnalyticalGraphicsInc/cesium/issues/2258).
+ // (https://github.com/CesiumGS/cesium/issues/2258).
//
// So that brings us to our current solution, the one you see here. Effectively, we compute the Web
// Mercator texture coordinates on the CPU and store the T coordinate with each vertex (the S coordinate
diff --git a/Source/Scene/ImageryLayerCollection.js b/Source/Scene/ImageryLayerCollection.js
index 658bf5d224be..c47108aeb6c7 100644
--- a/Source/Scene/ImageryLayerCollection.js
+++ b/Source/Scene/ImageryLayerCollection.js
@@ -1,6 +1,5 @@
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
import Event from '../Core/Event.js';
@@ -57,7 +56,7 @@ import ImageryLayer from './ImageryLayer.js';
this.layerShownOrHidden = new Event();
}
- defineProperties(ImageryLayerCollection.prototype, {
+ Object.defineProperties(ImageryLayerCollection.prototype, {
/**
* Gets the number of layers in this collection.
* @memberof ImageryLayerCollection.prototype
diff --git a/Source/Scene/ImageryProvider.js b/Source/Scene/ImageryProvider.js
index 9d3dda636915..b30735cef7c2 100644
--- a/Source/Scene/ImageryProvider.js
+++ b/Source/Scene/ImageryProvider.js
@@ -1,6 +1,5 @@
import Check from '../Core/Check.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import DeveloperError from '../Core/DeveloperError.js';
import loadCRN from '../Core/loadCRN.js';
import loadKTX from '../Core/loadKTX.js';
@@ -103,7 +102,7 @@ import Resource from '../Core/Resource.js';
DeveloperError.throwInstantiationError();
}
- defineProperties(ImageryProvider.prototype, {
+ Object.defineProperties(ImageryProvider.prototype, {
/**
* Gets a value indicating whether or not the provider is ready for use.
* @memberof ImageryProvider.prototype
diff --git a/Source/Scene/ImagerySplitDirection.js b/Source/Scene/ImagerySplitDirection.js
index 468da2ace576..c78f68b7eb79 100644
--- a/Source/Scene/ImagerySplitDirection.js
+++ b/Source/Scene/ImagerySplitDirection.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}.
@@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js';
*/
RIGHT : 1.0
};
-export default freezeObject(ImagerySplitDirection);
+export default Object.freeze(ImagerySplitDirection);
diff --git a/Source/Scene/ImageryState.js b/Source/Scene/ImageryState.js
index fcbeabfaaef3..76a8eb62f21d 100644
--- a/Source/Scene/ImageryState.js
+++ b/Source/Scene/ImageryState.js
@@ -1,4 +1,3 @@
-import freezeObject from '../Core/freezeObject.js';
/**
* @private
@@ -13,4 +12,4 @@ import freezeObject from '../Core/freezeObject.js';
INVALID : 6,
PLACEHOLDER : 7
};
-export default freezeObject(ImageryState);
+export default Object.freeze(ImageryState);
diff --git a/Source/Scene/Instanced3DModel3DTileContent.js b/Source/Scene/Instanced3DModel3DTileContent.js
index 33e6558166df..0320563f50cf 100644
--- a/Source/Scene/Instanced3DModel3DTileContent.js
+++ b/Source/Scene/Instanced3DModel3DTileContent.js
@@ -4,7 +4,6 @@ import Color from '../Core/Color.js';
import ComponentDatatype from '../Core/ComponentDatatype.js';
import defaultValue from '../Core/defaultValue.js';
import defined from '../Core/defined.js';
-import defineProperties from '../Core/defineProperties.js';
import deprecationWarning from '../Core/deprecationWarning.js';
import destroyObject from '../Core/destroyObject.js';
import DeveloperError from '../Core/DeveloperError.js';
@@ -26,8 +25,8 @@ import ModelInstanceCollection from './ModelInstanceCollection.js';
/**
* Represents the contents of a
- * {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel|Instanced 3D Model}
- * tile in a {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification|3D Tiles} tileset.
+ * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Instanced3DModel|Instanced 3D Model}
+ * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles} tileset.
*
* Implements the {@link Cesium3DTileContent} interface. *
@@ -53,7 +52,7 @@ import ModelInstanceCollection from './ModelInstanceCollection.js'; // This can be overridden for testing purposes Instanced3DModel3DTileContent._deprecationWarning = deprecationWarning; - defineProperties(Instanced3DModel3DTileContent.prototype, { + Object.defineProperties(Instanced3DModel3DTileContent.prototype, { featuresLength : { get : function() { return this._batchTable.featuresLength; diff --git a/Source/Scene/InvertClassification.js b/Source/Scene/InvertClassification.js index dcfbb8e32f6d..a6f47b30e33d 100644 --- a/Source/Scene/InvertClassification.js +++ b/Source/Scene/InvertClassification.js @@ -1,6 +1,5 @@ import Color from '../Core/Color.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import PixelFormat from '../Core/PixelFormat.js'; import ClearCommand from '../Renderer/ClearCommand.js'; @@ -63,7 +62,7 @@ import StencilOperation from './StencilOperation.js'; }; } - defineProperties(InvertClassification.prototype, { + Object.defineProperties(InvertClassification.prototype, { unclassifiedCommand : { get : function() { return this._unclassifiedCommand; diff --git a/Source/Scene/IonImageryProvider.js b/Source/Scene/IonImageryProvider.js index e62ca19c93ee..1ec5a136a80c 100644 --- a/Source/Scene/IonImageryProvider.js +++ b/Source/Scene/IonImageryProvider.js @@ -1,7 +1,6 @@ import Check from '../Core/Check.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import Event from '../Core/Event.js'; import IonResource from '../Core/IonResource.js'; @@ -183,7 +182,7 @@ import WebMapTileServiceImageryProvider from './WebMapTileServiceImageryProvider }); } - defineProperties(IonImageryProvider.prototype, { + Object.defineProperties(IonImageryProvider.prototype, { /** * Gets a value indicating whether or not the provider is ready for use. * @memberof IonImageryProvider.prototype diff --git a/Source/Scene/IonWorldImageryStyle.js b/Source/Scene/IonWorldImageryStyle.js index b889774a13b1..c1f6a9d7b0af 100644 --- a/Source/Scene/IonWorldImageryStyle.js +++ b/Source/Scene/IonWorldImageryStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; // Note, these values map directly to ion asset ids. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ ROAD : 4 }; -export default freezeObject(IonWorldImageryStyle); +export default Object.freeze(IonWorldImageryStyle); diff --git a/Source/Scene/JobScheduler.js b/Source/Scene/JobScheduler.js index 4258abe3298b..38467b462197 100644 --- a/Source/Scene/JobScheduler.js +++ b/Source/Scene/JobScheduler.js @@ -1,5 +1,4 @@ import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import getTimestamp from '../Core/getTimestamp.js'; import JobType from './JobType.js'; @@ -33,7 +32,7 @@ import JobType from './JobType.js'; this.starvedLastFrame = false; } - defineProperties(JobTypeBudget.prototype, { + Object.defineProperties(JobTypeBudget.prototype, { total : { get : function() { return this._total; @@ -96,7 +95,7 @@ import JobType from './JobType.js'; // For unit testing JobScheduler.getTimestamp = getTimestamp; - defineProperties(JobScheduler.prototype, { + Object.defineProperties(JobScheduler.prototype, { totalBudget : { get : function() { return this._totalBudget; diff --git a/Source/Scene/JobType.js b/Source/Scene/JobType.js index eaa5410c2dbb..38fe3f6da705 100644 --- a/Source/Scene/JobType.js +++ b/Source/Scene/JobType.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * @private @@ -9,4 +8,4 @@ import freezeObject from '../Core/freezeObject.js'; BUFFER : 2, NUMBER_OF_JOB_TYPES : 3 }; -export default freezeObject(JobType); +export default Object.freeze(JobType); diff --git a/Source/Scene/Label.js b/Source/Scene/Label.js index 44693c51c353..688e4eea6564 100644 --- a/Source/Scene/Label.js +++ b/Source/Scene/Label.js @@ -4,10 +4,8 @@ import Cartesian3 from '../Core/Cartesian3.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js'; -import freezeObject from '../Core/freezeObject.js'; import NearFarScalar from '../Core/NearFarScalar.js'; import Billboard from './Billboard.js'; import HeightReference from './HeightReference.js'; @@ -20,7 +18,7 @@ import VerticalOrigin from './VerticalOrigin.js'; var fontInfoCacheLength = 0; var fontInfoCacheMaxSize = 256; - var textTypes = freezeObject({ + var textTypes = Object.freeze({ LTR : 0, RTL : 1, WEAK : 2, @@ -186,7 +184,7 @@ import VerticalOrigin from './VerticalOrigin.js'; this._updateClamping(); } - defineProperties(Label.prototype, { + Object.defineProperties(Label.prototype, { /** * Determines if this label will be shown. Use this to hide or show a label, instead * of removing it and re-adding it to the collection. diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js index ebf3bf4b82aa..fe92b9abdd43 100644 --- a/Source/Scene/LabelCollection.js +++ b/Source/Scene/LabelCollection.js @@ -3,7 +3,6 @@ import Cartesian2 from '../Core/Cartesian2.js'; import Color from '../Core/Color.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; import Matrix4 from '../Core/Matrix4.js'; @@ -623,7 +622,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js'; this.blendOption = defaultValue(options.blendOption, BlendOption.OPAQUE_AND_TRANSLUCENT); } - defineProperties(LabelCollection.prototype, { + Object.defineProperties(LabelCollection.prototype, { /** * Returns the number of labels in this collection. This is commonly used with * {@link LabelCollection#get} to iterate over all the labels diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index 8c56bef9a9fa..ee798adabfb5 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Describes how to draw a label. @@ -32,4 +31,4 @@ import freezeObject from '../Core/freezeObject.js'; */ FILL_AND_OUTLINE : 2 }; -export default freezeObject(LabelStyle); +export default Object.freeze(LabelStyle); diff --git a/Source/Scene/Light.js b/Source/Scene/Light.js index f3998d803b81..f09a908a4f83 100644 --- a/Source/Scene/Light.js +++ b/Source/Scene/Light.js @@ -1,4 +1,3 @@ -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; /** @@ -13,7 +12,7 @@ import DeveloperError from '../Core/DeveloperError.js'; function Light() { } - defineProperties(Light.prototype, { + Object.defineProperties(Light.prototype, { /** * The color of the light. * @memberof Light.prototype diff --git a/Source/Scene/MapMode2D.js b/Source/Scene/MapMode2D.js index 7e6f94fc11d1..2727ec072e58 100644 --- a/Source/Scene/MapMode2D.js +++ b/Source/Scene/MapMode2D.js @@ -1,4 +1,3 @@ -import freezeObject from '../Core/freezeObject.js'; /** * Describes how the map will operate in 2D. @@ -22,4 +21,4 @@ import freezeObject from '../Core/freezeObject.js'; */ INFINITE_SCROLL : 1 }; -export default freezeObject(MapMode2D); +export default Object.freeze(MapMode2D); diff --git a/Source/Scene/MapboxImageryProvider.js b/Source/Scene/MapboxImageryProvider.js index 3f24235eb2db..8afea8d9147d 100644 --- a/Source/Scene/MapboxImageryProvider.js +++ b/Source/Scene/MapboxImageryProvider.js @@ -1,7 +1,6 @@ import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import MapboxApi from '../Core/MapboxApi.js'; import Resource from '../Core/Resource.js'; @@ -94,7 +93,7 @@ import UrlTemplateImageryProvider from './UrlTemplateImageryProvider.js'; }); } - defineProperties(MapboxImageryProvider.prototype, { + Object.defineProperties(MapboxImageryProvider.prototype, { /** * Gets the URL of the Mapbox server. * @memberof MapboxImageryProvider.prototype diff --git a/Source/Scene/MapboxStyleImageryProvider.js b/Source/Scene/MapboxStyleImageryProvider.js index 1c795d5810ff..2b3d91278f3c 100644 --- a/Source/Scene/MapboxStyleImageryProvider.js +++ b/Source/Scene/MapboxStyleImageryProvider.js @@ -1,7 +1,6 @@ import Credit from '../Core/Credit.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import DeveloperError from '../Core/DeveloperError.js'; import MapboxApi from '../Core/MapboxApi.js'; import Resource from '../Core/Resource.js'; @@ -99,7 +98,7 @@ function MapboxStyleImageryProvider(options) { }); } -defineProperties(MapboxStyleImageryProvider.prototype, { +Object.defineProperties(MapboxStyleImageryProvider.prototype, { /** * Gets the URL of the Mapbox server. * @memberof MapboxStyleImageryProvider.prototype diff --git a/Source/Scene/Material.js b/Source/Scene/Material.js index 91f950d5d022..59d00a89ce99 100644 --- a/Source/Scene/Material.js +++ b/Source/Scene/Material.js @@ -5,10 +5,8 @@ import combine from '../Core/combine.js'; import createGuid from '../Core/createGuid.js'; import defaultValue from '../Core/defaultValue.js'; import defined from '../Core/defined.js'; -import defineProperties from '../Core/defineProperties.js'; import destroyObject from '../Core/destroyObject.js'; import DeveloperError from '../Core/DeveloperError.js'; -import isArray from '../Core/isArray.js'; import loadCRN from '../Core/loadCRN.js'; import loadKTX from '../Core/loadKTX.js'; import Matrix2 from '../Core/Matrix2.js'; @@ -43,7 +41,7 @@ import when from '../ThirdParty/when.js'; * A Material defines surface appearance through a combination of diffuse, specular, * normal, emission, and alpha components. These values are specified using a * JSON schema called Fabric which gets parsed and assembled into glsl shader code - * behind-the-scenes. Check out the {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|wiki page} + * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} * for more details on Fabric. *Search and highlight occurences of the selected text.
- -To optimize loading CodeMirror, especially when including a - bunch of different modes, it is recommended that you combine and - minify (and preferably also gzip) the scripts. This page makes - those first two steps very easy. Simply select the version and - scripts you need in the form below, and - click Compress to download the minified script - file.
- - - - - -19-09-2014: Version 4.6:
- -findWordAt
21-08-2014: Version 4.5:
- -goLineLeftSmart
21-07-2014: Version 4.4:
- -"change"
is still guaranteed to fire
- before "cursorActivity"
)23-06-2014: Version 4.3:
- -:substitute
, :global
command.
- cursorBlinkRate
- to a negative value.19-05-2014: Version 4.2:
- -22-04-2014: Version 4.1:
- -"cursorActivity"
- event now fires after all other events for the operation (and only
- for handlers that were actually registered at the time the
- activity happened).insertSoftTab
.20-03-2014: Version 4.0:
- -This is a new major version of CodeMirror. There - are a few incompatible changes in the API. Upgrade - with care, and read the upgrading - guide.
- -22-04-2014: Version 3.24:
- -Merges the improvements from 4.1 that could - easily be applied to the 3.x code. Also improves the way the editor - size is updated when line widgets change.
- -20-03-2014: Version 3.23:
- -brackets
style to angle brackets, fix
- case-sensitivity of tags for HTML.21-02-2014: Version 3.22:
- -findMarks
method.16-01-2014: Version 3.21:
- -clearWhenEmpty
to control auto-removal.getHelpers
, and to register helpers matched on predicates with registerGlobalHelper
.21-11-2013: Version 3.20:
- -21-10-2013: Version 3.19:
- -23-09-2013: Version 3.18:
- -Emergency release to fix a problem in 3.17
- where .setOption("lineNumbers", false)
would raise an
- error.
23-09-2013: Version 3.17:
- -css-lint
, css-hint
.box-sizing
.21-08-2013: Version 3.16:
- -CodeMirror.fold.comment
.29-07-2013: Version 3.15:
- -getModeAt
.20-06-2013: Version 3.14:
- -markText
- and addLineWidget
- now take a handleMouseEvents
option.lineAtHeight
,
- getTokenTypeAt
.changeGeneration
- and isClean
."keyHandled"
- and "inputRead"
.20-05-2013: Version 3.13:
- -cursorScrollMargin
and coverGutterNextToScrollbar
.19-04-2013: Version 3.12:
- -maxHighlightLength
- and historyEventDelay
.addToHistory
- option for markText
.20-03-2013: Version 3.11:
- -collapserange
,
- formatting
, and simple-hint
- addons. plsql
and mysql
modes
- (use sql
mode).continuecomment
- addon now exposes an option, rather than a command.placeholder
, HTML completion.hasFocus
, defaultCharWidth
.beforeCursorEnter
, renderLine
.show-hint
completion
- dialog addon.21-02-2013: Version 3.1:
- -CodeMirror.Pass
to signal they
- didn't handle the key.simple-hint.js
.insertLeft
option
- to setBookmark
.eachLine
- method to iterate over a document."beforeChange"
- and "beforeSelectionChange"
- events."hide"
- and "unhide"
- events to marked ranges.coordsChar
's
- interpretation of its argument to match the documentation.25-01-2013: Version 3.02:
- -Single-bugfix release. Fixes a problem that - prevents CodeMirror instances from being garbage-collected after - they become unused.
- -21-01-2013: Version 3.01:
- -/addon
. You might have to adjust your
- paths.rtlMoveVisually
option.showIfHidden
option for line widgets.fixedGutter
option.10-12-2012: Version 3.0:
- -New major version. Only - partially backwards-compatible. See - the upgrading guide for more - information. Changes since release candidate 2:
- -20-11-2012: Version 3.0, release candidate 2:
- -addKeyMap
and removeKeyMap
methods.formatting
and closetag
add-ons.20-11-2012: Version 3.0, release candidate 1:
- -addLineClass
- and removeLineClass
,
- drop setLineClass
.isClean
/markClean
methods.compoundChange
method, use better undo-event-combining heuristic.22-10-2012: Version 3.0, beta 2:
- -gutterClick
event.cursorHeight
option.viewportMargin
option.flattenSpans
option.19-09-2012: Version 3.0, beta 1:
- -21-01-2013: Version 2.38:
- -Integrate some bugfixes, enhancements to the vim keymap, and new - modes - (D, Sass, APL) - from the v3 branch.
- -20-12-2012: Version 2.37:
- -20-11-2012: Version 2.36:
- -scrollIntoView
public.defaultTextHeight
method.22-10-2012: Version 2.35:
- -markText
/undo interaction.defineInitHook
function.19-09-2012: Version 2.34:
- -compareStates
is no longer needed.onHighlightComplete
no longer works.CodeMirror.version
property.23-08-2012: Version 2.33:
- -getViewPort
and onViewportChange
API.false
disabling handling (again).innerHTML
. Remove CodeMirror.htmlEscape
.23-07-2012: Version 2.32:
- -Emergency fix for a bug where an editor with - line wrapping on IE will break when there is no - scrollbar.
- -20-07-2012: Version 2.31:
- -setSize
method for programmatic resizing.getHistory
and setHistory
methods.getValue
and getRange
.22-06-2012: Version 2.3:
- -getScrollInfo
method.23-05-2012: Version 2.25:
- -23-04-2012: Version 2.24:
- -dragDrop
- and onDragEvent
- options.compoundChange
API method.catchall
in key maps,
- add nofallthrough
boolean field instead.26-03-2012: Version 2.23:
- -setLineClass
.charCoords
- and cursorCoords
with a mode
argument.autofocus
option.findMarksAt
method.27-02-2012: Version 2.22:
- -autoClearEmptyLines
option.27-01-2012: Version 2.21:
- -smartIndent
- option.readOnly
-mode.scrollTo
method.20-12-2011: Version 2.2:
- -coordsFromIndex
- to posFromIndex
,
- add indexFromPos
- method.21-11-2011: Version 2.18:
-Fixes TextMarker.clear
, which is broken in 2.17.
21-11-2011: Version 2.17:
-setBookmark
method.lib/util
.27-10-2011: Version 2.16:
-coordsFromIndex
method.setValue
now no longer clears history. Use clearHistory
for that.markText
now
- returns an object with clear
and find
- methods. Marked text is now more robust when edited.26-09-2011: Version 2.15:
-Fix bug that snuck into 2.14: Clicking the - character that currently has the cursor didn't re-focus the - editor.
- -26-09-2011: Version 2.14:
-fixedGutter
option.setValue
breaking cursor movement.23-08-2011: Version 2.13:
-getGutterElement
to API.smartHome
option.25-07-2011: Version 2.12:
-innerHTML
for HTML-escaping.04-07-2011: Version 2.11:
-replace
method to search cursors, for cursor-preserving replacements.getStateAfter
API and compareState
mode API methods for finer-grained mode magic.getScrollerElement
API method to manipulate the scrolling DIV.07-06-2011: Version 2.1:
-Add - a theme system - (demo). Note that this is not - backwards-compatible—you'll have to update your styles and - modes!
- -07-06-2011: Version 2.02:
-26-05-2011: Version 2.01:
-coordsChar
now worksonCursorActivity
interfered with onChange
.onChange
."nocursor"
mode for readOnly
option.onHighlightComplete
option.28-03-2011: Version 2.0:
-CodeMirror 2 is a complete rewrite that's - faster, smaller, simpler to use, and less dependent on browser - quirks. See this - and this - for more information.
- -22-02-2011: Version 2.0 beta 2:
-Somewhat more mature API, lots of bugs shaken out.
- -17-02-2011: Version 0.94:
-tabMode: "spaces"
was modified slightly (now indents when something is selected).08-02-2011: Version 2.0 beta 1:
-CodeMirror 2 is a complete rewrite of - CodeMirror, no longer depending on an editable frame.
- -19-01-2011: Version 0.93:
-save
method to instances created with fromTextArea
.28-03-2011: Version 1.0:
-17-12-2010: Version 0.92:
-styleNumbers
option is now officially
- supported and documented.onLineNumberClick
option added.onLoad
and
- onCursorActivity
callbacks. Old names still work, but
- are deprecated.11-11-2010: Version 0.91:
-toTextArea
to update the code in the textarea.noScriptCaching
option (hack to ease development).02-10-2010: Version 0.9:
-height: "dynamic"
more robust.enterMode
and electricChars
options to make indentation even more customizable.firstLineNumber
option.@media
rules by the CSS parser.22-07-2010: Version 0.8:
-cursorCoords
method to find the screen
- coordinates of the cursor.height: dynamic
mode, where the editor's
- height will adjust to the size of its content.toTextArea
method in instances created with
- fromTextArea
.27-04-2010: Version - 0.67:
-More consistent page-up/page-down behaviour
- across browsers. Fix some issues with hidden editors looping forever
- when line-numbers were enabled. Make PHP parser parse
- "\\"
correctly. Have jumpToLine
work on
- line handles, and add cursorLine
function to fetch the
- line handle where the cursor currently is. Add new
- setStylesheet
function to switch style-sheets in a
- running editor.
01-03-2010: Version - 0.66:
-Adds removeLine
method to API.
- Introduces the PLSQL parser.
- Marks XML errors by adding (rather than replacing) a CSS class, so
- that they can be disabled by modifying their style. Fixes several
- selection bugs, and a number of small glitches.
12-11-2009: Version - 0.65:
-Add support for having both line-wrapping and
- line-numbers turned on, make paren-highlighting style customisable
- (markParen
and unmarkParen
config
- options), work around a selection bug that Opera
- reintroduced in version 10.
23-10-2009: Version - 0.64:
-Solves some issues introduced by the
- paste-handling changes from the previous release. Adds
- setSpellcheck
, setTextWrapping
,
- setIndentUnit
, setUndoDepth
,
- setTabMode
, and setLineNumbers
to
- customise a running editor. Introduces an SQL parser. Fixes a few small
- problems in the Python
- parser. And, as usual, add workarounds for various newly discovered
- browser incompatibilities.
31-08-2009: Version 0.63:
-Overhaul of paste-handling (less fragile), fixes for several - serious IE8 issues (cursor jumping, end-of-document bugs) and a number - of small problems.
- -30-05-2009: Version 0.62:
-Introduces Python
- and Lua parsers. Add
- setParser
(on-the-fly mode changing) and
- clearHistory
methods. Make parsing passes time-based
- instead of lines-based (see the passTime
option).
Simple mode that tries to handle C-like languages as well as it
- can. Takes two configuration parameters: keywords
, an
- object whose property names are the keywords in the language,
- and useCPP
, which determines whether C preprocessor
- directives are recognized.
MIME types defined: text/x-csrc
- (C code), text/x-c++src
(C++
- code), text/x-java
(Java
- code), text/x-csharp
(C#).
MIME types defined: text/x-clojure
.
Developed by Hadi Hariri (https://github.com/hhariri).
-MIME type defined: text/x-kotlin
.
MIME types defined: text/n-triples
.
The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML - mixed mode itself depends on XML, JavaScript, and CSS modes.
- -It takes the same options, as Smarty and HTML mixed modes.
- -MIME types defined: text/x-smarty
.
MIME type defined: text/x-vb
.
` elements inside the editor. + +Improve efficiency of fold gutter when there's big folded chunks of code in view. + +Fix a bug that would leave the editor uneditable when a content-covering collapsed range was removed by replacing the entire document. + +[julia mode](https://codemirror.net/mode/julia/): Support number separators. + +[asterisk mode](https://codemirror.net/mode/asterisk/): Improve comment support. + +[handlebars mode](https://codemirror.net/mode/handlebars/): Support triple-brace tags. + +## 5.48.2 (2019-07-20) + +### Bug fixes + +[vim bindings](https://codemirror.net/demo/vim.html): Adjust char escape substitution to match vim, support `&/$0`. + +[search addon](https://codemirror.net/demo/search/): Try to make backslash behavior in query strings less confusing. + +[javascript mode](https://codemirror.net/mode/javascript/): Handle numeric separators, strings in arrow parameter defaults, and TypeScript `in` operator in index types. + +[sparql mode](https://codemirror.net/mode/sparql/index.html): Allow non-ASCII identifier characters. + +## 5.48.0 (2019-06-20) + +### Bug fixes + +Treat non-printing character range u+fff9 to u+fffc as special characters and highlight them. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix positioning when the dialog is placed in a scrollable container. + +### New features + +Add [`selectLeft`](https://codemirror.net/doc/manual.html#mark_selectLeft)/[`selectRight`](https://codemirror.net/doc/manual.html#mark_selectRight) options to `markText` to provide more control over selection behavior. + +## 5.47.0 (2019-05-21) + +### Bug fixes + +[python mode](https://codemirror.net/mode/python/): Properly handle `...` syntax. + +[ruby mode](https://codemirror.net/mode/ruby): Fix indenting before closing brackets. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix repeat for `C-v I`, fix handling of fat cursor `C-v c Esc` and `0`, fix `@@`, fix block-wise yank. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Add support for `` ` `` text object. + +## 5.46.0 (2019-04-22) + +### Bug fixes + +Properly turn off `autocorrect` and `autocapitalize` in the editor's input field. + +Fix issue where calling [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc) during a mouse drag would cause an error. + +Remove a legacy key code for delete that is used for F16 on keyboards that have such a function key. + +[matchesonscrollbar addon](https://codemirror.net/doc/manual.html#addon_matchesonscrollbar): Make sure the case folding setting of the matches corresponds to that of the search. + +[swift mode](https://codemirror.net/mode/swift): Fix handling of empty strings. + +### New features + +Allow [gutters](https://codemirror.net/doc/manual.html#option_gutters) to specify direct CSS strings. + +## 5.45.0 (2019-03-20) + +### Bug fixes + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve heuristic for when to auto-close newly typed brackets. + +[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Fix 16.30. brixplkatz 13 + +[vim bindings](https://codemirror.net/demo/vim.html): Ignore<
and>
when matching other brackets. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Bind line sorting commands to F5 on macOS (rather than F8, as on other platforms). + +[julia mode](https://codemirror.net/mode/julia/): Fix bug that'd cause the mode get stuck. + +### New features + +New theme: [yoncé](https://codemirror.net/demo/theme.html#yonce). + +[xml-hint addon](https://codemirror.net/doc/manual.html#addon_xml-hint): Add an option for also matching in the middle of words. + +## 5.44.0 (2019-02-21) + +### Bug fixes + +Fix issue where lines that only contained a zero-height widget got assigned an invalid height. + +Improve support for middle-click paste on X Windows. + +Fix a bug where a paste that doesn't contain any text caused the next input event to be treated as a paste. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix accidental global variable. + +[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript `this` parameter declaration, prefixed `|` and `&` sigils in types, and improve parsing of `for`/`in` loops. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Properly emulate forward-delete. + +New theme: [nord](https://codemirror.net/demo/theme.html#nord). + +## 5.43.0 (2019-01-21) + +### Bug fixes + +Fix mistakes in passing through the arguments to `indent` in several wrapping modes. + +[javascript mode](https://codemirror.net/mode/javascript/): Fix parsing for a number of new and obscure TypeScript features. + +[ruby mode](https://codemirror.net/mode/ruby): Support indented end tokens for heredoc strings. + +### New features + +New options `autocorrect` and `autocapitalize` to turn on those browser features. + +## 5.42.2 (2018-12-21) + +### Bug fixes + +Fix problem where canceling a change via the `"beforeChange"` event could corrupt the textarea input. + +Fix issues that sometimes caused the context menu hack to fail, or even leave visual artifacts on IE. + +[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to select text between angle brackets. + +[css mode](https://codemirror.net/mode/css/): Fix tokenizing of CSS variables. + +[python mode](https://codemirror.net/mode/python/): Fix another bug in tokenizing of format strings. + +[soy mode](https://codemirror.net/mode/soy/): More accurate highlighting. + +## 5.42.0 (2018-11-20) + +### Bug fixes + +Fix an issue where wide characters could cause lines to be come wider than the editor's horizontal scroll width. + +Optimize handling of window resize events. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Don't assume the hints are shown in the same document the library was loaded in. + +[python mode](https://codemirror.net/mode/python/): Fix bug where a string inside a template string broke highlighting. + +[swift mode](https://codemirror.net/mode/swift): Support multi-line strings. + +### New features + +The [`markText` method](https://codemirror.net/doc/manual.html#markText) now takes an [`attributes`](https://codemirror.net/doc/manual.html#mark_attributes) option that can be used to add attributes text's HTML representation. + +[vim bindings](https://codemirror.net/demo/vim.html): Add support for the `=` binding. + +## 5.41.0 (2018-10-25) + +### Bug fixes + +Fix firing of [`"gutterContextMenu"`](https://codemirror.net/doc/manual.html#event_gutterContextMenu) event on Firefox. + +Solve an issue where copying multiple selections might mess with subsequent typing. + +Don't crash when [`endOperation`](https://codemirror.net/doc/manual.html#endOperation) is called with no operation active. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix insert mode repeat after visualBlock edits. + +[scheme mode](https://codemirror.net/mode/scheme/index.html): Improve highlighting of quoted expressions. + +[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments. + +[objective c mode](https://codemirror.net/mode/clike/): Improve conformance to the actual language. + +### New features + +A new [`selectionsMayTouch`](https://codemirror.net/doc/manual.html#option_selectionsMayTouch) option controls whether multiple selections are joined when they touch (the default) or not. + +[vim bindings](https://codemirror.net/demo/vim.html): Add `noremap` binding command. + +## 5.40.2 (2018-09-20) + +### Bug fixes + +Fix firing of `gutterContextMenu` event on Firefox. + +Add `hintWords` (basic completion) helper to [clojure](https://codemirror.net/mode/clojure/index.html), [mllike](https://codemirror.net/mode/mllike/index.html), [julia](https://codemirror.net/mode/julia/), [shell](https://codemirror.net/mode/shell/), and [r](https://codemirror.net/mode/r/) modes. + +[clojure mode](https://codemirror.net/mode/clojure/index.html): Clean up and improve. + +## 5.40.0 (2018-08-25) + +### Bug fixes + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Fix issue where bracket-closing wouldn't work before punctuation. + +[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Fix problem where replacing the last remaining panel dropped the newly added panel. + +[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Fix an infinite loop when the indention is greater than the target column. + +[jinja2](https://codemirror.net/mode/jinja2/) and [markdown](https://codemirror.net/mode/markdown/) modes: Add comment metadata. + +### New features + +New method [`phrase`](https://codemirror.net/doc/manual.html#phrase) and option [`phrases`](https://codemirror.net/doc/manual.html#option_phrases) to make translating UI text in addons easier. + +## 5.39.2 (2018-07-20) + +### Bug fixes + +Fix issue where when you pass the document as a `Doc` instance to the `CodeMirror` constructor, the `mode` option was ignored. + +Fix bug where line height could be computed wrong with a line widget below a collapsed line. + +Fix overeager `.npmignore` dropping the `bin/source-highlight` utility from the distribution. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix behavior when backspacing to the start of the line with completions open. + +## 5.39.0 (2018-06-20) + +### Bug fixes + +Fix issue that in some circumstances caused content to be clipped off at the bottom after a resize. + +[markdown mode](https://codemirror.net/mode/markdown/): Improve handling of blank lines in HTML tags. + +### New features + +[stex mode](https://codemirror.net/mode/stex/): Add an `inMathMode` option to start the mode in math mode. + +## 5.38.0 (2018-05-21) + +### Bug fixes + +Improve reliability of noticing a missing mouseup event during dragging. + +Make sure `getSelection` is always called on the correct document. + +Fix interpretation of line breaks and non-breaking spaces inserted by renderer in contentEditable mode. + +Work around some browsers inexplicably making the fake scrollbars focusable. + +Make sure `coordsChar` doesn't return positions inside collapsed ranges. + +[javascript mode](https://codemirror.net/mode/javascript/): Support block scopes, bindingless catch, bignum suffix, `s` regexp flag. + +[markdown mode](https://codemirror.net/mode/markdown/): Adjust a wasteful regexp. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Allow opening the control without any item selected. + +### New features + +New theme: [darcula](https://codemirror.net/demo/theme.html#darcula). + +[dialog addon](https://codemirror.net/doc/manual.html#addon_dialog): Add a CSS class (`dialog-opened`) to the editor when a dialog is open. + +## 5.37.0 (2018-04-20) + +### Bug fixes + +Suppress keypress events during composition, for platforms that don't properly do this themselves. + +[xml-fold addon](https://codemirror.net/demo/folding.html): Improve handling of line-wrapped opening tags. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve TypeScript support. + +[python mode](https://codemirror.net/mode/python/): Highlight expressions inside format strings. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Add support for '(' and ')' movement. + +New themes: [idea](https://codemirror.net/demo/theme.html#idea), [ssms](https://codemirror.net/demo/theme.html#ssms), [gruvbox-dark](https://codemirror.net/demo/theme.html#gruvbox-dark). + +## 5.36.0 (2018-03-20) + +### Bug fixes + +Make sure all document-level event handlers are registered on the document that the editor is part of. + +Fix issue that prevented edits whose origin starts with `+` from being combined in history events for an editor-less document. + +[multiplex addon](https://codemirror.net/demo/multiplex.html): Improve handling of indentation. + +[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Use CSS `:after` element to style the scroll-lock icon. + +[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Don't provide completions in JSON mode. + +[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix numbering error. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Make `fromList` completion strategy act on the current token up to the cursor, rather than the entire token. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix a regexp with potentially exponental complexity. + +### New features + +New theme: [lucario](https://codemirror.net/demo/theme.html#lucario). + +## 5.35.0 (2018-02-20) + +### Bug fixes + +Fix problem where selection undo might change read-only documents. + +Fix crash when calling `addLineWidget` on a document that has no attached editor. + +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix behavior of `^` in multiline regexp mode. + +[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Fix problem with matching words that have regexp special syntax in them. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Fix `addCursorToSelection` for short lines. + +[javascript mode](https://codemirror.net/mode/javascript/): Support TypeScript intersection types, dynamic `import`. + +[stex mode](https://codemirror.net/mode/stex/): Fix parsing of `\(` `\)` delimiters, recognize more atom arguments. + +[haskell mode](https://codemirror.net/mode/haskell/): Highlight more builtins, support `<*` and `*>`. + +[sql mode](https://codemirror.net/mode/sql/): Make it possible to disable backslash escapes in strings for dialects that don't have them, do this for MS SQL. + +[dockerfile mode](https://codemirror.net/mode/dockerfile/): Highlight strings and ports, recognize more instructions. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Support alternative delimiters in replace command. + +## 5.34.0 (2018-01-29) + +### Bug fixes + +[markdown mode](https://codemirror.net/mode/markdown/): Fix a problem where inline styles would persist across list items. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Fix the `toggleBookmark` command. + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when closing triple quotes. + +[xml-fold addon](https://codemirror.net/demo/folding.html): Fix folding of line-broken XML tags. + +[shell mode](https://codemirror.net/mode/shell/): Better handling of nested quoting. + +[javascript-lint addon](https://codemirror.net/demo/lint.html): Clean up and simplify. + +[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix support for multiple editors at the same time. + +### New features + +New themes: [oceanic-next](https://codemirror.net/demo/theme.html#oceanic-next) and [shadowfox](https://codemirror.net/demo/theme.html#shadowfox). + +## 5.33.0 (2017-12-21) + +### Bug fixes + +[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Make updates more efficient. + +[css mode](https://codemirror.net/mode/css/): The mode is now properly case-insensitive. + +[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Fix broken handling of unordered lists introduced in previous release. + +[swift](https://codemirror.net/mode/swift) and [scala](https://codemirror.net/mode/clike/) modes: Support nested block comments. + +[mllike mode](https://codemirror.net/mode/mllike/index.html): Improve OCaml support. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Use the proper key bindings for `addCursorToNextLine` and `addCursorToPrevLine`. + +### New features + +[jsx mode](https://codemirror.net/mode/jsx/index.html): Support JSX fragments. + +[closetag addon](https://codemirror.net/demo/closetag.html): Add an option to disable auto-indenting. + +## 5.32.0 (2017-11-22) + +### Bug fixes + +Increase contrast on default bracket-matching colors. + +[javascript mode](https://codemirror.net/mode/javascript/): Recognize TypeScript type parameters for calls, type guards, and type parameter defaults. Improve handling of `enum` and `module` keywords. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix bug when uncommenting a comment that spans all but the last selected line. + +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix bug in case folding. + +[emacs bindings](https://codemirror.net/demo/emacs.html): Prevent single-character deletions from resetting the kill ring. + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Tweak quote matching behavior. + +### New features + +[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Increment ordered list numbers when adding one. + +## 5.31.0 (2017-10-20) + +### Bug fixes + +Further improve selection drawing and cursor motion in right-to-left documents. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix ctrl-w behavior, support quote-dot and backtick-dot marks, make the wide cursor visible in contentEditable [input mode](https://codemirror.net/doc/manual.html#option_contentEditable). + +[continuecomment addon](https://codemirror.net/doc/manual.html#addon_continuecomment): Fix bug when pressing enter after a single-line block comment. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix issue with leaving indented fenced code blocks. + +[javascript mode](https://codemirror.net/mode/javascript/): Fix bad parsing of operators without spaces between them. Fix some corner cases around semicolon insertion and regexps. + +### New features + +Modes added with [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) now have access to a [`baseToken`](https://codemirror.net/doc/manual.html#baseToken) method on their input stream, giving access to the tokens of the underlying mode. + +## 5.30.0 (2017-09-20) + +### Bug fixes + +Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text. + +[search addon](https://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search. + +[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug. + +[tern addon](https://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists. + +[gfm mode](https://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives. + +[soy mode](https://codemirror.net/mode/soy/): Support injected data and `@param` in comments. + +### New features + +[simple mode addon](https://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array. + +## 5.29.0 (2017-08-24) + +### Bug fixes + +Fix crash in contentEditable input style when editing near a bookmark. + +Make sure change origins are preserved when splitting changes on [read-only marks](https://codemirror.net/doc/manual.html#mark_readOnly). + +[javascript mode](https://codemirror.net/mode/javascript/): More support for TypeScript syntax. + +[d mode](https://codemirror.net/mode/d/): Support nested comments. + +[python mode](https://codemirror.net/mode/python/): Improve tokenizing of operators. + +[markdown mode](https://codemirror.net/mode/markdown/): Further improve CommonMark conformance. + +[css mode](https://codemirror.net/mode/css/): Don't run comment tokens through the mode's state machine. + +[shell mode](https://codemirror.net/mode/shell/): Allow strings to span lines. + +[search addon](https://codemirror.net/demo/search/): Fix crash in persistent search when `extraKeys` is null. + +## 5.28.0 (2017-07-21) + +### Bug fixes + +Fix copying of, or replacing editor content with, a single dash character when copying a big selection in some corner cases. + +Make [`"goLineLeft"`](https://codemirror.net/doc/manual.html#command_goLineLeft)/`"goLineRight"` behave better on wrapped lines. + +[sql mode](https://codemirror.net/mode/sql/): Fix tokenizing of multi-dot operator and allow digits in subfield names. + +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Fix infinite loop on some composed character inputs. + +[markdown mode](https://codemirror.net/mode/markdown/): Make list parsing more CommonMark-compliant. + +[gfm mode](https://codemirror.net/mode/gfm/): Highlight colon syntax for emoji. + +### New features + +Expose [`startOperation`](https://codemirror.net/doc/manual.html#startOperation) and `endOperation` for explicit operation management. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Add extend-selection (Ctrl-Alt- or Cmd-Shift-Up/Down). + +## 5.27.4 (2017-06-29) + +### Bug fixes + +Fix crash when using mode lookahead. + +[markdown mode](https://codemirror.net/mode/markdown/): Don't block inner mode's indentation support. + +## 5.27.2 (2017-06-22) + +### Bug fixes + +Fix crash in the [simple mode](https://codemirror.net/demo/simplemode.html)< addon. + +## 5.27.0 (2017-06-22) + +### Bug fixes + +Fix infinite loop in forced display update. + +Properly disable the hidden textarea when `readOnly` is `"nocursor"`. + +Calling the `Doc` constructor without `new` works again. + +[sql mode](https://codemirror.net/mode/sql/): Handle nested comments. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix bug where markup was ignored on indented paragraph lines. + +[vim bindings](https://codemirror.net/demo/vim.html): Referencing invalid registers no longer causes an uncaught exception. + +[rust mode](https://codemirror.net/mode/rust/): Add the correct MIME type. + +[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Document options. + +### New features + +Mouse button clicks can now be bound in keymaps by using names like `"LeftClick"` or `"Ctrl-Alt-MiddleTripleClick"`. When bound to a function, that function will be passed the position of the click as second argument. + +The behavior of mouse selection and dragging can now be customized with the [`configureMouse`](https://codemirror.net/doc/manual.html#option_configureMouse) option. + +Modes can now look ahead across line boundaries with the [`StringStream`](https://codemirror.net/doc/manual.html#StringStream)`.lookahead` method. + +Introduces a `"type"` token type, makes modes that recognize types output it, and add styling for it to the themes. + +New [`pasteLinesPerSelection`](https://codemirror.net/doc/manual.html#option_pasteLinesPerSelection) option to control the behavior of pasting multiple lines into multiple selections. + +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support multi-line regular expression matches, and normalize strings when matching. + +## 5.26.0 (2017-05-22) + +### Bug fixes + +In textarea-mode, don't reset the input field during composition. + +More careful restoration of selections in widgets, during editor redraw. + +[javascript mode](https://codemirror.net/mode/javascript/): More TypeScript parsing fixes. + +[julia mode](https://codemirror.net/mode/julia/): Fix issue where the mode gets stuck. + +[markdown mode](https://codemirror.net/mode/markdown/): Understand cross-line links, parse all bracketed things as links. + +[soy mode](https://codemirror.net/mode/soy/): Support single-quoted strings. + +[go mode](https://codemirror.net/mode/go/): Don't try to indent inside strings or comments. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Parse line offsets in line or range specs. + +## 5.25.2 (2017-04-20) + +### Bug fixes + +Better handling of selections that cover the whole viewport in contentEditable-mode. + +No longer accidentally scroll the editor into view when calling `setValue`. + +Work around Chrome Android bug when converting screen coordinates to editor positions. + +Make sure long-clicking a selection sets a cursor and doesn't show the editor losing focus. + +Fix issue where pointer events were incorrectly disabled on Chrome's overlay scrollbars. + +[javascript mode](https://codemirror.net/mode/javascript/): Recognize annotations and TypeScript-style type parameters. + +[shell mode](https://codemirror.net/mode/shell/): Handle nested braces. + +[markdown mode](https://codemirror.net/mode/markdown/): Make parsing of strong/em delimiters CommonMark-compliant. + +## 5.25.0 (2017-03-20) + +### Bug fixes + +In contentEditable-mode, properly locate changes that repeat a character when inserted with IME. + +Fix handling of selections bigger than the viewport in contentEditable mode. + +Improve handling of changes that insert or delete lines in contentEditable mode. + +Count Unicode control characters 0x80 to 0x9F as special (non-printing) chars. + +Fix handling of shadow DOM roots when finding the active element. + +Add `role=presentation` to more DOM elements to improve screen reader support. + +[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make aligning of unchanged chunks more robust. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (differnet) block comment. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax. + +[r mode](https://codemirror.net/mode/r/): Fix indentation after semicolon-less statements. + +[shell mode](https://codemirror.net/mode/shell/): Properly handle escaped parentheses in parenthesized expressions. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix a few bugs around leaving fenced code blocks. + +[soy mode](https://codemirror.net/mode/soy/): Improve indentation. + +### New features + +[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Support asynchronous linters that return promises. + +[continuelist addon](https://codemirror.net/doc/manual.html#addon_continuelist): Support continuing task lists. + +[vim bindings](https://codemirror.net/demo/vim.html): Make Y behave like yy. + +[sql mode](https://codemirror.net/mode/sql/): Support sqlite dialect. + +## 5.24.2 (2017-02-22) + +### Bug fixes + +[javascript mode](https://codemirror.net/mode/javascript/): Support computed class method names. + +[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Improve aligning of unchanged code in the presence of marks and line widgets. + +## 5.24.0 (2017-02-20) + +### Bug fixes + +A cursor directly before a line-wrapping break is now drawn before or after the line break depending on which direction you arrived from. + +Visual cursor motion in line-wrapped right-to-left text should be much more correct. + +Fix bug in handling of read-only marked text. + +[shell mode](https://codemirror.net/mode/shell/): Properly tokenize nested parentheses. + +[python mode](https://codemirror.net/mode/python/): Support underscores in number literals. + +[sass mode](https://codemirror.net/mode/sass/): Uses the full list of CSS properties and keywords from the CSS mode, rather than defining its own incomplete subset. + +[css mode](https://codemirror.net/mode/css/): Expose `lineComment` property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements. + +[julia mode](https://codemirror.net/mode/julia/): Properly indent `elseif` lines. + +[markdown mode](https://codemirror.net/mode/markdown/): Properly recognize the end of fenced code blocks when inside other markup. + +[scala mode](https://codemirror.net/mode/clike/): Improve handling of operators containing#
,@
, and:
chars. + +[xml mode](https://codemirror.net/mode/xml/): Allow dashes in HTML tag names. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of async methods, TypeScript-style comma-separated superclass lists. + +[indent-fold addon](https://codemirror.net/demo/folding.html): Ignore comment lines. + +### New features + +Positions now support a `sticky` property which determines whether they should be associated with the character before (value `"before"`) or after (value `"after"`) them. + +[vim bindings](https://codemirror.net/demo/vim.html): Make it possible to remove built-in bindings through the API. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Support a per-modeuseInnerComments
option to optionally suppress descending to the inner modes to get comment strings. + +### Breaking changes + +The [sass mode](https://codemirror.net/mode/sass/) now depends on the [css mode](https://codemirror.net/mode/css/). + +## 5.23.0 (2017-01-19) + +### Bug fixes + +Presentation-related elements DOM elements are now marked as such to help screen readers. + +[markdown mode](https://codemirror.net/mode/markdown/): Be more picky about what HTML tags look like to avoid false positives. + +### New features + +`findModeByMIME` now understands `+json` and `+xml` MIME suffixes. + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Add support for an `override` option to ignore language-specific defaults. + +[panel addon](https://codemirror.net/doc/manual.html#addon_panel): Add a `stable` option that auto-scrolls the content to keep it in the same place when inserting/removing a panel. + +## 5.22.2 (2017-01-12) + +### Bug fixes + +Include rollup.config.js in NPM package, so that it can be used to build from source. + +## 5.22.0 (2016-12-20) + +### Bug fixes + +[sublime bindings](https://codemirror.net/demo/sublime.html): Make `selectBetweenBrackets` work with multiple cursors. + +[javascript mode](https://codemirror.net/mode/javascript/): Fix issues with parsing complex TypeScript types, imports, and exports. + +A contentEditable editor instance with autofocus enabled no longer crashes during initializing. + +### New features + +[emacs bindings](https://codemirror.net/demo/emacs.html): Export `CodeMirror.emacs` to allow other addons to hook into Emacs-style functionality. + +[active-line addon](https://codemirror.net/doc/manual.html#addon_active-line): Add `nonEmpty` option. + +New event: [`optionChange`](https://codemirror.net/doc/manual.html#event_optionChange). + +## 5.21.0 (2016-11-21) + +### Bug fixes + +Tapping/clicking the editor in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle) on Chrome now puts the cursor at the tapped position. + +Fix various crashes and misbehaviors when reading composition events in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle). + +Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a ``. + +[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Fix several issues in the chunk-aligning feature. + +[verilog mode](https://codemirror.net/mode/verilog): Rewritten to address various issues. + +[julia mode](https://codemirror.net/mode/julia): Recognize Julia 0.5 syntax. + +[swift mode](https://codemirror.net/mode/swift): Various fixes and adjustments to current syntax. + +[markdown mode](https://codemirror.net/mode/markdown): Allow lists without a blank line above them. + +### New features + +The [`setGutterMarker`](https://codemirror.net/doc/manual.html#setGutterMarker), [`clearGutter`](https://codemirror.net/doc/manual.html#clearGutter), and [`lineInfo`](https://codemirror.net/doc/manual.html#lineInfo) methods are now available on `Doc` objects. + +The [`heightAtLine`](https://codemirror.net/doc/manual.html#heightAtLine) method now takes an extra argument to allow finding the height at the top of the line's line widgets. + +[ruby mode](https://codemirror.net/mode/ruby): `else` and `elsif` are now immediately indented. + +[vim bindings](https://codemirror.net/demo/vim.html): Bind Ctrl-T and Ctrl-D to in- and dedent in insert mode. + +## 5.20.2 (2016-10-21) + +### Bug fixes + +Fix `CodeMirror.version` returning the wrong version number. + +## 5.20.0 (2016-10-20) + +### Bug fixes + +Make `newlineAndIndent` command work with multiple cursors on the same line. + +Make sure keypress events for backspace are ignored. + +Tokens styled with overlays no longer get a nonsense `cm-cm-overlay` class. + +Line endings for pasted content are now normalized to the editor's [preferred ending](https://codemirror.net/doc/manual.html#option_lineSeparator). + +[javascript mode](https://codemirror.net/mode/javascript): Improve support for class expressions. Support TypeScript optional class properties, the `abstract` keyword, and return type declarations for arrow functions. + +[css mode](https://codemirror.net/mode/css): Fix highlighting of mixed-case keywords. + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when typing a quote before a string. + +### New features + +The core is now maintained as a number of small files, using ES6 syntax and modules, under the `src/` directory. A git checkout no longer contains a working `codemirror.js` until you `npm run build` (but when installing from NPM, it is included). + +The [`refresh`](https://codemirror.net/doc/manual.html#event_refresh) event is now documented and stable. + +## 5.19.0 (2016-09-20) + +### Bugfixes + +[erlang mode](https://codemirror.net/mode/erlang): Fix mode crash when trying to read an empty context. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix broken behavior when toggling comments inside a comment. + +xml-fold addon: Fix a null-dereference bug. + +Page up and page down now do something even in single-line documents. + +Fix an issue where the cursor position could be off in really long (~8000 character) tokens. + +### New features + +[javascript mode](https://codemirror.net/mode/javascript): Better indentation when semicolons are missing. Better support for TypeScript classes, optional parameters, and the `type` keyword. + +The [`blur`](https://codemirror.net/doc/manual.html#event_blur) and [`focus`](https://codemirror.net/doc/manual.html#event_focus) events now pass the DOM event to their handlers. + +## 5.18.2 (2016-08-23) + +### Bugfixes + +[vue mode](https://codemirror.net/mode/vue): Fix outdated references to renamed Pug mode dependency. + +## 5.18.0 (2016-08-22) + +### Bugfixes + +Make sure [gutter backgrounds](https://codemirror.net/doc/manual.html#addLineClass) stick to the rest of the gutter during horizontal scrolling. + +The contenteditable [`inputStyle`](https://codemirror.net/doc/manual.html#option_inputStyle) now properly supports pasting on pre-Edge IE versions. + +[javascript mode](https://codemirror.net/mode/javascript): Fix some small parsing bugs and improve TypeScript support. + +[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix bug where active highlighting was left in editor when the addon was disabled. + +[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Only start highlighting things when the editor gains focus. + +[javascript-hint addon](https://codemirror.net/doc/manual.html#addon_javascript-hint): Also complete non-enumerable properties. + +### New features + +The [`addOverlay`](https://codemirror.net/doc/manual.html#addOverlay) method now supports a `priority` option to control the order in which overlays are applied. + +MIME types that end in `+json` now default to the JSON mode when the MIME itself is not defined. + +### Breaking changes + +The mode formerly known as Jade was renamed to [Pug](https://codemirror.net/mode/pug). + +The [Python mode](https://codemirror.net/mode/python) now defaults to Python 3 (rather than 2) syntax. + +## 5.17.0 (2016-07-19) + +### Bugfixes + +Fix problem with wrapped trailing whitespace displaying incorrectly. + +Prevent IME dialog from overlapping typed content in Chrome. + +Improve measuring of characters near a line wrap. + +[javascript mode](https://codemirror.net/mode/javascript): Improve support for `async`, allow trailing commas in `import` lists. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix backspace in replace mode. + +[sublime bindings](https://codemirror.net/demo/sublime.html): Fix some key bindings on OS X to match Sublime Text. + +### New features + +[markdown mode](https://codemirror.net/mode/markdown): Add more classes to image links in highlight-formatting mode. + +## 5.16.0 (2016-06-20) + +### Bugfixes + +Fix glitches when dragging content caused by the drop indicator receiving mouse events. + +Make Control-drag work on Firefox. + +Make clicking or selection-dragging at the end of a wrapped line select the right position. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Prevent widget scrollbar from hiding part of the hint text. + +[rulers addon](https://codemirror.net/doc/manual.html#addon_rulers): Prevent rulers from forcing a horizontal editor scrollbar. + +### New features + +[search addon](https://codemirror.net/doc/manual.html#addon_search): Automatically bind search-related keys in persistent dialog. + +[sublime keymap](https://codemirror.net/demo/sublime.html): Add a multi-cursor aware smart backspace binding. + +## 5.15.2 (2016-05-20) + +### Bugfixes + +Fix a critical document corruption bug that occurs when a document is gradually grown. + +## 5.15.0 (2016-05-20) + +### Bugfixes + +Fix bug that caused the selection to reset when focusing the editor in contentEditable input mode. + +Fix issue where not all ASCII control characters were being replaced by placeholders. + +Remove the assumption that all modes have a `startState` method from several wrapping modes. + +Fix issue where the editor would complain about overlapping collapsed ranges when there weren't any. + +Optimize document tree building when loading or pasting huge chunks of content. + +[markdown mode](https://codemirror.net/mode/markdown/): Fix several issues in matching link targets. + +[clike mode](https://codemirror.net/mode/clike/): Improve indentation of C++ template declarations. + +### New features + +Explicitly bind Ctrl-O on OS X to make that binding (“open line”) act as expected. + +Pasting [linewise-copied](https://codemirror.net/doc/manual.html#option_lineWiseCopyCut) content when there is no selection now inserts the lines above the current line. + +[javascript mode](https://codemirror.net/mode/javascript/): Support `async`/`await` and improve support for TypeScript type syntax. + +## 5.14.2 (2016-04-20) + +### Bugfixes + +Push a new package to NPM due to an [NPM bug](https://github.com/npm/npm/issues/5082) omitting the LICENSE file in 5.14.0. + +Set `dataTransfer.effectAllowed` in `dragstart` handler to help browsers use the right drag icon. + +Add the [mbox mode](https://codemirror.net/mode/mbox/index.html) to `mode/meta.js`. + +## 5.14.0 (2016-04-20) + +### Bugfixes + +[`posFromIndex`](https://codemirror.net/doc/manual.html#posFromIndex) and [`indexFromPos`](https://codemirror.net/doc/manual.html#indexFromPos) now take [`lineSeparator`](https://codemirror.net/doc/manual.html#option_lineSeparator) into account. + +[vim bindings](https://codemirror.net/demo/vim.html): Only call `.save()` when it is actually available. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Be careful not to mangle multi-line strings. + +[Python mode](https://codemirror.net/mode/python/index.html): Improve distinguishing of decorators from `@` operators. + +[`findMarks`](https://codemirror.net/doc/manual.html#findMarks): No longer return marks that touch but don't overlap given range. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Add yank command. + +[match-highlighter addon](https://codemirror.net/doc/manual.html#addon_match-highlighter): Add `trim` option to disable ignoring of whitespace. + +[PowerShell mode](https://codemirror.net/mode/powershell/index.html): Added. + +[Yacas mode](https://codemirror.net/mode/yacas/index.html): Added. + +[Web IDL mode](https://codemirror.net/mode/webidl/index.html): Added. + +[SAS mode](https://codemirror.net/mode/sas/index.html): Added. + +[mbox mode](https://codemirror.net/mode/mbox/index.html): Added. + +## 5.13.2 (2016-03-23) + +### Bugfixes + +Solves a problem where the gutter would sometimes not extend all the way to the end of the document. + +## 5.13.0 (2016-03-21) + +### New features + +New DOM event forwarded: [`"dragleave"`](https://codemirror.net/doc/manual.html#event_dom). + +[protobuf mode](https://codemirror.net/mode/protobuf/index.html): Newly added. + +### Bugfixes + +Fix problem where [`findMarks`](https://codemirror.net/doc/manual.html#findMarks) sometimes failed to find multi-line marks. + +Fix crash that showed up when atomic ranges and bidi text were combined. + +[show-hint addon](https://codemirror.net/demo/complete.html): Completion widgets no longer close when the line indented or dedented. + +[merge addon](https://codemirror.net/demo/merge.html): Fix bug when merging chunks at the end of the file. + +[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): No longer gets confused by [`swapDoc`](https://codemirror.net/doc/manual.html#swapDoc). + +[simplescrollbars addon](https://codemirror.net/doc/manual.html#addon_simplescrollbars): Fix invalid state when deleting at end of document. + +[clike mode](https://codemirror.net/mode/clike/index.html): No longer gets confused when a comment starts after an operator. + +[markdown mode](https://codemirror.net/mode/markdown/index.html): Now supports CommonMark-style flexible list indentation. + +[dylan mode](https://codemirror.net/mode/dylan/index.html): Several improvements and fixes. + +## 5.12.0 (2016-02-19) + +### New features + +[Vim bindings](https://codemirror.net/demo/vim.html): Ctrl-Q is now an alias for Ctrl-V. + +[Vim bindings](https://codemirror.net/demo/vim.html): The Vim API now exposes an `unmap` method to unmap bindings. + +[active-line addon](https://codemirror.net/demo/activeline.html): This addon can now style the active line's gutter. + +[FCL mode](https://codemirror.net/mode/fcl/): Newly added. + +[SQL mode](https://codemirror.net/mode/sql/): Now has a Postgresql dialect. + +### Bugfixes + +Fix [issue](https://github.com/codemirror/CodeMirror/issues/3781) where trying to scroll to a horizontal position outside of the document's width could cause the gutter to be positioned incorrectly. + +Use absolute, rather than fixed positioning in the context-menu intercept hack, to work around a [problem](https://github.com/codemirror/CodeMirror/issues/3238) when the editor is inside a transformed parent container. + +Solve a [problem](https://github.com/codemirror/CodeMirror/issues/3821) where the horizontal scrollbar could hide text in Firefox. + +Fix a [bug](https://github.com/codemirror/CodeMirror/issues/3834) that caused phantom scroll space under the text in some situations. + +[Sublime Text bindings](https://codemirror.net/demo/sublime.html): Bind delete-line to Shift-Ctrl-K on OS X. + +[Markdown mode](https://codemirror.net/mode/markdown/): Fix [issue](https://github.com/codemirror/CodeMirror/issues/3787) where the mode would keep state related to fenced code blocks in an unsafe way, leading to occasional corrupted parses. + +[Markdown mode](https://codemirror.net/mode/markdown/): Ignore backslashes in code fragments. + +[Markdown mode](https://codemirror.net/mode/markdown/): Use whichever mode is registered as `text/html` to parse HTML. + +[Clike mode](https://codemirror.net/mode/clike/): Improve indentation of Scala `=>` functions. + +[Python mode](https://codemirror.net/mode/python/): Improve indentation of bracketed code. + +[HTMLMixed mode](https://codemirror.net/mode/htmlmixed/): Support multi-line opening tags for sub-languages (` -