-
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
Refresh imagery provider #5536
Refresh imagery provider #5536
Conversation
@bagnell Can you take a look at this an make sure I'm not doing anything inherently bad at the imagery provider layer? I'll probably need to do a little cleanup with the callbacks once you give the ok. |
@kring any chance you are available to also review this? |
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.
Just trivial comments, I don't have any unique insights here.
viewer.imageryLayers.addImageryProvider(videoProvider); | ||
|
||
viewer.scene.preRender.addEventListener(function() { | ||
videoProvider.reload(); |
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.
Given that the video element is "dynamic", could this be implicit so the user doesn't need to call it when the input is a video element?
I dunno if it will be common enough and if the lack of symmetry with the less frequent dynamic update does more harm than good to the API. Just, in general, whenever the user needs to "make something dirty", it is error prone as we've also ran into this with 3D Tiles styling.
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.
I think it would be a little weird requiring the the SingleTileImageryProvider
to take the scene for this purpose. Not sure how else I would do it.
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.
We could work it into the render loop, but don't worry about it; I doubt it is important enough.
} | ||
|
||
// Insert immediately after existing TileImageries | ||
var insertionPoint = startIndex+tileImageriesToFree; |
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.
Whitespace, sorry.
|
||
this._url = url; | ||
if (defined(url)) { | ||
deprecationWarning('SingleTileImageryProvider.url', 'SingleTileImageryProvider url parameter was deprecated in Cesium 1.35. It now takes an image parameter that can contain a url, a Canvas or an Image. It will be removed in Cesium 1.37.'); |
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.
Update CHANGES.md.
Seems like this should make 1.35.
expect(provider._ready).toBe(true); | ||
}); | ||
|
||
it('reload calls the _reload function', function() { |
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.
Seems like we would need more unit tests to cover all the cases in the new code, right?
@@ -1,92 +1,92 @@ | |||
/*global define*/ | |||
define([ | |||
'../Core/BoundingSphere', |
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.
Whitespace.
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.
You can run npm run sortRequires
to fix this. I would merge master in first.
@@ -611,11 +611,98 @@ define([ | |||
return destroyObject(this); | |||
}; | |||
|
|||
function getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) { | |||
return function(tile) { | |||
var tileImagery, imagery; |
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.
Declare on two separate lines.
I agree. Could you add something like a |
Thanks again for your contribution @tfili! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@tfili what do we want to do with this PR? |
Thanks again for your contribution @tfili! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@hpinkos I don't have time to look at it. A bunch of it was plumbing that was needed for time dynamic WMTS. That has already been merged. What is left is some changes to the interface of SingleTileImageryProvider to take a canvas or image, so it can be used for video. You can close it. There are probably better ways to do it, that we can look at later if need be. |
Adds some plumbing that allows for an imagery provider to be reloaded.
Also adds the ability for
SingleTileImageryProvider
to take anImage
orCanvas
, along with tests.