You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGES.md
+3
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,9 @@ Change Log
3
3
4
4
### 1.43 - 2018-03-01
5
5
6
+
##### Additions :tada:
7
+
* Added support for a promise to a resource for `CesiumTerrainProvider`, `createTileMapServiceImageryProvider` and `Cesium3DTileset`[#6204](https://github.com/AnalyticalGraphicsInc/cesium/pull/6204)
8
+
6
9
##### Fixes :wrench:
7
10
* Fixed bug where AxisAlignedBoundingBox did not copy over center value when cloning an undefined result. [#6183](https://github.com/AnalyticalGraphicsInc/cesium/pull/6183)
8
11
* Fixed `Resource.fetch` when called with no arguments [#6206](https://github.com/AnalyticalGraphicsInc/cesium/issues/6206)
Copy file name to clipboardexpand all lines: Source/Core/CesiumTerrainProvider.js
+24-16
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ define([
68
68
* @constructor
69
69
*
70
70
* @param {Object} options Object with the following properties:
71
-
* @param {Resource|String} options.url The URL of the Cesium terrain server.
71
+
* @param {Resource|String|Promise<Resource>|Promise<String>} options.url The URL of the Cesium terrain server.
72
72
* @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available.
73
73
* @param {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server, if available.
74
74
* @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
@@ -112,11 +112,6 @@ define([
112
112
deprecationWarning('CesiumTerrainProvider.proxy','The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.');
Copy file name to clipboardexpand all lines: Source/Scene/Cesium3DTileset.js
+30-23
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ define([
94
94
* @constructor
95
95
*
96
96
* @param {Object} options Object with the following properties:
97
-
* @param {Resource|String} options.url The url to a tileset.json file or to a directory containing a tileset.json file.
97
+
* @param {Resource|String|Promise<Resource>|Promise<String>} options.url The url to a tileset.json file or to a directory containing a tileset.json file.
98
98
* @param {Boolean} [options.show=true] Determines if the tileset will be shown.
99
99
* @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the tileset's root tile.
100
100
* @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the tileset casts or receives shadows from each light source.
@@ -165,26 +165,9 @@ define([
165
165
Check.defined('options.url',options.url);
166
166
//>>includeEnd('debug');
167
167
168
-
varresource=Resource.createIfNeeded(options.url);
169
-
170
-
vartilesetResource=resource;
171
-
varbasePath;
172
-
173
-
if(resource.extension==='json'){
174
-
basePath=resource.getBaseUri(true);
175
-
}elseif(resource.isDataUri){
176
-
basePath='';
177
-
}else{
178
-
resource.appendForwardSlash();
179
-
tilesetResource=resource.getDerivedResource({
180
-
url: 'tileset.json'
181
-
});
182
-
basePath=resource.url;
183
-
}
184
-
185
-
this._url=resource.url;
186
-
this._tilesetUrl=tilesetResource.url;
187
-
this._basePath=basePath;
168
+
this._url=undefined;
169
+
this._tilesetUrl=undefined;
170
+
this._basePath=undefined;
188
171
this._root=undefined;
189
172
this._asset=undefined;// Metadata for the entire tileset
190
173
this._properties=undefined;// Metadata for per-model/point/etc properties
@@ -699,9 +682,33 @@ define([
699
682
this._brokenUrlWorkaround=false;
700
683
701
684
varthat=this;
685
+
vartilesetResource;
686
+
when(options.url)
687
+
.then(function(url){
688
+
varbasePath;
689
+
varresource=Resource.createIfNeeded(url);
690
+
691
+
tilesetResource=resource;
692
+
693
+
if(resource.extension==='json'){
694
+
basePath=resource.getBaseUri(true);
695
+
}elseif(resource.isDataUri){
696
+
basePath='';
697
+
}else{
698
+
resource.appendForwardSlash();
699
+
tilesetResource=resource.getDerivedResource({
700
+
url: 'tileset.json'
701
+
});
702
+
basePath=resource.url;
703
+
}
702
704
703
-
// We don't know the distance of the tileset until tileset.json is loaded, so use the default distance for now
704
-
Cesium3DTileset.loadJson(tilesetResource)
705
+
that._url=resource.url;
706
+
that._tilesetUrl=tilesetResource.url;
707
+
that._basePath=basePath;
708
+
709
+
// We don't know the distance of the tileset until tileset.json is loaded, so use the default distance for now
Copy file name to clipboardexpand all lines: Source/Scene/createTileMapServiceImageryProvider.js
+19-11
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ define([
37
37
* @exports createTileMapServiceImageryProvider
38
38
*
39
39
* @param {Object} [options] Object with the following properties:
40
-
* @param {Resource|String} [options.url='.'] Path to image tiles on server.
40
+
* @param {Resource|String|Promise<Resource>|Promise<String>} [options.url='.'] Path to image tiles on server.
41
41
* @param {String} [options.fileExtension='png'] The file extension for images on the server.
42
42
* @param {Credit|String} [options.credit=''] A credit for the data source, which is displayed on the canvas.
43
43
* @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
@@ -95,19 +95,28 @@ define([
95
95
deprecationWarning('createTileMapServiceImageryProvider.proxy','The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.');
0 commit comments