Skip to content

Commit

Permalink
Merge pull request #3986 from AnalyticalGraphicsInc/kml-remove-deprec…
Browse files Browse the repository at this point in the history
…ation

Removed deprecation warnings in KmlDataSource
  • Loading branch information
Hannah committed Jun 1, 2016
2 parents 55d17c9 + 6c330e7 commit 17d295a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
5 changes: 4 additions & 1 deletion Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ define([
} else if (/\.geojson$/i.test(source) || /\.json$/i.test(source) || /\.topojson$/i.test(source)) {
loadPromise = GeoJsonDataSource.load(source);
} else if (/\.kml$/i.test(source) || /\.kmz$/i.test(source)) {
loadPromise = KmlDataSource.load(source);
loadPromise = KmlDataSource.load(source, {
camera: scene.camera,
canvas: scene.canvas
});
} else {
showLoadError(source, 'Unknown format.');
}
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Change Log

### 1.22 - 2016-06-01

* Breaking changes
* `KmlDataSource` now requires `options.camera` and `options.canvas`.
* Added shadows
* See the Sandcastle demo: [Shadows](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Shadows.html&label=Showcases).
* Added `Viewer.shadows` and `Viewer.terrainShadows`. Both are off by default.
Expand Down
26 changes: 9 additions & 17 deletions Source/DataSources/KmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define([
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/DeveloperError',
'../Core/Ellipsoid',
'../Core/Event',
Expand Down Expand Up @@ -70,7 +69,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Ellipsoid,
Event,
Expand Down Expand Up @@ -2129,21 +2127,18 @@ define([
* });
*/
function KmlDataSource(options) {
var showWarning = false;
options = defaultValue(options, {});
if (defined(options.getURL)) {
showWarning = true;
var proxy = options;
options = {
proxy: proxy
};
} else if (!defined(options.camera) || !defined(options.canvas)) {
showWarning = true;
}
var camera = options.camera;
var canvas = options.canvas;

if (showWarning) {
deprecationWarning('KmlDataSource', 'KmlDataSource now longer takes a proxy object. It takes an options object with camera and canvas as required properties. This will throw in Cesium 1.22.');
//>>includeStart('debug', pragmas.debug);
if (!defined(camera)) {
throw new DeveloperError('options.camera is required.');
}
if (!defined(canvas)) {
throw new DeveloperError('options.canvas is required.');
}
//>>includeEnd('debug');

this._changed = new Event();
this._error = new Event();
Expand All @@ -2158,9 +2153,6 @@ define([
this._promises = [];
this._networkLinks = new AssociativeArray();

var camera = options.camera;
var canvas = options.canvas;

this._canvas = canvas;
this._camera = camera;
this._lastCameraView = {
Expand Down
2 changes: 1 addition & 1 deletion Specs/DataSources/KmlDataSourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ defineSuite([
});

it('show sets underlying entity collection show.', function() {
var dataSource = new KmlDataSource();
var dataSource = new KmlDataSource(options);

dataSource.show = false;
expect(dataSource.show).toBe(false);
Expand Down

0 comments on commit 17d295a

Please sign in to comment.