Named exports from ol/array module

This commit is contained in:
Marc Jansen
2017-12-19 12:22:46 +01:00
committed by Frederic Junod
parent 767f61ba78
commit 02002082bf
47 changed files with 296 additions and 298 deletions

View File

@@ -2,7 +2,7 @@
* @module ol/render/webgl/CircleReplay
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import {equals} from '../../array.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_obj_ from '../../obj.js';
@@ -409,8 +409,8 @@ _ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle = function(fillStyle
} else {
fillStyleColor = _ol_render_webgl_.defaultFillStyle;
}
if (!this.state_.strokeColor || !_ol_array_.equals(this.state_.strokeColor, strokeStyleColor) ||
!this.state_.fillColor || !_ol_array_.equals(this.state_.fillColor, fillStyleColor) ||
if (!this.state_.strokeColor || !equals(this.state_.strokeColor, strokeStyleColor) ||
!this.state_.fillColor || !equals(this.state_.fillColor, fillStyleColor) ||
this.state_.lineWidth !== strokeStyleWidth) {
this.state_.changed = true;
this.state_.fillColor = fillStyleColor;

View File

@@ -2,7 +2,7 @@
* @module ol/render/webgl/LineStringReplay
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import {equals} from '../../array.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_geom_flat_orient_ from '../../geom/flat/orient.js';
@@ -107,7 +107,7 @@ _ol_render_webgl_LineStringReplay_.prototype.drawCoordinates_ = function(flatCoo
//First vertex.
if (i === offset) {
p2 = [flatCoordinates[i + stride], flatCoordinates[i + stride + 1]];
if (end - offset === stride * 2 && _ol_array_.equals(p1, p2)) {
if (end - offset === stride * 2 && equals(p1, p2)) {
break;
}
if (closed) {
@@ -291,7 +291,7 @@ _ol_render_webgl_LineStringReplay_.prototype.isValid_ = function(flatCoordinates
} else if (range === stride * 2) {
var firstP = [flatCoordinates[offset], flatCoordinates[offset + 1]];
var lastP = [flatCoordinates[offset + stride], flatCoordinates[offset + stride + 1]];
return !_ol_array_.equals(firstP, lastP);
return !equals(firstP, lastP);
}
return true;
@@ -659,7 +659,7 @@ _ol_render_webgl_LineStringReplay_.prototype.setFillStrokeStyle = function(fillS
var strokeStyleMiterLimit = strokeStyle.getMiterLimit();
strokeStyleMiterLimit = strokeStyleMiterLimit !== undefined ?
strokeStyleMiterLimit : _ol_render_webgl_.defaultMiterLimit;
if (!this.state_.strokeColor || !_ol_array_.equals(this.state_.strokeColor, strokeStyleColor) ||
if (!this.state_.strokeColor || !equals(this.state_.strokeColor, strokeStyleColor) ||
this.state_.lineWidth !== strokeStyleWidth || this.state_.miterLimit !== strokeStyleMiterLimit) {
this.state_.changed = true;
this.state_.strokeColor = strokeStyleColor;

View File

@@ -2,7 +2,7 @@
* @module ol/render/webgl/PolygonReplay
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import {equals} from '../../array.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_obj_ from '../../obj.js';
@@ -1054,7 +1054,7 @@ _ol_render_webgl_PolygonReplay_.prototype.setFillStrokeStyle = function(fillStyl
} else {
fillStyleColor = _ol_render_webgl_.defaultFillStyle;
}
if (!this.state_.fillColor || !_ol_array_.equals(fillStyleColor, this.state_.fillColor)) {
if (!this.state_.fillColor || !equals(fillStyleColor, this.state_.fillColor)) {
this.state_.fillColor = fillStyleColor;
this.state_.changed = true;
this.styles_.push(fillStyleColor);

View File

@@ -2,7 +2,7 @@
* @module ol/render/webgl/ReplayGroup
*/
import {inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import {numberSafeCompareFunction} from '../../array.js';
import {buffer, createOrUpdateFromCoordinate} from '../../extent.js';
import _ol_obj_ from '../../obj.js';
import _ol_render_replay_ from '../replay.js';
@@ -149,7 +149,7 @@ _ol_render_webgl_ReplayGroup_.prototype.replay = function(context,
opacity, skippedFeaturesHash) {
/** @type {Array.<number>} */
var zs = Object.keys(this.replaysByZIndex_).map(Number);
zs.sort(_ol_array_.numberSafeCompareFunction);
zs.sort(numberSafeCompareFunction);
var i, ii, j, jj, replays, replay;
for (i = 0, ii = zs.length; i < ii; ++i) {