Skip to content

Commit

Permalink
Merge branch 'master' into web-mercator-terrain-tiling-scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
jtfell authored Feb 4, 2020
2 parents d1bea6d + bc8b44e commit 7279ca8
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 32 deletions.
Binary file modified Apps/SampleData/models/CesiumAir/Cesium_Air.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/CesiumBalloon/CesiumBalloon.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/CesiumMan/Cesium_Man.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Tester.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Tester_2.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Tester_3.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Tester_4.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Tester_Point.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/ShadowTester/Shadow_Transparent.glb
Binary file not shown.
Binary file modified Apps/SampleData/models/WoodTower/Wood_Tower.glb
Binary file not shown.
18 changes: 11 additions & 7 deletions Apps/Sandcastle/gallery/Web Map Tile Service with Time.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,22 @@
dataCallback: dataCallback
});

// Add a WMTS imagery layer
// Add a WMTS imagery layer.
// This comes from NASA's GIBS API.
// See https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers#GIBSAPIforDevelopers-OGCWebMapService(WMS)
var provider = new Cesium.WebMapTileServiceImageryProvider({
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
layer : 'AMSR2_Snow_Water_Equivalent',
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
layer : 'MODIS_Terra_CorrectedReflectance_TrueColor',
style : 'default',
tileMatrixSetID : '2km',
tileMatrixSetID : '250m',
maximumLevel : 5,
format : 'image/png',
format : 'image/jpeg',
clock: viewer.clock,
times: times,
credit : 'NASA Global Imagery Browse Services for EOSDIS'
});
var imageryLayers = viewer.imageryLayers;
imageryLayers.addImageryProvider(provider);
var layer = imageryLayers.addImageryProvider(provider);
provider.readyPromise
.then(function() {
var start = Cesium.JulianDate.fromIso8601('2015-07-30');
Expand All @@ -73,7 +75,9 @@
clock.stopTime = stop;
clock.currentTime = start;
clock.clockRange = Cesium.ClockRange.LOOP_STOP;
clock.multiplier = 86400;
clock.multiplier = 7200;
// Make the weather layer semi-transparent to see the underlying geography.
layer.alpha = 0.5;
});
//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down
Binary file modified Apps/Sandcastle/gallery/Web Map Tile Service with Time.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 13 additions & 11 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Change Log

##### Additions :tada:

* `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.
* `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)
* 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:

```js
Expand All @@ -21,33 +21,35 @@ Change Log
});
```

