Autofix indentation issues (eslint --fix)
This commit is contained in:
@@ -34,14 +34,14 @@ ol.interaction.DragAndDrop = function(opt_options) {
|
||||
* @type {Array.<function(new: ol.format.Feature)>}
|
||||
*/
|
||||
this.formatConstructors_ = options.formatConstructors ?
|
||||
options.formatConstructors : [];
|
||||
options.formatConstructors : [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection}
|
||||
*/
|
||||
this.projection_ = options.projection ?
|
||||
ol.proj.get(options.projection) : null;
|
||||
ol.proj.get(options.projection) : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -58,14 +58,14 @@ ol.interaction.DragBox = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.always;
|
||||
options.condition : ol.events.condition.always;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.DragBoxEndConditionType}
|
||||
*/
|
||||
this.boxEndCondition_ = options.boxEndCondition ?
|
||||
options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition;
|
||||
options.boxEndCondition : ol.interaction.DragBox.defaultBoxEndCondition;
|
||||
};
|
||||
ol.inherits(ol.interaction.DragBox, ol.interaction.Pointer);
|
||||
|
||||
@@ -100,7 +100,7 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);
|
||||
|
||||
this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType_.BOXDRAG,
|
||||
mapBrowserEvent.coordinate, mapBrowserEvent));
|
||||
mapBrowserEvent.coordinate, mapBrowserEvent));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ ol.interaction.DragPan = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.noModifierKeys;
|
||||
options.condition : ol.events.condition.noModifierKeys;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -37,7 +37,7 @@ ol.interaction.DragRotate = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.altShiftKeysOnly;
|
||||
options.condition : ol.events.condition.altShiftKeysOnly;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -38,7 +38,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.shiftKeyOnly;
|
||||
options.condition : ol.events.condition.shiftKeyOnly;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -25,7 +25,7 @@ ol.interaction.DragZoom = function(opt_options) {
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var condition = options.condition ?
|
||||
options.condition : ol.events.condition.shiftKeyOnly;
|
||||
options.condition : ol.events.condition.shiftKeyOnly;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -105,8 +105,8 @@ ol.interaction.Draw = function(options) {
|
||||
* @private
|
||||
*/
|
||||
this.minPoints_ = options.minPoints ?
|
||||
options.minPoints :
|
||||
(this.mode_ === ol.interaction.Draw.Mode_.POLYGON ? 3 : 2);
|
||||
options.minPoints :
|
||||
(this.mode_ === ol.interaction.Draw.Mode_.POLYGON ? 3 : 2);
|
||||
|
||||
/**
|
||||
* The number of points that can be drawn before a polygon ring or line string
|
||||
@@ -134,7 +134,7 @@ ol.interaction.Draw = function(options) {
|
||||
*/
|
||||
geometryFunction = function(coordinates, opt_geometry) {
|
||||
var circle = opt_geometry ? /** @type {ol.geom.Circle} */ (opt_geometry) :
|
||||
new ol.geom.Circle([NaN, NaN]);
|
||||
new ol.geom.Circle([NaN, NaN]);
|
||||
var squaredLength = ol.coordinate.squaredDistance(
|
||||
coordinates[0], coordinates[1]);
|
||||
circle.setCenterAndRadius(coordinates[0], Math.sqrt(squaredLength));
|
||||
@@ -229,7 +229,7 @@ ol.interaction.Draw = function(options) {
|
||||
* @private
|
||||
*/
|
||||
this.squaredClickTolerance_ = options.clickTolerance ?
|
||||
options.clickTolerance * options.clickTolerance : 36;
|
||||
options.clickTolerance * options.clickTolerance : 36;
|
||||
|
||||
/**
|
||||
* Draw overlay where our sketch features are drawn.
|
||||
@@ -242,7 +242,7 @@ ol.interaction.Draw = function(options) {
|
||||
wrapX: options.wrapX ? options.wrapX : false
|
||||
}),
|
||||
style: options.style ? options.style :
|
||||
ol.interaction.Draw.getDefaultStyleFunction()
|
||||
ol.interaction.Draw.getDefaultStyleFunction()
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -257,7 +257,7 @@ ol.interaction.Draw = function(options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.noModifierKeys;
|
||||
options.condition : ol.events.condition.noModifierKeys;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -268,7 +268,7 @@ ol.interaction.Draw = function(options) {
|
||||
this.freehandCondition_ = ol.events.condition.always;
|
||||
} else {
|
||||
this.freehandCondition_ = options.freehandCondition ?
|
||||
options.freehandCondition : ol.events.condition.shiftKeyOnly;
|
||||
options.freehandCondition : ol.events.condition.shiftKeyOnly;
|
||||
}
|
||||
|
||||
ol.events.listen(this,
|
||||
@@ -401,8 +401,8 @@ ol.interaction.Draw.prototype.handlePointerMove_ = function(event) {
|
||||
var dy = downPx[1] - clickPx[1];
|
||||
var squaredDistance = dx * dx + dy * dy;
|
||||
this.shouldHandle_ = this.freehand_ ?
|
||||
squaredDistance > this.squaredClickTolerance_ :
|
||||
squaredDistance <= this.squaredClickTolerance_;
|
||||
squaredDistance > this.squaredClickTolerance_ :
|
||||
squaredDistance <= this.squaredClickTolerance_;
|
||||
}
|
||||
|
||||
if (this.finishCoordinate_) {
|
||||
@@ -767,23 +767,23 @@ ol.interaction.Draw.prototype.updateState_ = function() {
|
||||
*/
|
||||
ol.interaction.Draw.createRegularPolygon = function(opt_sides, opt_angle) {
|
||||
return (
|
||||
/**
|
||||
/**
|
||||
* @param {ol.Coordinate|Array.<ol.Coordinate>|Array.<Array.<ol.Coordinate>>} coordinates
|
||||
* @param {ol.geom.SimpleGeometry=} opt_geometry
|
||||
* @return {ol.geom.SimpleGeometry}
|
||||
*/
|
||||
function(coordinates, opt_geometry) {
|
||||
var center = coordinates[0];
|
||||
var end = coordinates[1];
|
||||
var radius = Math.sqrt(
|
||||
ol.coordinate.squaredDistance(center, end));
|
||||
var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) :
|
||||
ol.geom.Polygon.fromCircle(new ol.geom.Circle(center), opt_sides);
|
||||
var angle = opt_angle ? opt_angle :
|
||||
Math.atan((end[1] - center[1]) / (end[0] - center[0]));
|
||||
ol.geom.Polygon.makeRegular(geometry, center, radius, angle);
|
||||
return geometry;
|
||||
}
|
||||
function(coordinates, opt_geometry) {
|
||||
var center = coordinates[0];
|
||||
var end = coordinates[1];
|
||||
var radius = Math.sqrt(
|
||||
ol.coordinate.squaredDistance(center, end));
|
||||
var geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) :
|
||||
ol.geom.Polygon.fromCircle(new ol.geom.Circle(center), opt_sides);
|
||||
var angle = opt_angle ? opt_angle :
|
||||
Math.atan((end[1] - center[1]) / (end[0] - center[0]));
|
||||
ol.geom.Polygon.makeRegular(geometry, center, radius, angle);
|
||||
return geometry;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -183,13 +183,13 @@ ol.interaction.Extent.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
//snap to edge
|
||||
} else if (x !== null) {
|
||||
this.pointerHandler_ = ol.interaction.Extent.getEdgeHandler_(
|
||||
getOpposingPoint([x, extent[1]]),
|
||||
getOpposingPoint([x, extent[3]])
|
||||
getOpposingPoint([x, extent[1]]),
|
||||
getOpposingPoint([x, extent[3]])
|
||||
);
|
||||
} else if (y !== null) {
|
||||
this.pointerHandler_ = ol.interaction.Extent.getEdgeHandler_(
|
||||
getOpposingPoint([extent[0], y]),
|
||||
getOpposingPoint([extent[2], y])
|
||||
getOpposingPoint([extent[0], y]),
|
||||
getOpposingPoint([extent[2], y])
|
||||
);
|
||||
}
|
||||
//no snap - new bbox
|
||||
@@ -337,7 +337,7 @@ ol.interaction.Extent.prototype.snapToVertex_ = function(pixel, map) {
|
||||
this.snappedToVertex_ = dist <= this.pixelTolerance_;
|
||||
if (this.snappedToVertex_) {
|
||||
vertex = squaredDist1 > squaredDist2 ?
|
||||
closestSegment[1] : closestSegment[0];
|
||||
closestSegment[1] : closestSegment[0];
|
||||
}
|
||||
return vertex;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ ol.inherits(ol.interaction.Interaction, ol.Object);
|
||||
*/
|
||||
ol.interaction.Interaction.prototype.getActive = function() {
|
||||
return /** @type {boolean} */ (
|
||||
this.get(ol.interaction.Property.ACTIVE));
|
||||
this.get(ol.interaction.Property.ACTIVE));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ ol.interaction.KeyboardPan = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition !== undefined ?
|
||||
options.condition : this.defaultCondition_;
|
||||
options.condition : this.defaultCondition_;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -61,7 +61,7 @@ ol.interaction.KeyboardPan = function(opt_options) {
|
||||
* @type {number}
|
||||
*/
|
||||
this.pixelDelta_ = options.pixelDelta !== undefined ?
|
||||
options.pixelDelta : 128;
|
||||
options.pixelDelta : 128;
|
||||
|
||||
};
|
||||
ol.inherits(ol.interaction.KeyboardPan, ol.interaction.Interaction);
|
||||
|
||||
@@ -36,7 +36,7 @@ ol.interaction.KeyboardZoom = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ? options.condition :
|
||||
ol.events.condition.targetNotEditable;
|
||||
ol.events.condition.targetNotEditable;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -47,7 +47,7 @@ ol.interaction.Modify = function(options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.primaryAction;
|
||||
options.condition : ol.events.condition.primaryAction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,14 +65,14 @@ ol.interaction.Modify = function(options) {
|
||||
* @private
|
||||
*/
|
||||
this.deleteCondition_ = options.deleteCondition ?
|
||||
options.deleteCondition : this.defaultDeleteCondition_;
|
||||
options.deleteCondition : this.defaultDeleteCondition_;
|
||||
|
||||
/**
|
||||
* @type {ol.EventsConditionType}
|
||||
* @private
|
||||
*/
|
||||
this.insertVertexCondition_ = options.insertVertexCondition ?
|
||||
options.insertVertexCondition : ol.events.condition.always;
|
||||
options.insertVertexCondition : ol.events.condition.always;
|
||||
|
||||
/**
|
||||
* Editing vertex.
|
||||
@@ -120,7 +120,7 @@ ol.interaction.Modify = function(options) {
|
||||
* @private
|
||||
*/
|
||||
this.pixelTolerance_ = options.pixelTolerance !== undefined ?
|
||||
options.pixelTolerance : 10;
|
||||
options.pixelTolerance : 10;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
@@ -153,7 +153,7 @@ ol.interaction.Modify = function(options) {
|
||||
wrapX: !!options.wrapX
|
||||
}),
|
||||
style: options.style ? options.style :
|
||||
ol.interaction.Modify.getDefaultStyleFunction(),
|
||||
ol.interaction.Modify.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -825,7 +825,7 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
this.snappedToVertex_ = dist <= this.pixelTolerance_;
|
||||
if (this.snappedToVertex_) {
|
||||
vertex = squaredDist1 > squaredDist2 ?
|
||||
closestSegment[1] : closestSegment[0];
|
||||
closestSegment[1] : closestSegment[0];
|
||||
}
|
||||
this.createOrUpdateVertexFeature_(vertex);
|
||||
var segment;
|
||||
|
||||
@@ -164,8 +164,8 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
|
||||
|
||||
if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {
|
||||
this.mode_ = Math.abs(delta) < 4 ?
|
||||
ol.interaction.MouseWheelZoom.Mode_.TRACKPAD :
|
||||
ol.interaction.MouseWheelZoom.Mode_.WHEEL;
|
||||
ol.interaction.MouseWheelZoom.Mode_.TRACKPAD :
|
||||
ol.interaction.MouseWheelZoom.Mode_.WHEEL;
|
||||
}
|
||||
|
||||
if (this.mode_ === ol.interaction.MouseWheelZoom.Mode_.TRACKPAD) {
|
||||
|
||||
@@ -28,7 +28,7 @@ ol.interaction.Pointer = function(opt_options) {
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var handleEvent = options.handleEvent ?
|
||||
options.handleEvent : ol.interaction.Pointer.handleEvent;
|
||||
options.handleEvent : ol.interaction.Pointer.handleEvent;
|
||||
|
||||
ol.interaction.Interaction.call(this, {
|
||||
handleEvent: handleEvent
|
||||
@@ -39,28 +39,28 @@ ol.interaction.Pointer = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.handleDownEvent_ = options.handleDownEvent ?
|
||||
options.handleDownEvent : ol.interaction.Pointer.handleDownEvent;
|
||||
options.handleDownEvent : ol.interaction.Pointer.handleDownEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleDragEvent_ = options.handleDragEvent ?
|
||||
options.handleDragEvent : ol.interaction.Pointer.handleDragEvent;
|
||||
options.handleDragEvent : ol.interaction.Pointer.handleDragEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleMoveEvent_ = options.handleMoveEvent ?
|
||||
options.handleMoveEvent : ol.interaction.Pointer.handleMoveEvent;
|
||||
options.handleMoveEvent : ol.interaction.Pointer.handleMoveEvent;
|
||||
|
||||
/**
|
||||
* @type {function(ol.MapBrowserPointerEvent):boolean}
|
||||
* @private
|
||||
*/
|
||||
this.handleUpEvent_ = options.handleUpEvent ?
|
||||
options.handleUpEvent : ol.interaction.Pointer.handleUpEvent;
|
||||
options.handleUpEvent : ol.interaction.Pointer.handleUpEvent;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
@@ -109,7 +109,7 @@ ol.interaction.Pointer.centroid = function(pointerEvents) {
|
||||
ol.interaction.Pointer.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
||||
var type = mapBrowserEvent.type;
|
||||
return (
|
||||
type === ol.MapBrowserEventType.POINTERDOWN ||
|
||||
type === ol.MapBrowserEventType.POINTERDOWN ||
|
||||
type === ol.MapBrowserEventType.POINTERDRAG ||
|
||||
type === ol.MapBrowserEventType.POINTERUP);
|
||||
};
|
||||
|
||||
@@ -46,28 +46,28 @@ ol.interaction.Select = function(opt_options) {
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.singleClick;
|
||||
options.condition : ol.events.condition.singleClick;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.addCondition_ = options.addCondition ?
|
||||
options.addCondition : ol.events.condition.never;
|
||||
options.addCondition : ol.events.condition.never;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.removeCondition_ = options.removeCondition ?
|
||||
options.removeCondition : ol.events.condition.never;
|
||||
options.removeCondition : ol.events.condition.never;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.EventsConditionType}
|
||||
*/
|
||||
this.toggleCondition_ = options.toggleCondition ?
|
||||
options.toggleCondition : ol.events.condition.shiftKeyOnly;
|
||||
options.toggleCondition : ol.events.condition.shiftKeyOnly;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -80,7 +80,7 @@ ol.interaction.Select = function(opt_options) {
|
||||
* @type {ol.SelectFilterFunction}
|
||||
*/
|
||||
this.filter_ = options.filter ? options.filter :
|
||||
ol.functions.TRUE;
|
||||
ol.functions.TRUE;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -95,7 +95,7 @@ ol.interaction.Select = function(opt_options) {
|
||||
wrapX: options.wrapX
|
||||
}),
|
||||
style: options.style ? options.style :
|
||||
ol.interaction.Select.getDefaultStyleFunction(),
|
||||
ol.interaction.Select.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
@@ -217,18 +217,18 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
|
||||
// the pixel.
|
||||
ol.obj.clear(this.featureLayerAssociation_);
|
||||
map.forEachFeatureAtPixel(mapBrowserEvent.pixel,
|
||||
(/**
|
||||
(/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean|undefined} Continue to iterate over the features.
|
||||
*/
|
||||
function(feature, layer) {
|
||||
if (this.filter_(feature, layer)) {
|
||||
selected.push(feature);
|
||||
this.addFeatureLayerAssociation_(feature, layer);
|
||||
return !this.multi_;
|
||||
}
|
||||
}).bind(this), {
|
||||
function(feature, layer) {
|
||||
if (this.filter_(feature, layer)) {
|
||||
selected.push(feature);
|
||||
this.addFeatureLayerAssociation_(feature, layer);
|
||||
return !this.multi_;
|
||||
}
|
||||
}).bind(this), {
|
||||
layerFilter: this.layerFilter_,
|
||||
hitTolerance: this.hitTolerance_
|
||||
});
|
||||
@@ -250,25 +250,25 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
|
||||
} else {
|
||||
// Modify the currently selected feature(s).
|
||||
map.forEachFeatureAtPixel(mapBrowserEvent.pixel,
|
||||
(/**
|
||||
(/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean|undefined} Continue to iterate over the features.
|
||||
*/
|
||||
function(feature, layer) {
|
||||
if (this.filter_(feature, layer)) {
|
||||
if ((add || toggle) &&
|
||||
function(feature, layer) {
|
||||
if (this.filter_(feature, layer)) {
|
||||
if ((add || toggle) &&
|
||||
!ol.array.includes(features.getArray(), feature)) {
|
||||
selected.push(feature);
|
||||
this.addFeatureLayerAssociation_(feature, layer);
|
||||
} else if ((remove || toggle) &&
|
||||
selected.push(feature);
|
||||
this.addFeatureLayerAssociation_(feature, layer);
|
||||
} else if ((remove || toggle) &&
|
||||
ol.array.includes(features.getArray(), feature)) {
|
||||
deselected.push(feature);
|
||||
this.removeFeatureLayerAssociation_(feature);
|
||||
deselected.push(feature);
|
||||
this.removeFeatureLayerAssociation_(feature);
|
||||
}
|
||||
return !this.multi_;
|
||||
}
|
||||
return !this.multi_;
|
||||
}
|
||||
}).bind(this), {
|
||||
}).bind(this), {
|
||||
layerFilter: this.layerFilter_,
|
||||
hitTolerance: this.hitTolerance_
|
||||
});
|
||||
|
||||
@@ -114,7 +114,7 @@ ol.interaction.Snap = function(opt_options) {
|
||||
* @private
|
||||
*/
|
||||
this.pixelTolerance_ = options.pixelTolerance !== undefined ?
|
||||
options.pixelTolerance : 10;
|
||||
options.pixelTolerance : 10;
|
||||
|
||||
/**
|
||||
* @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number}
|
||||
@@ -309,17 +309,17 @@ ol.interaction.Snap.prototype.setMap = function(map) {
|
||||
if (map) {
|
||||
if (this.features_) {
|
||||
keys.push(
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.ADD,
|
||||
this.handleFeatureAdd_, this),
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.REMOVE,
|
||||
this.handleFeatureRemove_, this)
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.ADD,
|
||||
this.handleFeatureAdd_, this),
|
||||
ol.events.listen(this.features_, ol.CollectionEventType.REMOVE,
|
||||
this.handleFeatureRemove_, this)
|
||||
);
|
||||
} else if (this.source_) {
|
||||
keys.push(
|
||||
ol.events.listen(this.source_, ol.source.VectorEventType.ADDFEATURE,
|
||||
this.handleFeatureAdd_, this),
|
||||
ol.events.listen(this.source_, ol.source.VectorEventType.REMOVEFEATURE,
|
||||
this.handleFeatureRemove_, this)
|
||||
ol.events.listen(this.source_, ol.source.VectorEventType.ADDFEATURE,
|
||||
this.handleFeatureAdd_, this),
|
||||
ol.events.listen(this.source_, ol.source.VectorEventType.REMOVEFEATURE,
|
||||
this.handleFeatureRemove_, this)
|
||||
);
|
||||
}
|
||||
features.forEach(this.forEachFeatureAdd_, this);
|
||||
@@ -378,7 +378,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
||||
if (snappedToVertex) {
|
||||
snapped = true;
|
||||
vertex = squaredDist1 > squaredDist2 ?
|
||||
closestSegment[1] : closestSegment[0];
|
||||
closestSegment[1] : closestSegment[0];
|
||||
vertexPixel = map.getPixelFromCoordinate(vertex);
|
||||
}
|
||||
} else if (this.edge_) {
|
||||
@@ -401,7 +401,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
||||
snappedToVertex = dist <= this.pixelTolerance_;
|
||||
if (snappedToVertex) {
|
||||
vertex = squaredDist1 > squaredDist2 ?
|
||||
closestSegment[1] : closestSegment[0];
|
||||
closestSegment[1] : closestSegment[0];
|
||||
vertexPixel = map.getPixelFromCoordinate(vertex);
|
||||
}
|
||||
}
|
||||
@@ -631,5 +631,5 @@ ol.interaction.Snap.sortByDistance = function(a, b) {
|
||||
return ol.coordinate.squaredDistanceToSegment(
|
||||
this.pixelCoordinate_, a.segment) -
|
||||
ol.coordinate.squaredDistanceToSegment(
|
||||
this.pixelCoordinate_, b.segment);
|
||||
this.pixelCoordinate_, b.segment);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user