-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
New Bing Maps Styles - AerialWithLabelsOnDemand and RoadOnDemand. #7808
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ec95876
Added support for Bing Maps' AerialWithLabelsOnDemand and RoadOnDeman…
KeyboardSounds 5e41791
Added tests for updated bing maps imagery
KeyboardSounds 7a4b700
Added tests for DiscardEmptyTileImagePolicy, updated CHANGES.md
KeyboardSounds 5a8d583
Made comment on image blob loading error handling clearer.
KeyboardSounds 7f34fdd
fixed linter error - 'missing use strict'
KeyboardSounds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
define([ | ||
'../Core/defined', | ||
'../Core/defaultValue' | ||
], function( | ||
defined, | ||
defaultValue) { | ||
'use strict'; | ||
|
||
/** | ||
* A policy for discarding tile images that contain no data (and so aren't actually images). | ||
* | ||
* @alias DiscardEmptyTileImagePolicy | ||
* @constructor | ||
* | ||
* @see DiscardMissingTileImagePolicy | ||
*/ | ||
function DiscardEmptyTileImagePolicy(options) { | ||
} | ||
|
||
/** | ||
* Determines if the discard policy is ready to process images. | ||
* @returns {Boolean} True if the discard policy is ready to process images; otherwise, false. | ||
*/ | ||
DiscardEmptyTileImagePolicy.prototype.isReady = function() { | ||
return true; | ||
}; | ||
|
||
/** | ||
* Given a tile image, decide whether to discard that image. | ||
* | ||
* @param {Image} image An image to test. | ||
* @returns {Boolean} True if the image should be discarded; otherwise, false. | ||
*/ | ||
DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage = function(image) { | ||
return DiscardEmptyTileImagePolicy.EMPTY_IMAGE === image; | ||
}; | ||
|
||
/** | ||
* Default value for representing an empty image. | ||
*/ | ||
DiscardEmptyTileImagePolicy.EMPTY_IMAGE = {}; | ||
|
||
return DiscardEmptyTileImagePolicy; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
defineSuite([ | ||
'Scene/DiscardEmptyTileImagePolicy', | ||
'Core/Resource', | ||
'Specs/pollToPromise', | ||
'ThirdParty/when' | ||
], function( | ||
DiscardEmptyTileImagePolicy, | ||
Resource, | ||
pollToPromise, | ||
when) { | ||
'use strict'; | ||
|
||
afterEach(function() { | ||
Resource._Implementations.createImage = Resource._DefaultImplementations.createImage; | ||
Resource._Implementations.loadWithXhr = Resource._DefaultImplementations.loadWithXhr; | ||
}); | ||
|
||
describe('shouldDiscardImage', function() { | ||
fit('does not discard a non-empty image', function() { | ||
var promises = []; | ||
promises.push(Resource.fetchImage('Data/Images/Green4x4.png')); | ||
|
||
var policy = new DiscardEmptyTileImagePolicy(); | ||
|
||
promises.push(pollToPromise(function() { | ||
return policy.isReady(); | ||
})); | ||
|
||
return when.all(promises, function(results) { | ||
var greenImage = results[0]; | ||
|
||
expect(policy.shouldDiscardImage(greenImage)).toEqual(false); | ||
}); | ||
}); | ||
|
||
fit('discards an empty image', function() { | ||
var promises = []; | ||
promises.push(when.resolve(DiscardEmptyTileImagePolicy.EMPTY_IMAGE)); | ||
|
||
var policy = new DiscardEmptyTileImagePolicy(); | ||
|
||
promises.push(pollToPromise(function() { | ||
return policy.isReady(); | ||
})); | ||
|
||
return when.all(promises, function(results) { | ||
var emptyImage = results[0]; | ||
|
||
expect(policy.shouldDiscardImage(emptyImage)).toEqual(true); | ||
}); | ||
}); | ||
|
||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fit
snuck into the committed code here, which disables all other tests. (this sort of thing is whyfit
should just not exist in Jasmine, in my opinion)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fit
andfdescribe
are really helpful if you just need to debug one new test. However, in some of our other repos we added a custom eslint rule to catch it so it would break CI if you committed it. Maybe we should add that to this repo tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec filtering can run single tests or suites without needing to edit the source, e.g.:
http://localhost:8080/Specs/SpecRunner.html?spec=Core%2FappendForwardSlash%20Appends%20to%20a%20url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't work if you need to run it from the command line to reproduce an error that only happens in travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our custom web client is honestly crazy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't our
eslint
configuraton flag fit/fdescribe? It does everywhere else outside of Cesium.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'm pretty sure it's just in the
eslintrc.json
for specific projectsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Play. We should definitely fix that then, I'll open a PR soon-ish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #7809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How embarrassing, good catch. 😳