Set reprojection canvas context options

Add example of disabling image smoothing

Add test for reprojection context options
This commit is contained in:
mike-000
2019-12-15 23:24:07 +00:00
parent 4c0bdda8b8
commit 560931e976
18 changed files with 272 additions and 6 deletions
+11 -3
View File
@@ -38,7 +38,8 @@ class ReprojTile extends Tile {
* Function returning source tiles (z, x, y, pixelRatio).
* @param {number=} opt_errorThreshold Acceptable reprojection error (in px).
* @param {boolean=} opt_renderEdges Render reprojection edges.
*/
* @param {object=} opt_contextOptions Properties to set on the canvas context.
*/
constructor(
sourceProj,
sourceTileGrid,
@@ -50,7 +51,8 @@ class ReprojTile extends Tile {
gutter,
getTileFunction,
opt_errorThreshold,
opt_renderEdges
opt_renderEdges,
opt_contextOptions
) {
super(tileCoord, TileState.IDLE);
@@ -60,6 +62,12 @@ class ReprojTile extends Tile {
*/
this.renderEdges_ = opt_renderEdges !== undefined ? opt_renderEdges : false;
/**
* @private
* @type {object}
*/
this.contextOptions_ = opt_contextOptions;
/**
* @private
* @type {number}
@@ -251,7 +259,7 @@ class ReprojTile extends Tile {
this.canvas_ = renderReprojected(width, height, this.pixelRatio_,
sourceResolution, this.sourceTileGrid_.getExtent(),
targetResolution, targetExtent, this.triangulation_, sources,
this.gutter_, this.renderEdges_);
this.gutter_, this.renderEdges_, this.contextOptions_);
this.state = TileState.LOADED;
}