Skip to content

Commit 1a96bc9

Browse files
authored
Merge pull request #6075 from AnalyticalGraphicsInc/credits-params
Remove deprecated Credit parameters
2 parents 1602bb2 + 472ffd6 commit 1a96bc9

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Change Log
33

44
### 1.41 - 2018-01-02
55

6+
* Breaking changes
7+
* Removed the `text`, `imageUrl`, and `link` parameters for `Credit`, which were deprecated in Cesium 1.40. Use `options.text`, `options.imageUrl`, and `options.link` instead.
68
* Added support for clipping planes
79
* Added `clippingPlanes` property to `ModelGraphics`, `Model`, and `Cesium3DTileset`, which specifies a `ClippingPlaneCollection` to selectively disable rendering on the object. [#5913](https://github.com/AnalyticalGraphicsInc/cesium/pull/5913)
810
* Added `clippingPlanes` property to `Globe` which specifies a `ClippingPlaneCollection` to selectively disable rendering of the globe surface. [#5996](https://github.com/AnalyticalGraphicsInc/cesium/pull/5996)

Source/Core/Credit.js

+15-17
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ define([
22
'./defaultValue',
33
'./defined',
44
'./defineProperties',
5-
'./deprecationWarning',
65
'./DeveloperError'
76
], function(
87
defaultValue,
98
defined,
109
defineProperties,
11-
deprecationWarning,
1210
DeveloperError) {
1311
'use strict';
1412

@@ -26,31 +24,31 @@ define([
2624
* @alias Credit
2725
* @constructor
2826
*
27+
* @exception {DeveloperError} options.text, options.imageUrl, or options.link is required.
28+
*
2929
* @example
3030
* //Create a credit with a tooltip, image and link
31-
* var credit = new Cesium.Credit('Cesium', '/images/cesium_logo.png', 'http://cesiumjs.org/');
31+
* var credit = new Cesium.Credit({
32+
* text : 'Cesium',
33+
* imageUrl : '/images/cesium_logo.png',
34+
* link : 'http://cesiumjs.org/'
35+
* });
3236
*/
33-
function Credit(options, imageUrl, link) {
34-
var text;
35-
var showOnScreen;
36-
if (typeof options !== 'object') {
37-
deprecationWarning('Credit parameters', 'The Credit text, imageUrl and link parameters have been replaced by a single options object parameter with text, imageUrl and link properties. Use of the old parameters will be removed in Cesium 1.41');
38-
text = options;
39-
showOnScreen = false;
40-
} else {
41-
text = options.text;
42-
imageUrl = options.imageUrl;
43-
link = options.link;
44-
showOnScreen = defaultValue(options.showOnScreen, false);
45-
}
37+
function Credit(options) {
38+
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
39+
40+
var text = options.text;
41+
var imageUrl = options.imageUrl;
42+
var link = options.link;
43+
var showOnScreen = defaultValue(options.showOnScreen, false);
4644

4745
var hasLink = (defined(link));
4846
var hasImage = (defined(imageUrl));
4947
var hasText = (defined(text));
5048

5149
//>>includeStart('debug', pragmas.debug);
5250
if (!hasText && !hasImage && !hasLink) {
53-
throw new DeveloperError('text, imageUrl or link is required');
51+
throw new DeveloperError('options.text, options.imageUrl, or options.link is required.');
5452
}
5553
//>>includeEnd('debug');
5654

Source/Scene/WebMapTileServiceImageryProvider.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ define([
7878
* tileMatrixSetID : 'default028mm',
7979
* // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
8080
* maximumLevel: 19,
81-
* credit : new Cesium.Credit('U. S. Geological Survey')
81+
* credit : new Cesium.Credit({ text : 'U. S. Geological Survey' })
8282
* });
8383
* viewer.imageryLayers.addImageryProvider(shadedRelief1);
8484
*
@@ -91,7 +91,7 @@ define([
9191
* format : 'image/jpeg',
9292
* tileMatrixSetID : 'default028mm',
9393
* maximumLevel: 19,
94-
* credit : new Cesium.Credit('U. S. Geological Survey')
94+
* credit : new Cesium.Credit({ text : 'U. S. Geological Survey' })
9595
* });
9696
* viewer.imageryLayers.addImageryProvider(shadedRelief2);
9797
*
@@ -114,7 +114,7 @@ define([
114114
* format : 'image/png',
115115
* clock: clock,
116116
* times: times,
117-
* credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
117+
* credit : new Cesium.Credit({ text : 'NASA Global Imagery Browse Services for EOSDIS' })
118118
* });
119119
* viewer.imageryLayers.addImageryProvider(weather);
120120
*

0 commit comments

Comments
 (0)