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
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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);
+5 -5
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;
+1 -1
View File
@@ -275,7 +275,7 @@ class Select extends Interaction {
* @api
*/
getFeatures() {
return /** @type {VectorSource} */ (this.featureOverlay_.getSource()).getFeaturesCollection();
return this.featureOverlay_.getSource().getFeaturesCollection();
}
/**