diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index 245a68583a2..7a55d5723ea 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -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' * } * } @@ -581,8 +581,9 @@ define([ if (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 } } } diff --git a/Specs/Scene/UrlTemplateImageryProviderSpec.js b/Specs/Scene/UrlTemplateImageryProviderSpec.js index b166e49550b..58b36954a39 100644 --- a/Specs/Scene/UrlTemplateImageryProviderSpec.js +++ b/Specs/Scene/UrlTemplateImageryProviderSpec.js @@ -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');