From 52ab354bc63bbd4ebde93568ac93a7a6aa03d092 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Wed, 21 Feb 2018 17:56:52 -0500 Subject: [PATCH 1/2] Don't send key with every Bing tile request. Key is only needed on the initial metadata request. --- Source/Scene/BingMapsImageryProvider.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Source/Scene/BingMapsImageryProvider.js b/Source/Scene/BingMapsImageryProvider.js index c3c43838b70d..bbbcb086793a 100644 --- a/Source/Scene/BingMapsImageryProvider.js +++ b/Source/Scene/BingMapsImageryProvider.js @@ -109,16 +109,10 @@ define([ this._key = BingMapsApi.getKey(options.key); this._keyErrorCredit = BingMapsApi.getErrorCredit(options.key); - var urlResource = Resource.createIfNeeded(options.url, { + this._resource = Resource.createIfNeeded(options.url, { proxy: options.proxy }); - urlResource.setQueryParameters({ - key: this._key - }); - - this._resource = urlResource; - this._tileProtocol = options.tileProtocol; this._mapStyle = defaultValue(options.mapStyle, BingMapsStyle.AERIAL); this._culture = defaultValue(options.culture, ''); @@ -157,10 +151,11 @@ define([ this._ready = false; this._readyPromise = when.defer(); - var metadataResource = urlResource.getDerivedResource({ + var metadataResource = this._resource.getDerivedResource({ url:'/REST/v1/Imagery/Metadata/' + this._mapStyle, queryParameters: { - incl: 'ImageryProviders' + incl: 'ImageryProviders', + key: this._key } }); var that = this; From 2c9c38268d19de66ff57de2fc2d7a167e3139e42 Mon Sep 17 00:00:00 2001 From: Scott Hunter Date: Thu, 22 Feb 2018 09:11:47 -0500 Subject: [PATCH 2/2] update CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index ad8bdc2db0dd..bed3b5e89b0a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ Change Log * Fixed bug where 3D Tiles Point Clouds would fail in Internet Explorer. [#6220](https://github.com/AnalyticalGraphicsInc/cesium/pull/6220) * Fixed `Material` so it can now take a `Resource` object as an image. [#6199](https://github.com/AnalyticalGraphicsInc/cesium/issues/6199) * Fixed issue where `CESIUM_BASE_URL` wouldn't work without a trailing `/`. [#6225](https://github.com/AnalyticalGraphicsInc/cesium/issues/6225) +* Fixed an issue causing the Bing Maps key to be sent unnecessarily with every tile request. [#6250](https://github.com/AnalyticalGraphicsInc/cesium/pull/6250) * Fixed documentation issue for the `Cesium.Math` class. [#6233](https://github.com/AnalyticalGraphicsInc/cesium/issues/6233) ##### Additions :tada: