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

@@ -7,7 +7,7 @@ import CollectionEventType from '../CollectionEventType.js';
import _ol_Feature_ from '../Feature.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';
import _ol_array_ from '../array.js';
import {equals} from '../array.js';
import _ol_coordinate_ from '../coordinate.js';
import _ol_events_ from '../events.js';
import Event from '../events/Event.js';
@@ -1181,7 +1181,7 @@ _ol_interaction_Modify_.prototype.updateSegmentIndices_ = function(
this.rBush_.forEachInExtent(geometry.getExtent(), function(segmentDataMatch) {
if (segmentDataMatch.geometry === geometry &&
(depth === undefined || segmentDataMatch.depth === undefined ||
_ol_array_.equals(segmentDataMatch.depth, depth)) &&
equals(segmentDataMatch.depth, depth)) &&
segmentDataMatch.index > index) {
segmentDataMatch.index += delta;
}

View File

@@ -3,7 +3,7 @@
*/
import {getUid, inherits} from '../index.js';
import CollectionEventType from '../CollectionEventType.js';
import _ol_array_ from '../array.js';
import {extend, includes} from '../array.js';
import _ol_events_ from '../events.js';
import Event from '../events/Event.js';
import _ol_events_condition_ from '../events/condition.js';
@@ -113,7 +113,7 @@ var _ol_interaction_Select_ = function(opt_options) {
} else {
var layers = options.layers;
layerFilter = function(layer) {
return _ol_array_.includes(layers, layer);
return includes(layers, layer);
};
}
} else {
@@ -259,12 +259,10 @@ _ol_interaction_Select_.handleEvent = function(mapBrowserEvent) {
*/
function(feature, layer) {
if (this.filter_(feature, layer)) {
if ((add || toggle) &&
!_ol_array_.includes(features.getArray(), feature)) {
if ((add || toggle) && !includes(features.getArray(), feature)) {
selected.push(feature);
this.addFeatureLayerAssociation_(feature, layer);
} else if ((remove || toggle) &&
_ol_array_.includes(features.getArray(), feature)) {
} else if ((remove || toggle) && includes(features.getArray(), feature)) {
deselected.push(feature);
this.removeFeatureLayerAssociation_(feature);
}
@@ -328,10 +326,8 @@ _ol_interaction_Select_.prototype.setMap = function(map) {
*/
_ol_interaction_Select_.getDefaultStyleFunction = function() {
var styles = _ol_style_Style_.createDefaultEditing();
_ol_array_.extend(styles[GeometryType.POLYGON],
styles[GeometryType.LINE_STRING]);
_ol_array_.extend(styles[GeometryType.GEOMETRY_COLLECTION],
styles[GeometryType.LINE_STRING]);
extend(styles[GeometryType.POLYGON], styles[GeometryType.LINE_STRING]);
extend(styles[GeometryType.GEOMETRY_COLLECTION], styles[GeometryType.LINE_STRING]);
return function(feature, resolution) {
if (!feature.getGeometry()) {

View File

@@ -7,7 +7,7 @@ import _ol_Object_ from '../Object.js';
import _ol_events_ from '../events.js';
import Event from '../events/Event.js';
import {TRUE} from '../functions.js';
import _ol_array_ from '../array.js';
import {includes} from '../array.js';
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
import _ol_interaction_Property_ from '../interaction/Property.js';
import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventType.js';
@@ -54,7 +54,7 @@ var _ol_interaction_Translate_ = function(opt_options) {
} else {
var layers = options.layers;
layerFilter = function(layer) {
return _ol_array_.includes(layers, layer);
return includes(layers, layer);
};
}
} else {
@@ -194,8 +194,7 @@ _ol_interaction_Translate_.handleMoveEvent_ = function(event) {
_ol_interaction_Translate_.prototype.featuresAtPixel_ = function(pixel, map) {
return map.forEachFeatureAtPixel(pixel,
function(feature) {
if (!this.features_ ||
_ol_array_.includes(this.features_.getArray(), feature)) {
if (!this.features_ || includes(this.features_.getArray(), feature)) {
return feature;
}
}.bind(this), {