ol/render/replay export

This commit is contained in:
raiyni
2018-02-15 22:54:02 -06:00
parent c715570f87
commit b5b3e256f8
7 changed files with 35 additions and 36 deletions

View File

@@ -5,7 +5,7 @@ import {inherits} from '../../index.js';
import {numberSafeCompareFunction} from '../../array.js';
import {buffer, createOrUpdateFromCoordinate} from '../../extent.js';
import {isEmpty} from '../../obj.js';
import _ol_render_replay_ from '../replay.js';
import {ORDER} from '../replay.js';
import ReplayGroup from '../ReplayGroup.js';
import WebGLCircleReplay from '../webgl/CircleReplay.js';
import WebGLImageReplay from '../webgl/ImageReplay.js';
@@ -171,8 +171,8 @@ WebGLReplayGroup.prototype.replay = function(context,
let i, ii, j, jj, replays, replay;
for (i = 0, ii = zs.length; i < ii; ++i) {
replays = this.replaysByZIndex_[zs[i].toString()];
for (j = 0, jj = _ol_render_replay_.ORDER.length; j < jj; ++j) {
replay = replays[_ol_render_replay_.ORDER[j]];
for (j = 0, jj = ORDER.length; j < jj; ++j) {
replay = replays[ORDER[j]];
if (replay !== undefined) {
replay.replay(context,
center, resolution, rotation, size, pixelRatio,
@@ -214,8 +214,8 @@ WebGLReplayGroup.prototype.replayHitDetection_ = function(context,
let i, ii, j, replays, replay, result;
for (i = 0, ii = zs.length; i < ii; ++i) {
replays = this.replaysByZIndex_[zs[i].toString()];
for (j = _ol_render_replay_.ORDER.length - 1; j >= 0; --j) {
replay = replays[_ol_render_replay_.ORDER[j]];
for (j = ORDER.length - 1; j >= 0; --j) {
replay = replays[ORDER[j]];
if (replay !== undefined) {
result = replay.replay(context,
center, resolution, rotation, size, pixelRatio, opacity,

View File

@@ -6,7 +6,7 @@ import {asColorLike} from '../../colorlike.js';
import {createCanvasContext2D} from '../../dom.js';
import GeometryType from '../../geom/GeometryType.js';
import {CANVAS_LINE_DASH} from '../../has.js';
import _ol_render_replay_ from '../replay.js';
import {TEXT_ALIGN} from '../replay.js';
import {DEFAULT_FILLSTYLE, DEFAULT_FONT, DEFAULT_LINECAP, DEFAULT_LINEDASH,
DEFAULT_LINEDASHOFFSET, DEFAULT_LINEJOIN, DEFAULT_LINEWIDTH, DEFAULT_MITERLIMIT,
DEFAULT_STROKESTYLE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE} from '../webgl.js';
@@ -378,8 +378,8 @@ WebGLTextReplay.prototype.setTextStyle = function(textStyle) {
state.font = textStyle.getFont() || DEFAULT_FONT;
state.scale = textStyle.getScale() || 1;
this.text_ = /** @type {string} */ (textStyle.getText());
const textAlign = _ol_render_replay_.TEXT_ALIGN[textStyle.getTextAlign()];
const textBaseline = _ol_render_replay_.TEXT_ALIGN[textStyle.getTextBaseline()];
const textAlign = TEXT_ALIGN[textStyle.getTextAlign()];
const textBaseline = TEXT_ALIGN[textStyle.getTextBaseline()];
this.textAlign_ = textAlign === undefined ?
DEFAULT_TEXTALIGN : textAlign;
this.textBaseline_ = textBaseline === undefined ?