Align layer canvas to the left
So that the position is not affected by the `text-align` css rule.
This commit is contained in:
@@ -109,6 +109,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
|||||||
container.appendChild(canvas);
|
container.appendChild(canvas);
|
||||||
style = canvas.style;
|
style = canvas.style;
|
||||||
style.position = 'absolute';
|
style.position = 'absolute';
|
||||||
|
style.left = '0';
|
||||||
style.transformOrigin = 'top left';
|
style.transformOrigin = 'top left';
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
const overlayContext = createCanvasContext2D();
|
const overlayContext = createCanvasContext2D();
|
||||||
const style = overlayContext.canvas.style;
|
const style = overlayContext.canvas.style;
|
||||||
style.position = 'absolute';
|
style.position = 'absolute';
|
||||||
|
style.left = '0';
|
||||||
style.transformOrigin = 'top left';
|
style.transformOrigin = 'top left';
|
||||||
this.overlayContext_ = overlayContext;
|
this.overlayContext_ = overlayContext;
|
||||||
this.overlayContextUid_ = getUid(overlayContext);
|
this.overlayContextUid_ = getUid(overlayContext);
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ class WebGLHelper extends Disposable {
|
|||||||
*/
|
*/
|
||||||
this.canvas_ = document.createElement('canvas');
|
this.canvas_ = document.createElement('canvas');
|
||||||
this.canvas_.style.position = 'absolute';
|
this.canvas_.style.position = 'absolute';
|
||||||
|
this.canvas_.style.left = '0';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user