Skip to content

Commit 7279ca8

Browse files
authored
Merge branch 'master' into web-mercator-terrain-tiling-scheme
2 parents d1bea6d + bc8b44e commit 7279ca8

18 files changed

+58
-32
lines changed
-310 KB
Binary file not shown.
Binary file not shown.
-80 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-4.46 MB
Binary file not shown.

Apps/Sandcastle/gallery/Web Map Tile Service with Time.html

+11-7
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,22 @@
4747
dataCallback: dataCallback
4848
});
4949

50-
// Add a WMTS imagery layer
50+
// Add a WMTS imagery layer.
51+
// This comes from NASA's GIBS API.
52+
// See https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers#GIBSAPIforDevelopers-OGCWebMapService(WMS)
5153
var provider = new Cesium.WebMapTileServiceImageryProvider({
52-
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
53-
layer : 'AMSR2_Snow_Water_Equivalent',
54+
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
55+
layer : 'MODIS_Terra_CorrectedReflectance_TrueColor',
5456
style : 'default',
55-
tileMatrixSetID : '2km',
57+
tileMatrixSetID : '250m',
5658
maximumLevel : 5,
57-
format : 'image/png',
59+
format : 'image/jpeg',
5860
clock: viewer.clock,
5961
times: times,
6062
credit : 'NASA Global Imagery Browse Services for EOSDIS'
6163
});
6264
var imageryLayers = viewer.imageryLayers;
63-
imageryLayers.addImageryProvider(provider);
65+
var layer = imageryLayers.addImageryProvider(provider);
6466
provider.readyPromise
6567
.then(function() {
6668
var start = Cesium.JulianDate.fromIso8601('2015-07-30');
@@ -73,7 +75,9 @@
7375
clock.stopTime = stop;
7476
clock.currentTime = start;
7577
clock.clockRange = Cesium.ClockRange.LOOP_STOP;
76-
clock.multiplier = 86400;
78+
clock.multiplier = 7200;
79+
// Make the weather layer semi-transparent to see the underlying geography.
80+
layer.alpha = 0.5;
7781
});
7882
//Sandcastle_End
7983
Sandcastle.finishedLoading();
Loading

CHANGES.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Change Log
88

99
##### Additions :tada:
1010

