Named exports from ol/dom
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Image_ from '../Image.js';
|
||||
import _ol_ImageState_ from '../ImageState.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import {intersects, getHeight, getWidth} from '../extent.js';
|
||||
@@ -85,7 +85,7 @@ _ol_source_ImageStatic_.prototype.handleImageChange = function(evt) {
|
||||
var resolution = getHeight(imageExtent) / imageHeight;
|
||||
var targetWidth = Math.ceil(getWidth(imageExtent) / resolution);
|
||||
if (targetWidth != imageWidth) {
|
||||
var context = _ol_dom_.createCanvasContext2D(targetWidth, imageHeight);
|
||||
var context = createCanvasContext2D(targetWidth, imageHeight);
|
||||
var canvas = context.canvas;
|
||||
context.drawImage(image, 0, 0, imageWidth, imageHeight,
|
||||
0, 0, canvas.width, canvas.height);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_ImageCanvas_ from '../ImageCanvas.js';
|
||||
import _ol_TileQueue_ from '../TileQueue.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_Event_ from '../events/Event.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
@@ -298,7 +298,7 @@ _ol_source_Raster_.prototype.onWorkerComplete_ = function(frameState, err, outpu
|
||||
} else {
|
||||
var width = Math.round(getWidth(extent) / resolution);
|
||||
var height = Math.round(getHeight(extent) / resolution);
|
||||
context = _ol_dom_.createCanvasContext2D(width, height);
|
||||
context = createCanvasContext2D(width, height);
|
||||
this.renderedImageCanvas_ = new _ol_ImageCanvas_(extent, resolution, 1, context.canvas);
|
||||
}
|
||||
context.putImageData(output, 0, 0);
|
||||
@@ -326,11 +326,11 @@ _ol_source_Raster_.getImageData_ = function(renderer, frameState, layerState) {
|
||||
var width = frameState.size[0];
|
||||
var height = frameState.size[1];
|
||||
if (!_ol_source_Raster_.context_) {
|
||||
_ol_source_Raster_.context_ = _ol_dom_.createCanvasContext2D(width, height);
|
||||
_ol_source_Raster_.context_ = createCanvasContext2D(width, height);
|
||||
} else {
|
||||
var canvas = _ol_source_Raster_.context_.canvas;
|
||||
if (canvas.width !== width || canvas.height !== height) {
|
||||
_ol_source_Raster_.context_ = _ol_dom_.createCanvasContext2D(width, height);
|
||||
_ol_source_Raster_.context_ = createCanvasContext2D(width, height);
|
||||
} else {
|
||||
_ol_source_Raster_.context_.clearRect(0, 0, width, height);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Tile_ from '../Tile.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
import _ol_source_Tile_ from '../source/Tile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
@@ -99,7 +99,7 @@ _ol_source_TileDebug_.Tile_.prototype.getImage = function() {
|
||||
return this.canvas_;
|
||||
} else {
|
||||
var tileSize = this.tileSize_;
|
||||
var context = _ol_dom_.createCanvasContext2D(tileSize[0], tileSize[1]);
|
||||
var context = createCanvasContext2D(tileSize[0], tileSize[1]);
|
||||
|
||||
context.strokeStyle = 'black';
|
||||
context.strokeRect(0.5, 0.5, tileSize[0] + 0.5, tileSize[1] + 0.5);
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_ImageTile_ from '../ImageTile.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import _ol_TileUrlFunction_ from '../TileUrlFunction.js';
|
||||
import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_dom_ from '../dom.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import {getTopLeft} from '../extent.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
import _ol_source_TileImage_ from '../source/TileImage.js';
|
||||
@@ -200,7 +200,7 @@ _ol_source_Zoomify_.Tile_.prototype.getImage = function() {
|
||||
this.zoomifyImage_ = image;
|
||||
return image;
|
||||
} else {
|
||||
var context = _ol_dom_.createCanvasContext2D(tileSize[0], tileSize[1]);
|
||||
var context = createCanvasContext2D(tileSize[0], tileSize[1]);
|
||||
context.drawImage(image, 0, 0);
|
||||
this.zoomifyImage_ = context.canvas;
|
||||
return context.canvas;
|
||||
|
||||
Reference in New Issue
Block a user