Skip to content

Commit eaaadd4

Browse files
author
Hannah
authored
Merge pull request #6003 from nrivera-Novetta/master
Insert missing namespace declarations for KMZ files
2 parents cb632d8 + cd6e045 commit eaaadd4

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Change Log
77
* Added ability to support touch event in Imagery Layers Split demo application. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948)
88
* Fixed `Invalid asm.js: Invalid member of stdlib` console error by recompiling crunch.js with latest emscripten toolchain. [#5847](https://github.com/AnalyticalGraphicsInc/cesium/issues/5847)
99
* Added CZML support for `polyline.depthFailMaterial`, `label.scaleByDistance`, `distanceDisplayCondition`, and `disableDepthTestDistance`. [#5986](https://github.com/AnalyticalGraphicsInc/cesium/pull/5986)
10+
* Fixed handling of KMZ files with missing `xsi` namespace declarations. [#6003](https://github.com/AnalyticalGraphicsInc/cesium/pull/6003)
1011
* Fixed a bug where models with animations of different lengths would cause an error. [#5694](https://github.com/AnalyticalGraphicsInc/cesium/issues/5694)
1112
* Added a `clampAnimations` parameter to `Model` and `Entity.model`. Setting this to `false` allows different length animations to loop asynchronously over the duration of the longest animation.
1213

Source/DataSources/KmlDataSource.js

+1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ define([
284284

285285
function loadXmlFromZip(reader, entry, uriResolver, deferred) {
286286
entry.getData(new zip.TextWriter(), function(text) {
287+
text = insertNamespaces(text);
287288
uriResolver.kml = parser.parseFromString(text, 'application/xml');
288289
deferred.resolve();
289290
});
458 Bytes
Binary file not shown.

Specs/DataSources/KmlDataSourceSpec.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,22 @@ defineSuite([
244244
});
245245
});
246246

247-
it('load inserts missing namespace declaration', function() {
247+
it('load inserts missing namespace declaration into kml', function() {
248248
var dataSource = new KmlDataSource(options);
249249
return dataSource.load('Data/KML/undeclaredNamespaces.kml').then(function(source) {
250250
expect(source).toBe(dataSource);
251251
expect(source.entities.values.length).toEqual(1);
252252
});
253253
});
254254

255+
it('load inserts missing namespace declaration into kmz', function() {
256+
var dataSource = new KmlDataSource(options);
257+
return dataSource.load('Data/KML/undeclaredNamespaces.kmz').then(function(source) {
258+
expect(source).toBe(dataSource);
259+
expect(source.entities.values.length).toEqual(1);
260+
});
261+
});
262+
255263
it('load rejects nonexistent URL', function() {
256264
return KmlDataSource.load('test.invalid', options).otherwise(function(e) {
257265
expect(e).toBeInstanceOf(RequestErrorEvent);

0 commit comments

Comments
 (0)