Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send key with every Bing tile request. #6250

Merged
merged 2 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 4 additions & 9 deletions Source/Scene/BingMapsImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '');
Expand Down Expand Up @@ -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;
Expand Down