Remove unneeded type cast
This commit is contained in:
@@ -891,7 +891,7 @@ class Draw extends PointerInteraction {
|
||||
this.sketchFeature_ = null;
|
||||
this.sketchPoint_ = null;
|
||||
this.sketchLine_ = null;
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).clear(true);
|
||||
this.overlay_.getSource().clear(true);
|
||||
}
|
||||
return sketchFeature;
|
||||
}
|
||||
@@ -930,7 +930,7 @@ class Draw extends PointerInteraction {
|
||||
if (this.sketchPoint_) {
|
||||
sketchFeatures.push(this.sketchPoint_);
|
||||
}
|
||||
const overlaySource = /** @type {VectorSource} */ (this.overlay_.getSource());
|
||||
const overlaySource = this.overlay_.getSource();
|
||||
overlaySource.clear(true);
|
||||
overlaySource.addFeatures(sketchFeatures);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
extentFeature = new Feature(polygonFromExtent(extent));
|
||||
}
|
||||
this.extentFeature_ = extentFeature;
|
||||
/** @type {VectorSource} */ (this.extentOverlay_.getSource()).addFeature(extentFeature);
|
||||
this.extentOverlay_.getSource().addFeature(extentFeature);
|
||||
} else {
|
||||
if (!extent) {
|
||||
extentFeature.setGeometry(undefined);
|
||||
@@ -263,7 +263,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
if (!vertexFeature) {
|
||||
vertexFeature = new Feature(new Point(vertex));
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
/** @type {VectorSource} */ (this.vertexOverlay_.getSource()).addFeature(vertexFeature);
|
||||
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {Point} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(vertex);
|
||||
|
||||
@@ -368,7 +368,7 @@ class Modify extends PointerInteraction {
|
||||
// Remove the vertex feature if the collection of canditate features
|
||||
// is empty.
|
||||
if (this.vertexFeature_ && this.features_.getLength() === 0) {
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).removeFeature(this.vertexFeature_);
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
unlisten(feature, EventType.CHANGE,
|
||||
@@ -407,7 +407,7 @@ class Modify extends PointerInteraction {
|
||||
*/
|
||||
setActive(active) {
|
||||
if (this.vertexFeature_ && !active) {
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).removeFeature(this.vertexFeature_);
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
super.setActive(active);
|
||||
@@ -658,7 +658,7 @@ class Modify extends PointerInteraction {
|
||||
if (!vertexFeature) {
|
||||
vertexFeature = new Feature(new Point(coordinates));
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).addFeature(vertexFeature);
|
||||
this.overlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {Point} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(coordinates);
|
||||
@@ -944,7 +944,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
}
|
||||
if (this.vertexFeature_) {
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).removeFeature(this.vertexFeature_);
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
}
|
||||
@@ -1139,7 +1139,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
this.updateSegmentIndices_(geometry, index, segmentData.depth, -1);
|
||||
if (this.vertexFeature_) {
|
||||
/** @type {VectorSource} */ (this.overlay_.getSource()).removeFeature(this.vertexFeature_);
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
dragSegments.length = 0;
|
||||
|
||||
@@ -275,7 +275,7 @@ class Select extends Interaction {
|
||||
* @api
|
||||
*/
|
||||
getFeatures() {
|
||||
return /** @type {VectorSource} */ (this.featureOverlay_.getSource()).getFeaturesCollection();
|
||||
return this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user