11-
* `useBrowserRecommendedResolution` flag in `Viewer` and `CesiumWidget` now defaults to `true`. This ensures Cesium rendering is fast and smooth by default across all devices. Set it to `false` to always render at native device resolution instead at the cost of performance on under-powered devices.
11+
* `useBrowserRecommendedResolution` flag in `Viewer` and `CesiumWidget` now defaults to `true`. This ensures Cesium rendering is fast and smooth by default across all devices. Set it to `false` to always render at native device resolution instead at the cost of performance on under-powered devices. [#8548](https://github.com/AnalyticalGraphicsInc/cesium/pull/8548)
1212
* Cesium now creates a WebGL context with a `powerPreference` value of `high-performance`. Some browsers use this setting to enable a second, more powerful, GPU. You can set it back to `default`, or opt-in to `low-power` mode, by passing the context option when creating a `Viewer` or `CesiumWidget` instance:
1313

1414
```js
@@ -21,33 +21,35 @@ Change Log
2121
});
2222
```
2323

24-
* Add more customization to Cesium's lighting system [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493)
24+
* Added more customization to Cesium's lighting system. [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493)
2525
* Added `Light`, `DirectionalLight`, and `SunLight` classes for creating custom light sources.
2626
* Added `Scene.light` for setting the scene's light source, which defaults to a `SunLight`.
2727
* Added `Globe.dynamicAtmosphereLighting` for enabling lighting effects on atmosphere and fog, such as day/night transitions. It is true by default but may be set to false if the atmosphere should stay unchanged regardless of the scene's light direction.
2828
* Added `Globe.dynamicAtmosphereLightingFromSun` for using the sun direction instead of the scene's light direction when `Globe.dynamicAtmosphereLighting` is enabled. See the moonlight example in the [Lighting Sandcastle example](https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Lighting.html).
2929
* Primitives and the globe are now shaded with the scene light's color.
30+
* Updated SampleData models to glTF 2.0. [#7802](https://github.com/AnalyticalGraphicsInc/cesium/issues/7802)
3031
* Added `Globe.showSkirts` to support the ability to hide terrain skirts when viewing terrain from below the surface. [#8489](https://github.com/AnalyticalGraphicsInc/cesium/pull/8489)
31-
* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/AnalyticalGraphicsInc/cesium/pull/8482)
3232
* Added `minificationFilter` and `magnificationFilter` options to `Material` to control texture filtering. [#8473](https://github.com/AnalyticalGraphicsInc/cesium/pull/8473)
3333
* `CesiumTerrainProvider` now supports terrain tiles using a `WebMercatorTilingScheme` by specifying `"projection": "EPSG:3857"` in `layer.json`. It also now supports numbering tiles from the North instead of the South by specifying `"scheme": "slippyMap"` in `layer.json`. [#8563](https://github.com/AnalyticalGraphicsInc/cesium/pull/8563)
34-
* Update [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/AnalyticalGraphicsInc/cesium/pull/8528)
34+
* Updated [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/AnalyticalGraphicsInc/cesium/pull/8528)
35+
* Added a font cache to improve label performance. [#8537](https://github.com/AnalyticalGraphicsInc/cesium/pull/8537)
3536

3637
##### Fixes :wrench:
37-
* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/AnalyticalGraphicsInc/cesium/issues/8162)
3838
* Fixed a bug where the camera could go underground during mouse navigation. [#8504](https://github.com/AnalyticalGraphicsInc/cesium/pull/8504)
39-
* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/AnalyticalGraphicsInc/cesium/pull/8533)
39+
* Fixed a bug where rapidly updating a `PolylineCollection` could result in an `instanceIndex` is out of range error. [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546)
40+
* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/AnalyticalGraphicsInc/cesium/issues/8162)
4041
* Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js`. [#8532](https://github.com/AnalyticalGraphicsInc/cesium/pull/8532)
42+
* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/AnalyticalGraphicsInc/cesium/pull/8533)
4143
* Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https://github.com/AnalyticalGraphicsInc/cesium/pull/8534)
42-
* Updated SampleData models to glTF 2.0. [#7802](https://github.com/AnalyticalGraphicsInc/cesium/issues/7802)
4344
* Fixed a bug where toggling point cloud classification visibility would result in a grey screen on Linux / Nvidia. [#8538](https://github.com/AnalyticalGraphicsInc/cesium/pull/8538)
44-
* Fixed a bug where a point in a `PointPrimitiveCollection` is rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542)
45+
* Fixed a bug where a point in a `PointPrimitiveCollection` was rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542)
4546
* Fixed a crash when deleting and re-creating polylines from CZML. `ReferenceProperty` now returns undefined when the target entity or property does not exist, instead of throwing. [#8544](https://github.com/AnalyticalGraphicsInc/cesium/pull/8544)
4647
* Fixed terrain tile picking in the Cesium Inspector. [#8567](https://github.com/AnalyticalGraphicsInc/cesium/pull/8567)
47-
* Fixed a bug where rapidly updating a `PolylineCollection` could result in an instanceIndex is out of range error. [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546)
4848
* Fixed a crash that could occur when an entity was deleted while the corresponding `Primitive` was being created asynchronously. [#8569](https://github.com/AnalyticalGraphicsInc/cesium/pull/8569)
49-
* Fixed a crash when calling `camera.lookAt` with the origin as the target. This could happen when looking at a tileset with the origin as its center. [#8571](https://github.com/AnalyticalGraphicsInc/cesium/pull/8571)
50-
* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438)
49+
* Fixed a crash when calling `camera.lookAt` with the origin (0, 0, 0) as the target. This could happen when looking at a tileset with the origin as its center. [#8571](https://github.com/AnalyticalGraphicsInc/cesium/pull/8571)
50+
* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter. [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438)
51+
* Fixed a crash when creating a plane with both position and normal on the Z-axis. [#8576](https://github.com/AnalyticalGraphicsInc/cesium/pull/8576)
52+
* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/AnalyticalGraphicsInc/cesium/pull/8482)
5153

5254
### 1.65.0 - 2020-01-06
5355

Source/Core/Ion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import defined from './defined.js';
33
import Resource from './Resource.js';
44

55
var defaultTokenCredit;
6-
var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMDM4MmZhMy1lOGE2LTQ4ZjItOTQ3MS0yNDUyMjQ2ODBkNGQiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTc4MzIzODI5fQ.mM0bfMw_Z6h1znX99Z6TpUQtrVFB4S-MiQeq3zr2we4';
6+
var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYmFmMDZjZi03ZTIzLTRmNDYtYmM4MS1hZmUyOTNlZWQ4N2MiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgwNzQ2MDQzfQ.I05JcRTUCUA1RWX2y0oQa_p4dFV6tgaAKHrCU5AjlgI';
77

88
/**
99
* Default settings for accessing the Cesium ion API.

Source/DataSources/PlaneGeometryUpdater.js

+3
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ import Property from './Property.js';
240240
var up = ellipsoid.geodeticSurfaceNormal(translation, scratchAxis2);
241241
if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) {
242242
up = Cartesian3.clone(Cartesian3.UNIT_Z, up);
243+
if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) {
244+
up = Cartesian3.clone(Cartesian3.UNIT_X, up);
245+
}
243246
}
244247

245248
var left = Cartesian3.cross(up, transformedNormal, scratchAxis);

Source/Scene/Label.js

+29-12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import LabelStyle from './LabelStyle.js';
1616
import SDFSettings from './SDFSettings.js';
1717
import VerticalOrigin from './VerticalOrigin.js';
1818

19+
var fontInfoCache = {};
20+
var fontInfoCacheLength = 0;
21+
var fontInfoCacheMaxSize = 256;
22+
1923
var textTypes = freezeObject({
2024
LTR : 0,
2125
RTL : 1,
@@ -44,18 +48,31 @@ import VerticalOrigin from './VerticalOrigin.js';
4448
}
4549

4650
function parseFont(label) {
47-
var div = document.createElement('div');
48-
div.style.position = 'absolute';
49-
div.style.opacity = 0;
50-
div.style.font = label._font;
51-
document.body.appendChild(div);
52-
53-
label._fontFamily = getCSSValue(div,'font-family');
54-
label._fontSize = getCSSValue(div,'font-size').replace('px', '');
55-
label._fontStyle = getCSSValue(div,'font-style');
56-
label._fontWeight = getCSSValue(div,'font-weight');
57-
58-
document.body.removeChild(div);
51+
var fontInfo = fontInfoCache[label._font];
52+
if (!defined(fontInfo)) {
53+
var div = document.createElement('div');
54+
div.style.position = 'absolute';
55+
div.style.opacity = 0;
56+
div.style.font = label._font;
57+
document.body.appendChild(div);
58+
59+
fontInfo = {
60+
family : getCSSValue(div, 'font-family'),
61+
size : getCSSValue(div, 'font-size').replace('px', ''),
62+
style : getCSSValue(div, 'font-style'),
63+
weight : getCSSValue(div, 'font-weight')
64+
};
65+
66+
document.body.removeChild(div);
67+
if (fontInfoCacheLength < fontInfoCacheMaxSize) {
68+
fontInfoCache[label._font] = fontInfo;
69+
fontInfoCacheLength++;
70+
}
71+
}
72+
label._fontFamily = fontInfo.family;
73+
label._fontSize = fontInfo.size;
74+
label._fontStyle = fontInfo.style;
75+
label._fontWeight = fontInfo.weight;
5976
}
6077

6178
/**

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cesium",
3-
"version": "1.65.0",
3+
"version": "1.66.0",
44
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",
55
"homepage": "http://cesium.com/cesiumjs/",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)