* Add more customization to Cesium's lighting system [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493)
* Added more customization to Cesium's lighting system. [#8493](https://github.com/AnalyticalGraphicsInc/cesium/pull/8493)
* Added `Light`, `DirectionalLight`, and `SunLight` classes for creating custom light sources.
* Added `Scene.light` for setting the scene's light source, which defaults to a `SunLight`.
* 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.
* 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).
* Primitives and the globe are now shaded with the scene light's color.
* Updated SampleData models to glTF 2.0. [#7802](https://github.com/AnalyticalGraphicsInc/cesium/issues/7802)
* 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)
* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/AnalyticalGraphicsInc/cesium/pull/8482)
* Added `minificationFilter` and `magnificationFilter` options to `Material` to control texture filtering. [#8473](https://github.com/AnalyticalGraphicsInc/cesium/pull/8473)
* `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)
* Update [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/AnalyticalGraphicsInc/cesium/pull/8528)
* Updated [earcut](https://github.com/mapbox/earcut) to 2.2.1. [#8528](https://github.com/AnalyticalGraphicsInc/cesium/pull/8528)
* Added a font cache to improve label performance. [#8537](https://github.com/AnalyticalGraphicsInc/cesium/pull/8537)

##### Fixes :wrench:
* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/AnalyticalGraphicsInc/cesium/issues/8162)
* Fixed a bug where the camera could go underground during mouse navigation. [#8504](https://github.com/AnalyticalGraphicsInc/cesium/pull/8504)
* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/AnalyticalGraphicsInc/cesium/pull/8533)
* 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)
* Fixed issue where `RequestScheduler` double-counted image requests made via `createImageBitmap`. [#8162](https://github.com/AnalyticalGraphicsInc/cesium/issues/8162)
* Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js`. [#8532](https://github.com/AnalyticalGraphicsInc/cesium/pull/8532)
* Fixed a bug where files with backslashes were not loaded in KMZ files. [#8533](https://github.com/AnalyticalGraphicsInc/cesium/pull/8533)
* Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https://github.com/AnalyticalGraphicsInc/cesium/pull/8534)
* Updated SampleData models to glTF 2.0. [#7802](https://github.com/AnalyticalGraphicsInc/cesium/issues/7802)
* 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)
* 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)
* 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)
* 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)
* Fixed terrain tile picking in the Cesium Inspector. [#8567](https://github.com/AnalyticalGraphicsInc/cesium/pull/8567)
* 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)
* 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)
* 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)
* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438)
* 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)
* Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter. [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438)
* Fixed a crash when creating a plane with both position and normal on the Z-axis. [#8576](https://github.com/AnalyticalGraphicsInc/cesium/pull/8576)
* Fixed `BoundingSphere.projectTo2D` when the bounding sphere’s center is at the origin. [#8482](https://github.com/AnalyticalGraphicsInc/cesium/pull/8482)

### 1.65.0 - 2020-01-06

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Ion.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import defined from './defined.js';
import Resource from './Resource.js';

var defaultTokenCredit;
var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMDM4MmZhMy1lOGE2LTQ4ZjItOTQ3MS0yNDUyMjQ2ODBkNGQiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTc4MzIzODI5fQ.mM0bfMw_Z6h1znX99Z6TpUQtrVFB4S-MiQeq3zr2we4';
var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYmFmMDZjZi03ZTIzLTRmNDYtYmM4MS1hZmUyOTNlZWQ4N2MiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgwNzQ2MDQzfQ.I05JcRTUCUA1RWX2y0oQa_p4dFV6tgaAKHrCU5AjlgI';

/**
* Default settings for accessing the Cesium ion API.
Expand Down
3 changes: 3 additions & 0 deletions Source/DataSources/PlaneGeometryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ import Property from './Property.js';
var up = ellipsoid.geodeticSurfaceNormal(translation, scratchAxis2);
if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) {
up = Cartesian3.clone(Cartesian3.UNIT_Z, up);
if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) {
up = Cartesian3.clone(Cartesian3.UNIT_X, up);
}
}

var left = Cartesian3.cross(up, transformedNormal, scratchAxis);
Expand Down
41 changes: 29 additions & 12 deletions Source/Scene/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import LabelStyle from './LabelStyle.js';
import SDFSettings from './SDFSettings.js';
import VerticalOrigin from './VerticalOrigin.js';

var fontInfoCache = {};
var fontInfoCacheLength = 0;
var fontInfoCacheMaxSize = 256;

var textTypes = freezeObject({
LTR : 0,
RTL : 1,
Expand Down Expand Up @@ -44,18 +48,31 @@ import VerticalOrigin from './VerticalOrigin.js';
}

function parseFont(label) {
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.opacity = 0;
div.style.font = label._font;
document.body.appendChild(div);

label._fontFamily = getCSSValue(div,'font-family');
label._fontSize = getCSSValue(div,'font-size').replace('px', '');
label._fontStyle = getCSSValue(div,'font-style');
label._fontWeight = getCSSValue(div,'font-weight');

document.body.removeChild(div);
var fontInfo = fontInfoCache[label._font];
if (!defined(fontInfo)) {
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.opacity = 0;
div.style.font = label._font;
document.body.appendChild(div);

fontInfo = {
family : getCSSValue(div, 'font-family'),
size : getCSSValue(div, 'font-size').replace('px', ''),
style : getCSSValue(div, 'font-style'),
weight : getCSSValue(div, 'font-weight')
};

document.body.removeChild(div);
if (fontInfoCacheLength < fontInfoCacheMaxSize) {
fontInfoCache[label._font] = fontInfo;
fontInfoCacheLength++;
}
}
label._fontFamily = fontInfo.family;
label._fontSize = fontInfo.size;
label._fontStyle = fontInfo.style;
label._fontWeight = fontInfo.weight;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cesium",
"version": "1.65.0",
"version": "1.66.0",
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",
"homepage": "http://cesium.com/cesiumjs/",
"license": "Apache-2.0",
Expand Down

0 comments on commit 7279ca8

Please sign in to comment.