diff --git a/src/components/AltitudeLimit.vue b/src/components/AltitudeLimit.vue new file mode 100644 index 0000000..ec3c5cc --- /dev/null +++ b/src/components/AltitudeLimit.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/components/flightPlans/FlightPlanMap.vue b/src/components/flightPlans/FlightPlanMap.vue index bf002bd..06fb86b 100644 --- a/src/components/flightPlans/FlightPlanMap.vue +++ b/src/components/flightPlans/FlightPlanMap.vue @@ -2,9 +2,9 @@ import {computed, ref, watch} from "vue"; import {Marker, CustomMarker, Polyline} from "vue3-google-map"; import MapWrapper from "components/map/MapWrapper.vue"; -import AirspaceInfoWindow from "components/map/AirspaceInfoWindow.vue"; import {useFlightPlanObjects, useFlightPlanUtils} from "src/composables/flightPlan"; import {useGeocode} from "src/composables/geocoding"; +import AltitudeLimit from "components/AltitudeLimit.vue"; const props = defineProps({ flightPlan: { @@ -35,24 +35,14 @@ const {center} = useGeocode(); const {markerObject, googleMapsMarkerObject, infoWindowObject, editableNameTypes} = useFlightPlanObjects(); const {getMarkersFrom} = useFlightPlanUtils(); -const infoWindow = ref(infoWindowObject({})); - -const handleMapClick = ({clickCoordinates, airspaces, airport, reportingPoint}) => { - infoWindow.value = infoWindowObject({ - active: true, - position: clickCoordinates, - airspaces, - airport, - reportingPoint, - }) -} +const mapWrap = ref(null); const handleMarkerClick = (marker) => { - infoWindow.value = infoWindowObject({active: true, marker}) + mapWrap.value.openInfoWindow({marker}); } const handlePoiClick = (poi) => { - infoWindow.value = infoWindowObject({active: true, poi}) + mapWrap.value.openInfoWindow({poi}); } const markers = ref([]); @@ -69,10 +59,10 @@ const addMarker = async (point) => { const insertAt = Math.min(markers.value.length, props.insertPosition); markers.value.splice(insertAt, 0, markerObject({...point})); - infoWindow.value = infoWindowObject({active: false}); + // infoWindow.value = infoWindowObject({active: false}); emits("markers-changed", markers.value); - emits("change-insert-position",insertAt + 1); + emits("change-insert-position", insertAt + 1); } const {searchPlaceName} = useGeocode(); @@ -88,6 +78,7 @@ const handleMarkerMove = async (idx, event) => { @@ -24,26 +24,21 @@ import {computed} from "vue"; import {useRoute, useRouter} from "vue-router"; const props = defineProps({ - title: { - type: String, - required: true - }, - - caption: { - type: String, - default: '' - }, - - to: { - type: Object, - required: true - }, - - icon: { - type: String, - default: '' - } - }); + title: { + type: String, + required: true + }, + to: { + type: Object, + required: true + }, + caption: { + type: String, + }, + icon: { + type: String, + } +}); const $route = useRoute(); const $router = useRouter(); @@ -51,7 +46,7 @@ const isButtonActive = computed(() => { const btnResolvedPath = $router.resolve(props.to).path; if (props.to.name === 'myFlights') { - return $route.name.toLowerCase().includes("flight"); + return ["myFlights", "addFlight", "flightDetail", "flightEdit"].includes($route.name); } else { return $route.fullPath === btnResolvedPath || $route.fullPath.startsWith(btnResolvedPath); } diff --git a/src/components/navigation/SidebarNavigation.vue b/src/components/navigation/SidebarNavigation.vue index c0da228..b119ff3 100644 --- a/src/components/navigation/SidebarNavigation.vue +++ b/src/components/navigation/SidebarNavigation.vue @@ -6,9 +6,15 @@ const linksList = [ { title: 'Moje lety', icon: "flight_takeoff", - to: {name: "myFlights"} + to: {name: "myFlights"}, }, - {separator: true}, + { + title: 'Moje plány', + icon: "pin_drop", + to: {name: "flightPlans"} + }, + + {separator: true}, { title: 'Letadla', diff --git a/src/composables/airspaces.js b/src/composables/airspaces.js new file mode 100644 index 0000000..361df04 --- /dev/null +++ b/src/composables/airspaces.js @@ -0,0 +1,20 @@ +export const useAirspaceColors = () => { + const colors = { + TMA: "#800080", + CTR: "#366e36", + PROHIBIT: "#FF0000", + RMZ: "#FFdd00", + RESTRICT: "#ff6a00", + DANGER: "#FFA500", + TRAGA: "#008000", + ATZ: "#4e7cfc", + FIR: '#ffffff', + PARA: "#000000" + } + + const getColorByType = (airspaceType) => { + return colors[airspaceType] || '#ff00ff'; + } + + return {colors, getColorByType} +} diff --git a/src/graphql/queries/airspace.js b/src/graphql/queries/airspace.js index 9e0cae4..246d8df 100644 --- a/src/graphql/queries/airspace.js +++ b/src/graphql/queries/airspace.js @@ -6,6 +6,10 @@ export const AIRSPACE_LIST = gql` airspaces { name type + lowerLimit + lowerAltUnit + upperLimit + upperAltUnit mapBounds { lat diff --git a/src/pages/profile/flightPlanner/FlightPlanEditPage.vue b/src/pages/profile/flightPlanner/FlightPlanEditPage.vue index 5d26c12..e58d614 100644 --- a/src/pages/profile/flightPlanner/FlightPlanEditPage.vue +++ b/src/pages/profile/flightPlanner/FlightPlanEditPage.vue @@ -147,9 +147,9 @@ const fullscreen = ref(false); - - - + + + diff --git a/src/router/routes.js b/src/router/routes.js index 68c7fb4..8b2903b 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -43,11 +43,12 @@ const routes = [ }, children: [ {path: '', name: "myFlights", component: () => import('pages/profile/flight/FlightsPage.vue')}, - {path: 'nastaveni', name: "profile", component: () => import('pages/profile/ProfilePage.vue')}, {path: 'lety/novy', name: "addFlight", component: () => import('pages/profile/flight/NewFlightPage.vue')}, {path: 'lety/:id', name: "flightDetail", component: () => import('pages/profile/flight/FlightDetailPage.vue')}, {path: 'lety/:id/edit/:step?', name: "flightEdit", component: () => import('pages/profile/flight/EditFlightPage.vue')}, + {path: 'nastaveni', name: "profile", component: () => import('pages/profile/ProfilePage.vue')}, + {path: 'plany', name: "flightPlans", component: () => import('pages/profile/flightPlanner/FlightPlansPage.vue')}, {path: 'plany/novy', name: "newFlightPlan", component: () => import('pages/profile/flightPlanner/NewFlightPlanPage.vue')}, {path: 'plany/:id', name: "editFlightPlan", component: () => import('pages/profile/flightPlanner/FlightPlanEditPage.vue')}, @@ -56,10 +57,12 @@ const routes = [ {path: 'poi/novy', name: "addPOI", component: () => import('pages/profile/poi/NewPointOfInterestPage.vue')}, {path: 'poi/:id', name: "poiDetail", component: () => import('pages/profile/poi/PointOfInterestDetailPage.vue')}, {path: 'poi/:id/edit/:step?', name: "poiEdit", component: () => import('pages/profile/poi/EditPointOfInterestPage.vue')}, + {path: 'kopiloti', name: "copilots", component: () => import('pages/profile/copilot/CopilotsPage.vue')}, {path: 'kopiloti/novy', name: "addCopilot", component: () => import('pages/profile/copilot/NewCopilotPage.vue')}, {path: 'kopiloti/:id', name: "copilotDetail", component: () => import('pages/profile/copilot/CopilotDetailPage.vue')}, {path: 'kopiloti/:id/edit/:step?', name: "copilotEdit", component: () => import('pages/profile/copilot/EditCopilotPage.vue')}, + {path: 'letadla', name: "aircrafts", component: () => import('pages/profile/aircraft/AircraftsPage.vue')}, {path: 'letadla/nove', name: "addAircraft", component: () => import('pages/profile/aircraft/NewAircraftsPage.vue')}, {path: 'letadla/:id', name: "aircraftDetail", component: () => import('pages/profile/aircraft/AircraftDetailPage.vue')},