Skip to content

Commit

Permalink
Fix last VMS position not showed on map
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Mar 9, 2021
1 parent 9303ea8 commit dcd85aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31778,3 +31778,6 @@ INSERT INTO POSITIONS (INTERNAL_REFERENCE_NUMBER, EXTERNAL_REFERENCE_NUMBER, MMS
('GBR000B14430','AR865',null,'MVGM5','CABO ORTEGAL','GB','FR','DE',null,46.815,-8.418,9.5,12,'2021-01-14 23:52:00','VMS'),
('GBR000B14430','AR865',null,'MVGM5','CABO ORTEGAL','GB','FR','DE',null,47.348,-8.219,7.5,11,'2021-01-15 03:32:00','VMS'),
('GBR000B14430','AR865',null,'MVGM5','CABO ORTEGAL','GB','FR','DE',null,47.64,-8.117,8.6,17,'2021-01-15 05:32:00','VMS');

-- Do not forget that this line is added upper in this script :
-- GBR000B14430 AR865 \N MVGM5 CABO ORTEGAL GB FR DE \N 47.921999999999997 -8.0129999999999999 8.40000000000000036 14 2021-01-15 07:32:00 VMS
6 changes: 1 addition & 5 deletions frontend/src/domain/use_cases/showVesselTrackAndSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ function buildVesselTrackVector(vessel) {

function buildCirclePoints(vesselTrackLines, positions) {
return vesselTrackLines.map((feature, index) => {
if (index === vesselTrackLines.length - 1) {
return
}

let firstPointCoordinatesOfLine = feature.getGeometry().getCoordinates()[0];
let positionsOnLine = positions.filter(position => {
let point = new transform([position.longitude, position.latitude], WSG84_PROJECTION, OPENLAYERS_PROJECTION)
Expand All @@ -103,7 +99,7 @@ function buildCirclePoints(vesselTrackLines, positions) {
}

const circleFeature = new Feature({
geometry: new Point(feature.getGeometry().getCoordinates()[1]),
geometry: new Point(feature.getGeometry().getCoordinates()[0]),
name: LayersEnum.VESSEL_TRACK + ':position:' + index,
course: firstPositionOnLine ? firstPositionOnLine.course : null,
positionType: firstPositionOnLine ? firstPositionOnLine.positionType : null,
Expand Down

0 comments on commit dcd85aa

Please sign in to comment.