Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D tiles - always use version query parameter from tileset.json #6933

Merged
merged 7 commits into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Change Log
* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883)
* Fixed night shading in 2D and Columbus view. [#4122](https://github.com/AnalyticalGraphicsInc/cesium/issues/4122)
* Fixed a crash when setting show to `false` on a polyline clamped to the ground. [#6912](https://github.com/AnalyticalGraphicsInc/cesium/issues/6912)
* Fixed a bug where `Cesium3DTileset` wasn't using the correct tilesetVersion [#6933](https://github.com/AnalyticalGraphicsInc/cesium/pull/6933)
* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider [#6918](https://github.com/AnalyticalGraphicsInc/cesium/pull/6918)
* Fixed an issue that caused the browser to hang when using `drillPick` on a polyline clamped to the ground. [6907](https://github.com/AnalyticalGraphicsInc/cesium/issues/6907)
* Fixed an issue where color wasn't updated propertly for polylines clamped to ground [#6927](https://github.com/AnalyticalGraphicsInc/cesium/pull/6927)
Expand Down
14 changes: 7 additions & 7 deletions Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,13 +1253,13 @@ define([

var statistics = this._statistics;

// Append the tileset version to the resource
if (!defined(resource.queryParameters.v)) {
var versionQuery = {
v : defaultValue(asset.tilesetVersion, '0.0')
};
this._basePath += '?v=' + versionQuery.v;
resource.setQueryParameters(versionQuery);
var tilesetVersion = asset.tilesetVersion;
if (defined(tilesetVersion)) {
// Append the tileset version to the resource
this._basePath += '?v=' + tilesetVersion;
resource.setQueryParameters({ v: tilesetVersion });
} else {
delete resource.queryParameters.v;
}

// A tileset JSON file referenced from a tile may exist in a different directory than the root tileset.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"asset": {
"version": "1.0"
"version": "1.0",
"tilesetVersion": "1.2.3"
},
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"asset": {
"version": "1.0"
"version": "1.0",
"tilesetVersion": "1.2.3"
},
"geometricError": 70,
"root": {
Expand Down
5 changes: 2 additions & 3 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,9 +1289,8 @@ defineSuite([

return tileset._root.contentReadyPromise;
}).then(function() {
//Make sure tileset2.json was requested with query parameters and version
var queryParamsWithVersion = 'v=0.0&' + queryParams;
expectedUrl = getAbsoluteUri('Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tileset2.json?' + queryParamsWithVersion);
//Make sure tileset2.json was requested with query parameters and does not use parent tilesetVersion
expectedUrl = getAbsoluteUri('Data/Cesium3DTiles/Tilesets/TilesetOfTilesets/tileset2.json?v=1.2.3&' + queryParams);
expect(Resource._Implementations.loadWithXhr.calls.argsFor(0)[0]).toEqual(expectedUrl);
});
});
Expand Down