Named exports from ol/dom

This commit is contained in:
Frederic Junod
2017-12-14 09:36:05 +01:00
parent fab77e8d37
commit f6627c4d4e
31 changed files with 118 additions and 121 deletions

View File

@@ -1,7 +1,7 @@
/**
* @module ol/style/Atlas
*/
import _ol_dom_ from '../dom.js';
import {createCanvasContext2D} from '../dom.js';
/**
* This class facilitates the creation of image atlases.
@@ -44,7 +44,7 @@ var _ol_style_Atlas_ = function(size, space) {
* @private
* @type {CanvasRenderingContext2D}
*/
this.context_ = _ol_dom_.createCanvasContext2D(size, size);
this.context_ = createCanvasContext2D(size, size);
/**
* @private

View File

@@ -2,7 +2,7 @@
* @module ol/style/IconImage
*/
import {inherits} from '../index.js';
import _ol_dom_ from '../dom.js';
import {createCanvasContext2D} from '../dom.js';
import _ol_events_ from '../events.js';
import _ol_events_EventTarget_ from '../events/EventTarget.js';
import _ol_events_EventType_ from '../events/EventType.js';
@@ -118,7 +118,7 @@ _ol_style_IconImage_.get = function(image, src, size, crossOrigin, imageState,
* @private
*/
_ol_style_IconImage_.prototype.determineTainting_ = function() {
var context = _ol_dom_.createCanvasContext2D(1, 1);
var context = createCanvasContext2D(1, 1);
try {
context.drawImage(this.image_, 0, 0);
context.getImageData(0, 0, 1, 1);
@@ -189,7 +189,7 @@ _ol_style_IconImage_.prototype.getHitDetectionImage = function(pixelRatio) {
if (this.tainting_) {
var width = this.size_[0];
var height = this.size_[1];
var context = _ol_dom_.createCanvasContext2D(width, height);
var context = createCanvasContext2D(width, height);
context.fillRect(0, 0, width, height);
this.hitDetectionImage_ = context.canvas;
} else {

View File

@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_colorlike_ from '../colorlike.js';
import _ol_dom_ from '../dom.js';
import {createCanvasContext2D} from '../dom.js';
import _ol_has_ from '../has.js';
import _ol_ImageState_ from '../ImageState.js';
import _ol_render_canvas_ from '../render/canvas.js';
@@ -368,7 +368,7 @@ _ol_style_RegularShape_.prototype.render_ = function(atlasManager) {
if (atlasManager === undefined) {
// no atlas manager is used, create a new canvas
var context = _ol_dom_.createCanvasContext2D(size, size);
var context = createCanvasContext2D(size, size);
this.canvas_ = context.canvas;
// canvas.width and height are rounded to the closest integer
@@ -489,7 +489,7 @@ _ol_style_RegularShape_.prototype.createHitDetectionCanvas_ = function(renderOpt
// if no fill style is set, create an extra hit-detection image with a
// default fill style
var context = _ol_dom_.createCanvasContext2D(renderOptions.size, renderOptions.size);
var context = createCanvasContext2D(renderOptions.size, renderOptions.size);
this.hitDetectionCanvas_ = context.canvas;
this.drawHitDetectionCanvas_(renderOptions, context, 0, 0);