embed mission-planner

This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-06 05:51:31 +03:00
parent 667c9f8153
commit 2f9c4efc8e
68 changed files with 4340 additions and 1 deletions
+154
View File
@@ -0,0 +1,154 @@
import type L from 'leaflet';
export interface LatLngPosition {
lat: number;
lng: number;
}
export interface FlightPoint {
id: string;
position: LatLngPosition;
altitude: number;
meta: string[];
}
export interface CalculatedPointInfo {
bat: number;
time: number;
}
export interface MapRectangle {
layer?: L.Layer;
color: string;
bounds: L.LatLngBounds | L.LatLngBoundsLiteral;
id?: string;
}
export interface ThrustWattEntry {
thrust: number;
watts: number;
}
export interface AircraftParams {
type: string;
downang: number;
upang: number;
weight: number;
speed: number;
frontalArea: number;
dragCoefficient: number;
batteryCapacity: number;
thrustWatts: ThrustWattEntry[];
propellerEfficiency: number;
}
export interface WeatherData {
windSpeed: number;
windAngle: number;
}
export interface Purpose {
value: string;
label: string;
}
export interface Language {
code: string;
flag: string;
}
export interface MovingPointInfo {
x: number;
y: number;
latlng: L.LatLng;
}
export const ActionMode = {
points: 'points',
workArea: 'workArea',
prohibitedArea: 'prohibitedArea',
} as const;
export type ActionModeValue = (typeof ActionMode)[keyof typeof ActionMode];
export const MapType = {
classic: 'classic',
satellite: 'satellite',
} as const;
export type MapTypeValue = (typeof MapType)[keyof typeof MapType];
export interface FlightStatusTranslations {
good: string;
caution: string;
low: string;
}
export interface OptionsTranslations {
artillery: string;
tank: string;
[key: string]: string;
}
export interface TranslationStrings {
language: string;
aircraft: string;
label: string;
point: string;
height: string;
edit: string;
currentPos: string;
return: string;
addPoints: string;
workArea: string;
prohibitedArea: string;
location: string;
currentLocation: string;
exportData: string;
exportPlaneData: string;
exportMapData: string;
editAsJson: string;
importFromJson: string;
export: string;
import: string;
operations: string;
rectangleColor: string;
red: string;
green: string;
initialAltitude: string;
setAltitude: string;
setPoint: string;
removePoint: string;
windSpeed: string;
windDirection: string;
setWind: string;
title: string;
distanceLabel: string;
fuelRequiredLabel: string;
maxFuelLabel: string;
flightStatus: FlightStatusTranslations;
calc: string;
error: string;
km: string;
metres: string;
litres: string;
hour: string;
minutes: string;
battery: string;
titleAdd: string;
titleEdit: string;
description: string;
latitude: string;
longitude: string;
altitude: string;
purpose: string;
cancel: string;
submitAdd: string;
submitEdit: string;
options: OptionsTranslations;
invalid: string;
editm: string;
save: string;
}
export type TranslationsMap = Record<string, TranslationStrings>;
@@ -0,0 +1,38 @@
import * as L from 'leaflet';
declare module 'leaflet' {
function polylineDecorator(
paths: L.Polyline | L.Polygon | L.LatLngExpression[] | L.LatLngExpression[][],
options?: {
patterns: Array<{
offset?: string | number;
endOffset?: string | number;
repeat?: string | number;
symbol: L.Symbol.ArrowHead | L.Symbol.Marker | L.Symbol.Dash;
}>;
}
): L.FeatureGroup;
namespace Symbol {
function arrowHead(options?: {
pixelSize?: number;
polygon?: boolean;
pathOptions?: L.PathOptions;
headAngle?: number;
}): ArrowHead;
function marker(options?: {
rotate?: boolean;
markerOptions?: L.MarkerOptions;
}): Marker;
function dash(options?: {
pixelSize?: number;
pathOptions?: L.PathOptions;
}): Dash;
interface ArrowHead {}
interface Marker {}
interface Dash {}
}
}
+13
View File
@@ -0,0 +1,13 @@
declare module 'react-world-flags' {
import type { FC, HTMLAttributes } from 'react';
interface FlagProps extends HTMLAttributes<HTMLImageElement> {
code: string;
fallback?: React.ReactNode;
height?: string | number;
width?: string | number;
}
const Flag: FC<FlagProps>;
export default Flag;
}