From 4466dc4331444f93379c08fdf442380ecabdaa17 Mon Sep 17 00:00:00 2001 From: Henry Winkel Date: Thu, 14 Mar 2024 18:35:52 +0100 Subject: [PATCH] ADD: added own ship icon and adaption for cms result --- webapp/public/Own_Ship.svg | 72 +++++++++++++++++++ .../components/perceivedTruth/map/map.jsx | 2 +- .../perceivedTruth/tracklist/tracklist.jsx | 12 +++- .../SimControl/components/OpenSeaMap/icon.jsx | 9 ++- 4 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 webapp/public/Own_Ship.svg diff --git a/webapp/public/Own_Ship.svg b/webapp/public/Own_Ship.svg new file mode 100644 index 0000000..9c23768 --- /dev/null +++ b/webapp/public/Own_Ship.svg @@ -0,0 +1,72 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/webapp/src/components/Debug/components/perceivedTruth/map/map.jsx b/webapp/src/components/Debug/components/perceivedTruth/map/map.jsx index d0a1d16..7eb73e2 100644 --- a/webapp/src/components/Debug/components/perceivedTruth/map/map.jsx +++ b/webapp/src/components/Debug/components/perceivedTruth/map/map.jsx @@ -98,7 +98,7 @@ function MyMap({center,Tracklist}) { var Symbol = { ID: element.ID, Name:element.Name, - Position: [element.Position.PositionGeodesic.lat, element.Position.PositionGeodesic.lon] , + Position: [element.Position[0], element.Position[1]] , IconData: createIcon(element.Type, element.Side), } diff --git a/webapp/src/components/Debug/components/perceivedTruth/tracklist/tracklist.jsx b/webapp/src/components/Debug/components/perceivedTruth/tracklist/tracklist.jsx index 85a9f6b..9ac89af 100644 --- a/webapp/src/components/Debug/components/perceivedTruth/tracklist/tracklist.jsx +++ b/webapp/src/components/Debug/components/perceivedTruth/tracklist/tracklist.jsx @@ -47,11 +47,14 @@ function TrackList(props)
NR
+
ID
Name
Position
Bearing
Range
+
Threat
Sensors
+
Status
{/* {} */} @@ -65,11 +68,16 @@ function TrackList(props)
{index}
+
{elem.ID}
{elem.Name}
-
{round(elem.Position.PositionGeodesic.lat,4)}, {round(elem.Position.PositionGeodesic.lon,4)}
+
{round(elem.Position[0],4)}, {round(elem.Position[1],4)}
{round(elem.Bearing,2)}
{round(elem.Distance,2)}
-
{MakeSensorList(elem) }
+
{elem.Threat}
+
{}
+
{elem.Status}
+ + {/*
{MakeSensorList(elem) }
*/}
) } diff --git a/webapp/src/components/SimControl/components/OpenSeaMap/icon.jsx b/webapp/src/components/SimControl/components/OpenSeaMap/icon.jsx index d0c3265..0a11fc6 100644 --- a/webapp/src/components/SimControl/components/OpenSeaMap/icon.jsx +++ b/webapp/src/components/SimControl/components/OpenSeaMap/icon.jsx @@ -93,4 +93,11 @@ const Hostile = new Icon({ iconAnchor: [hostile.getAnchor().x, hostile.getAnchor().y], }); -export { iconShip, friend,Hostile,createIcon }; \ No newline at end of file + + +var OwnShipIcon = new Icon({ + iconUrl: 'Own_Ship.svg', + iconSize: [50, 50], // size of the icon +}); + +export {OwnShipIcon, iconShip, friend,Hostile,createIcon }; \ No newline at end of file