Add client side raster reprojection support#562
Conversation
|
|
||
| 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.
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.
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.
|
|
||
| const state = tile.getState(); | ||
| if (state === ol.TileState.LOADED || state === ol.TileState.EMPTY) { | ||
| return tile.getImage() || undefined; |
There was a problem hiding this comment.
This return also needs a promise wrapper if tile.getImage() is not undefined
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.