@tak-ps/cloudtak 13.26.1 → 13.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/src/base/cot.d.ts +6 -0
- package/dist/types/src/components/CloudTAK/Navigating.vue.d.ts +3 -0
- package/dist/types/src/components/CloudTAK/util/GenericSelect.vue.d.ts +1 -1
- package/dist/types/src/lib/routing/main.d.ts +54 -0
- package/dist/types/src/stores/map.d.ts +15 -0
- package/package.json +1 -1
|
@@ -54,12 +54,18 @@ export default class COT {
|
|
|
54
54
|
save(): Promise<void>;
|
|
55
55
|
get is_skittle(): boolean;
|
|
56
56
|
get is_self(): boolean;
|
|
57
|
+
get is_route(): boolean;
|
|
57
58
|
get is_archivable(): boolean;
|
|
58
59
|
/**
|
|
59
60
|
* Determines if the COT type allows editing
|
|
60
61
|
* But does not determine if a COT is part of a Misison Sync, if the mission allows editing
|
|
61
62
|
*/
|
|
62
63
|
get is_editable(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Convert this LineString feature into a TAK Route (`b-m-r`).
|
|
66
|
+
* Throws if the geometry is not a LineString or the feature is already a route.
|
|
67
|
+
*/
|
|
68
|
+
toRoute(): Promise<void>;
|
|
63
69
|
subscription(): Promise<Subscription>;
|
|
64
70
|
username(): Promise<string>;
|
|
65
71
|
/**
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -24,7 +24,7 @@ declare const __VLS_export: <T extends SelectableItem>(__VLS_props: NonNullable<
|
|
|
24
24
|
};
|
|
25
25
|
emit: {};
|
|
26
26
|
}>) => import("vue").VNode & {
|
|
27
|
-
__ctx?: Awaited<typeof __VLS_setup
|
|
27
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
28
28
|
};
|
|
29
29
|
declare const _default: typeof __VLS_export;
|
|
30
30
|
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Map as MapLibreMap, IControl, ControlPosition } from 'maplibre-gl';
|
|
2
|
+
import type { Feature, LineString, Position } from 'geojson';
|
|
3
|
+
export type NavigationDirection = 'forward' | 'reverse';
|
|
4
|
+
export interface NavigationState {
|
|
5
|
+
/** Distance remaining along the route to the destination, in kilometers. */
|
|
6
|
+
remaining: number;
|
|
7
|
+
/** Distance from the user to the nearest point on the route, in kilometers. */
|
|
8
|
+
offRoute: number;
|
|
9
|
+
/** Total length of the route, in kilometers. */
|
|
10
|
+
total: number;
|
|
11
|
+
/** The point on the route nearest the user (`[lng, lat]`). */
|
|
12
|
+
snapped: Position;
|
|
13
|
+
/** The destination coordinate the user is navigating towards (`[lng, lat]`). */
|
|
14
|
+
destination: Position;
|
|
15
|
+
/** Which end of the route is the destination. */
|
|
16
|
+
direction: NavigationDirection;
|
|
17
|
+
}
|
|
18
|
+
export type RoutingControlOptions = {
|
|
19
|
+
onUpdate?: (state: NavigationState | null) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare class RoutingControl implements IControl {
|
|
22
|
+
private readonly options;
|
|
23
|
+
private map?;
|
|
24
|
+
private container?;
|
|
25
|
+
private route;
|
|
26
|
+
private location;
|
|
27
|
+
private direction;
|
|
28
|
+
private state;
|
|
29
|
+
private remainingLine;
|
|
30
|
+
private connectorLine;
|
|
31
|
+
private destinationPoint;
|
|
32
|
+
private snappedPoint;
|
|
33
|
+
constructor(options?: RoutingControlOptions);
|
|
34
|
+
onAdd(map: MapLibreMap): HTMLElement;
|
|
35
|
+
onRemove(): void;
|
|
36
|
+
getDefaultPosition(): ControlPosition;
|
|
37
|
+
get active(): boolean;
|
|
38
|
+
setRoute(route: Feature<LineString> | null): void;
|
|
39
|
+
setLocation(location: {
|
|
40
|
+
lng: number;
|
|
41
|
+
lat: number;
|
|
42
|
+
} | null): void;
|
|
43
|
+
setDirection(direction: NavigationDirection): void;
|
|
44
|
+
reverse(): void;
|
|
45
|
+
getDirection(): NavigationDirection;
|
|
46
|
+
getState(): NavigationState | null;
|
|
47
|
+
private recompute;
|
|
48
|
+
private buildCollection;
|
|
49
|
+
private updateSource;
|
|
50
|
+
private ensureLayers;
|
|
51
|
+
private teardownLayers;
|
|
52
|
+
private onStyleData;
|
|
53
|
+
}
|
|
54
|
+
export default RoutingControl;
|
|
@@ -4,6 +4,8 @@ import MenuManager from './modules/menu.ts';
|
|
|
4
4
|
import BottomBarManager from './modules/bottombar.ts';
|
|
5
5
|
import * as Comlink from 'comlink';
|
|
6
6
|
import COT from '../base/cot.ts';
|
|
7
|
+
import RoutingControl from '../lib/routing/main.ts';
|
|
8
|
+
import type { NavigationState, NavigationDirection } from '../lib/routing/main.ts';
|
|
7
9
|
import { LocationState } from '../base/events.ts';
|
|
8
10
|
import Subscription from '../base/subscription.ts';
|
|
9
11
|
import * as mapgl from 'maplibre-gl';
|
|
@@ -39,6 +41,14 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
|
|
|
39
41
|
lat: number;
|
|
40
42
|
lng: number;
|
|
41
43
|
} | null;
|
|
44
|
+
gpsSpeed: number | null;
|
|
45
|
+
navigation: {
|
|
46
|
+
active: boolean;
|
|
47
|
+
cotId: string | null;
|
|
48
|
+
callsign: string | null;
|
|
49
|
+
direction: NavigationDirection;
|
|
50
|
+
state: NavigationState | null;
|
|
51
|
+
};
|
|
42
52
|
distanceUnit: string;
|
|
43
53
|
coordFormat: string;
|
|
44
54
|
defaultPointType: string;
|
|
@@ -90,6 +100,11 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
|
|
|
90
100
|
}, {
|
|
91
101
|
startLocationWatch: () => Promise<void>;
|
|
92
102
|
syncGeolocateControl: () => void;
|
|
103
|
+
routingControl: () => RoutingControl | undefined;
|
|
104
|
+
syncRoutingControl: () => void;
|
|
105
|
+
startNavigation: (cotId: string) => Promise<void>;
|
|
106
|
+
stopNavigation: () => void;
|
|
107
|
+
reverseNavigation: () => void;
|
|
93
108
|
openSelfFeature: () => Promise<void>;
|
|
94
109
|
startWorker: () => void;
|
|
95
110
|
destroy: () => Promise<void>;
|