Skip to content

Commit

Permalink
align openlayer types.
Browse files Browse the repository at this point in the history
  • Loading branch information
panaaj committed Dec 7, 2023
1 parent 8f4d462 commit eb98778
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class BearingLineComponent implements OnInit, OnDestroy, OnChanges {
// update feature labels
updateLabel(f?: Feature) {
if (!f && this.source) {
f = this.source.getFeatureById('d.base');
f = (this.source.getFeatureById('d.base') as Feature);
}
const s: StyleLike = f.getStyle();
if (!s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class SKTargetTracksLayerComponent
if (this.tracks.has(w)) {
const target = this.tracks.get(w);
// ** target **
let f = this.source.getFeatureById('track-' + w);
let f = (this.source.getFeatureById('track-' + w) as Feature);
if (f) {
// exists so update it
f.setGeometry(new MultiLineString(this.parseCoordinates(target)));
Expand All @@ -191,7 +191,7 @@ export class SKTargetTracksLayerComponent
return;
}
ids.forEach((w) => {
const f = this.source.getFeatureById('track-' + w);
const f = (this.source.getFeatureById('track-' + w) as Feature);
if (f) {
this.source.removeFeature(f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class SKTargetsLayerComponent implements OnInit, OnDestroy, OnChanges {
if (this.targets.has(w)) {
const target = this.targets.get(w);
// ** target **
let f = this.source.getFeatureById(w);
let f = (this.source.getFeatureById(w) as Feature);
if (f) {
// exists so update it
if (target.position) {
Expand Down Expand Up @@ -221,7 +221,7 @@ export class SKTargetsLayerComponent implements OnInit, OnDestroy, OnChanges {
if (this.targetType && w.indexOf(this.targetType) !== 0) {
return;
}
const f = this.source.getFeatureById(w);
const f = (this.source.getFeatureById(w) as Feature);
if (f) {
this.source.removeFeature(f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class SKVesselsLayerComponent implements OnInit, OnDestroy, OnChanges {
if (this.targets.has(w)) {
const target = this.targets.get(w);
// ** target **
let f = this.source.getFeatureById('ais-' + w);
let f = (this.source.getFeatureById('ais-' + w) as Feature);
if (f) {
// exists so update it
if (this.okToRender(w) && target.position) {
Expand Down Expand Up @@ -287,7 +287,7 @@ export class SKVesselsLayerComponent implements OnInit, OnDestroy, OnChanges {
return;
}

let wf = this.source.getFeatureById('wind-' + id);
let wf = (this.source.getFeatureById('wind-' + id) as Feature);
if (!this.okToRender(id, true) || !target.position) {
if (wf) {
this.source.removeFeature(wf);
Expand Down Expand Up @@ -326,11 +326,11 @@ export class SKVesselsLayerComponent implements OnInit, OnDestroy, OnChanges {
return;
}
ids.forEach((w) => {
let f = this.source.getFeatureById('ais-' + w);
let f = (this.source.getFeatureById('ais-' + w) as Feature);
if (f) {
this.source.removeFeature(f);
}
f = this.source.getFeatureById('wind-' + w);
f = (this.source.getFeatureById('wind-' + w) as Feature);
if (f) {
this.source.removeFeature(f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class VesselTrailComponent implements OnInit, OnDestroy, OnChanges {
this.trailLocal.setStyle(this.buildStyle('local'));
} else {
//update feature
this.trailLocal = this.source.getFeatureById('trail.self.local');
this.trailLocal = (this.source.getFeatureById('trail.self.local') as Feature);
if (this.localTrail && Array.isArray(this.localTrail)) {
const g: Geometry = this.trailLocal.getGeometry();
(g as LineString).setCoordinates(c);
Expand All @@ -160,7 +160,7 @@ export class VesselTrailComponent implements OnInit, OnDestroy, OnChanges {
this.trailServer.setStyle(this.buildStyle('server'));
} else {
//update feature
this.trailServer = this.source.getFeatureById('trail.self.server');
this.trailServer = (this.source.getFeatureById('trail.self.server') as Feature);
if (this.serverTrail && Array.isArray(this.serverTrail)) {
const g: Geometry = this.trailServer.getGeometry();
(g as MultiLineString).setCoordinates(ca);
Expand Down

0 comments on commit eb98778

Please sign in to comment.