Skip to content

Commit 61efcd9

Browse files
authored
Merge pull request #6305 from srwiseman/srwiseman_6272_fix
Srwiseman 6272 fix
2 parents e457611 + 04a4465 commit 61efcd9

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change Log
55

66
##### Fixes :wrench:
77
* Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302)
8+
* Fixed improper zoom during model load failure. [#6305](https://github.com/AnalyticalGraphicsInc/cesium/pull/6305)
89

910
### 1.43 - 2018-03-01
1011

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
171171
* [Nacho Carnicero](https://github.com/nacho-carnicero)
172172
* [Y.Selim Abidin](https://github.com/SelimAbidin)
173173
* [Tamar Cohen](https://github.com/tamarmot)
174+
* [Stephen Wiseman](https://github.com/srwiseman)

Source/DataSources/ModelVisualizer.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ define([
126126
incrementallyLoadTextures : Property.getValueOrDefault(modelGraphics._incrementallyLoadTextures, time, defaultIncrementallyLoadTextures),
127127
scene : this._scene
128128
});
129-
130-
model.readyPromise.otherwise(onModelError);
131-
132129
model.id = entity;
133130
primitives.add(model);
134131

@@ -137,9 +134,12 @@ define([
137134
url : resource.url,
138135
animationsRunning : false,
139136
nodeTransformationsScratch : {},
140-
originalNodeMatrixHash : {}
137+
originalNodeMatrixHash : {},
138+
loadFail : false
141139
};
142140
modelHash[entity.id] = modelData;
141+
142+
checkModelLoad(model, entity, modelHash);
143143
}
144144

145145
model.show = true;
@@ -250,7 +250,7 @@ define([
250250
//>>includeEnd('debug');
251251

252252
var modelData = this._modelHash[entity.id];
253-
if (!defined(modelData)) {
253+
if (!defined(modelData) || modelData.loadFail) {
254254
return BoundingSphereState.FAILED;
255255
}
256256

@@ -324,8 +324,11 @@ define([
324324
}
325325
}
326326

327-
function onModelError(error) {
328-
console.error(error);
327+
function checkModelLoad(model, entity, modelHash){
328+
model.readyPromise.otherwise(function(error){
329+
console.error(error);
330+
modelHash[entity.id].loadFail = true;
331+
});
329332
}
330333

331334
return ModelVisualizer;

0 commit comments

Comments
 (0)