Vicemene funkcni mapova cast planovace

This commit is contained in:
Michal Kváček
2024-04-29 06:45:29 +02:00
parent bc0b5e2f15
commit 0760e6fb1c
9 changed files with 111 additions and 70 deletions
+11 -5
View File
@@ -52,7 +52,7 @@ export const useFlightPlanObjects = () => {
}
}
const infoWindowObject = ({active, position, marker, poi, airport, airspaces}) => {
const infoWindowObject = ({active, position, marker, poi, airport, reportingPoint, airspaces}) => {
if (!position) position = {};
if (!position.lat) position.lat = 0;
if (!position.lng) position.lng = 0;
@@ -60,9 +60,15 @@ export const useFlightPlanObjects = () => {
let title = null;
if (airport) {
title = `${airport.icaoCode} (${airport.name})`;
position.lat = airport.gpsLatitude;
position.lng = airport.gpsLongitude;
if (!reportingPoint) {
title = `${airport.icaoCode} (${airport.name})`;
position.lat = airport.gpsLatitude;
position.lng = airport.gpsLongitude;
} else {
title = `${airport.icaoCode}:${reportingPoint.name}`
position.lat = reportingPoint.gpsLatitude;
position.lng = reportingPoint.gpsLongitude;
}
}
if (marker) {
@@ -77,7 +83,7 @@ export const useFlightPlanObjects = () => {
position.lng = poi.gpsLongitude;
}
return {title, active, position, airspaces, poi, marker, airport};
return {title, active, position, airspaces, poi, marker, airport, reportingPoint};
};
return {markerObject, googleMapsMarkerObject, googleMapsCustomMarkerObject, infoWindowObject, editableNameTypes}