-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add client side raster reprojection support #562
Conversation
src/olcs/core/olimageryprovider.js
Outdated
|
||
const tilegrid = this.source_.getTileGridForProjection(this.projection_); | ||
if (z_ < tilegrid.getMinZoom() || z_ > tilegrid.getMaxZoom()) { | ||
return this.emptyCanvas_; // no data |
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.
There are several places in this function which do not follow the Cesium API reference and return something other than Promise<Image|Canvas>|undefined
. Is that intentional based on undocumented Cesium workings?
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.
Hi @wallw-bits, you are right it works but it is incorrect.
I am fixing this one by wrapping the returned value like this: Promise.resolve(this.emptyCanvas_)
. Can you come up with a PR to fix the other incorrect places?
This is related to (and based on) openlayers/ol-cesium#562 and openlayers/ol-cesium#37. However, we need it for GeoPackage support rather than for reprojection. Additionally, this helps support any other custom tile classes and tile load functions in Cesium.
src/olcs/core/olimageryprovider.js
Outdated
|
||
const state = tile.getState(); | ||
if (state === ol.TileState.LOADED || state === ol.TileState.EMPTY) { | ||
return tile.getImage() || undefined; |
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.
This return also needs a promise wrapper if tile.getImage()
is not undefined
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.
Thanks, done.
5bd340b
to
182b5e0
Compare
182b5e0
to
8a43c2e
Compare
I am hiding the feature behind a flag so that it can be merged. @fredj, could you please have a look to it? |
This branch have issues. I am restoring it and "unmerging" the PR. |
Fixes #37.