From 51a4edb6b4cfbddd3fc5e8a648b7a85a568cba31 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Wed, 2 Jan 2019 18:01:39 -0500 Subject: [PATCH 1/3] extras.cesium.credits --- Source/Scene/Cesium3DTileset.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 0ad7115a8ab6..82707efeb171 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -4,6 +4,7 @@ define([ '../Core/Cartesian3', '../Core/Cartographic', '../Core/Check', + '../Core/Credit', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', @@ -49,6 +50,7 @@ define([ Cartesian3, Cartographic, Check, + Credit, defaultValue, defined, defineProperties, @@ -192,6 +194,7 @@ define([ this._timeSinceLoad = 0.0; this._updatedVisibilityFrame = 0; this._extras = undefined; + this._credits = undefined; this._cullWithChildrenBounds = defaultValue(options.cullWithChildrenBounds, true); this._allTilesAdditive = true; @@ -755,7 +758,6 @@ define([ * @default false */ this.debugShowUrl = defaultValue(options.debugShowUrl, false); - this._credits = undefined; var that = this; var resource; @@ -786,7 +788,23 @@ define([ that._geometricError = tilesetJson.geometricError; that._extensionsUsed = tilesetJson.extensionsUsed; that._gltfUpAxis = gltfUpAxis; - that._extras = tilesetJson.extras; + + var extras = tilesetJson.extras; + + if (defined(extras) && defined(extras.cesium) && defined(extras.cesium.credits)) { + var extraCredits = extras.cesium.credits; + var credits = that._credits; + if (!defined(credits)) { + credits = []; + that._credits = credits; + } + for (var i = 0; i < extraCredits.length; i++) { + credits.push(new Credit(extraCredits[i])); + } + } + + that._extras = extras; + // Save the original, untransformed bounding volume position so we can apply // the tile transform and model matrix at run time var boundingVolume = that._root.createBoundingVolume(tilesetJson.root.boundingVolume, Matrix4.IDENTITY); From 0f8b7e2c3c503c2e8e520c19c98d6b1c9560cc4e Mon Sep 17 00:00:00 2001 From: hpinkos Date: Wed, 2 Jan 2019 18:04:40 -0500 Subject: [PATCH 2/3] html and showOnScreen --- Source/Scene/Cesium3DTileset.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 82707efeb171..efd396d7e5a5 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -799,7 +799,8 @@ define([ that._credits = credits; } for (var i = 0; i < extraCredits.length; i++) { - credits.push(new Credit(extraCredits[i])); + var credit = extraCredits[i]; + credits.push(new Credit(credit.html, credit.showOnScreen)); } } From d80e7ef661ba7a2e6de033c00e6309b77144de1a Mon Sep 17 00:00:00 2001 From: hpinkos Date: Thu, 3 Jan 2019 09:26:34 -0500 Subject: [PATCH 3/3] asset extras --- Source/Scene/Cesium3DTileset.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index efd396d7e5a5..5aa42148c949 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -783,14 +783,15 @@ define([ .then(function(tilesetJson) { that._root = that.loadTileset(resource, tilesetJson); var gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis) ? Axis.fromName(tilesetJson.asset.gltfUpAxis) : Axis.Y; - that._asset = tilesetJson.asset; + var asset = tilesetJson.asset; + that._asset = asset; that._properties = tilesetJson.properties; that._geometricError = tilesetJson.geometricError; that._extensionsUsed = tilesetJson.extensionsUsed; that._gltfUpAxis = gltfUpAxis; + that._extras = tilesetJson.extras; - var extras = tilesetJson.extras; - + var extras = asset.extras; if (defined(extras) && defined(extras.cesium) && defined(extras.cesium.credits)) { var extraCredits = extras.cesium.credits; var credits = that._credits; @@ -804,8 +805,6 @@ define([ } } - that._extras = extras; - // Save the original, untransformed bounding volume position so we can apply // the tile transform and model matrix at run time var boundingVolume = that._root.createBoundingVolume(tilesetJson.root.boundingVolume, Matrix4.IDENTITY);