Remove unneeded type cast

This commit is contained in:
Frederic Junod
2019-01-28 15:33:57 +01:00
parent 5318d52036
commit 0b53a3229b
10 changed files with 24 additions and 24 deletions

View File

@@ -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;