Skip to content

Commit

Permalink
Remove use of curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
Kogis IWI committed Sep 19, 2017
1 parent e726b0d commit 8566cf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Source/Scene/UrlTemplateImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ define([
* });
* // Using custom tags in your template url.
* var custom = new Cesium.UrlTemplateImageryProvider({
* url : 'https://yoururl/{time}/{z}/{y}/{x}.png',
* url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
* customTags : {
* '{time}': function(imageryProvider, x, y , level) {
* Time: function(imageryProvider, x, y , level) {
* return '20171231'
* }
* }
Expand Down Expand Up @@ -578,11 +578,12 @@ define([
}
that._credit = credit;

if (properties.customTags) {
if (defined(properties.customTags)) {
for (var tag in properties.customTags) {
if (properties.customTags.hasOwnProperty(tag)) {
tags[tag] = properties.customTags[tag]; //eslint-disable-line no-use-before-define
pickFeaturesTags[tag] = properties.customTags[tag]; //eslint-disable-line no-use-before-define
var targetTag = '{' + tag + '}';
tags[targetTag] = properties.customTags[tag]; //eslint-disable-line no-use-before-define
pickFeaturesTags[targetTag] = properties.customTags[tag]; //eslint-disable-line no-use-before-define
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Specs/Scene/UrlTemplateImageryProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,14 +640,14 @@ defineSuite([
tilingScheme: new GeographicTilingScheme(),
maximumLevel: 6,
customTags: {
'{custom1}': function() { return 'foo';},
'{custom2}': function() { return 'bar';}
custom1: function() { return 'foo';},
custom2: function() { return 'bar';}
}
});

return pollToPromise(function() {
return provider.ready;
}).then(function() {console.error('spyon');
}).then(function() {
spyOn(loadImage, 'createImage').and.callFake(function(url, crossOrigin, deferred) {
expect(url).toEqual('made/up/tms/server/foo/bar/2/1/3.PNG');

Expand Down

0 comments on commit 8566cf2

Please sign in to comment.