Skip to content

Commit

Permalink
Update COT Calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Feb 19, 2025
1 parent 9bfa54d commit c475aa0
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions api/web/src/components/CloudTAK/CoTView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -703,14 +703,14 @@ const videoStore = useVideoStore();
const route = useRoute();
const router = useRouter();
const cot = ref<COT | undefined>(mapWorkerStore.get(String(route.params.uid), {
const cot = ref<COT | undefined>(mapWorkerStore.worker.get(String(route.params.uid), {
mission: true
}))
const mission = ref<Mission | undefined>();
if (cot.value && cot.value.origin.mode === OriginMode.MISSION && cot.value.origin.mode_id) {
mission.value = mapWorkerStore.subscriptions.get(cot.value.origin.mode_id);
mission.value = mapWorkerStore.worker.subscriptions.get(cot.value.origin.mode_id);
}
const username = ref<string | undefined>();
Expand All @@ -722,7 +722,7 @@ const time = ref('relative');
watch(cot, () => {
if (cot.value) {
if (cot.value.origin.mode === OriginMode.MISSION && cot.value.origin.mode_id) {
mission.value = mapWorkerStore.subscriptions.get(cot.value.origin.mode_id);
mission.value = mapWorkerStore.worker.subscriptions.get(cot.value.origin.mode_id);
} else {
mission.value = undefined;
}
Expand Down Expand Up @@ -766,7 +766,7 @@ const center = computed(() => {
async function load_cot() {
username.value = undefined;
cot.value = mapWorkerStore.get(String(route.params.uid), {
cot.value = mapWorkerStore.worker.get(String(route.params.uid), {
mission: true
})
Expand Down
6 changes: 3 additions & 3 deletions api/web/src/components/CloudTAK/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ function editGeometry(featid: string) {
}
});
cotStore.hidden.add(cot.id);
mapWorkerStore.worker.hidden.add(cot.id);
updateCOT();
// @ts-expect-error Cast Feature to GeoJSONStoreFeature
Expand All @@ -852,7 +852,7 @@ function editGeometry(featid: string) {
mapStore.draw.selectFeature(cot.id);
} catch (err) {
cotStore.hidden.delete(cot.id);
mapWorkerStore.worker.hidden.delete(cot.id);
mapStore.draw.setMode('static');
updateCOT();
mapStore.drawOptions.mode = 'static';
Expand All @@ -878,7 +878,7 @@ async function updateCOT() {
if (locked.value.length && await mapWorkerStore.worker.has(locked.value[locked.value.length - 1])) {
let featid = locked.value[locked.value.length - 1];
if (featid) {
const feat = mapWorkerStore.get(featid);
const feat = mapWorkerStore.worker.get(featid);
if (feat && feat.geometry.type === "Point") {
const flyTo = {
center: feat.properties.center as LngLatLike,
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/components/CloudTAK/RadialMenu/RadialMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default {
this.menuItems.splice(0, this.menuItems.length);
if (this.radial.mode === 'cot') {
if (this.radial.cot && this.radial.cot.properties) {
const cot = cotStore.get(this.radial.cot.properties.id, {
const cot = mapWorkerStore.worker.get(this.radial.cot.properties.id, {
mission: true
});
Expand All @@ -189,7 +189,7 @@ export default {
this.menuItems.push({ id: 'lock', icon: '#radial-lock' })
}
} else if (cot.origin.mode === OriginMode.MISSION && cot.origin.mode_id) {
const sub = cotStore.subscriptions.get(cot.origin.mode_id);
const sub = mapWorkerStore.worker.subscriptions.get(cot.origin.mode_id);
if (sub.role && sub.role.permissions.includes("MISSION_WRITE")) {
this.menuItems.push({ id: 'edit', icon: '#radial-pencil' })
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/components/CloudTAK/util/Feature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const props = defineProps({
const emit = defineEmits(['delete']);
const isZoomable = computed(() => {
const cot = mapWorkerStore.get(props.feature.id, {
const cot = mapWorkerStore.worker.get(props.feature.id, {
mission: true
})
Expand Down Expand Up @@ -186,7 +186,7 @@ async function deleteCOT() {
async function flyTo() {
if (!isZoomable.value) return;
const cot = mapWorkerStore.get(props.feature.id, {
const cot = mapWorkerStore.worker.get(props.feature.id, {
mission: true
});
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/CloudTAK/util/Share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function currentFeats(): Feature[] {
// FileShare is manually generated and won't exist in CoT Store
return f;
} else {
const cot = mapWorkerStore.get(f.id)
const cot = mapWorkerStore.worker.get(f.id)
if (cot) {
return cot.as_feature();
} else {
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/components/CloudTAK/util/ShareToMission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ import Subscription from '../../../stores/base/mission.ts'
const mapWorkerStore = useMapWorkerStore();
const missions = computed(() => {
return Array.from(mapWorkerStore.subscriptions.values())
return Array.from(mapWorkerStore.worker.subscriptions.values())
.filter((mission) => {
return mission.role.permissions.includes("MISSION_WRITE")
})
Expand Down Expand Up @@ -150,7 +150,7 @@ function currentFeats(): Array<Feature> {
// FileShare is manually generated and won't exist in CoT Store
return f;
} else {
return mapWorkerStore.get(f.id);
return mapWorkerStore.worker.get(f.id);
}
}).filter((f) => {
return !!f;
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/CloudTAK/util/ShareToPackage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function currentFeats(): Array<Feature> {
// FileShare is manually generated and won't exist in CoT Store
return f;
} else {
return mapWorkerStore.get(f.id) || f;
return mapWorkerStore.worker.get(f.id) || f;
}
}).filter((f) => {
return !!f;
Expand Down
4 changes: 2 additions & 2 deletions api/web/src/stores/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const useMapStore = defineStore('cloudtak', {
// MultiSelect Mode
if (e.originalEvent.ctrlKey && features.length) {
const mapWorkerStore = useMapWorkerStore();
const cot = mapWorkerStore.get(features[0].properties.id, {
const cot = mapWorkerStore.worker.get(features[0].properties.id, {
mission: true
});

Expand Down Expand Up @@ -460,7 +460,7 @@ export const useMapStore = defineStore('cloudtak', {
coord: Position
} | undefined = undefined;

mapWorkerStore.filter((cot) => {
mapWorkerStore.worker.filter((cot) => {
coordEach(cot.geometry, (coord: Position) => {
const dist = distance([event.lng, event.lat], coord);

Expand Down
2 changes: 1 addition & 1 deletion api/web/src/stores/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const useVideoStore = defineStore('video', {
})
},
add(uid: string): void {
const cot = mapWorkerStore.get(uid, {
const cot = mapWorkerStore.worker.get(uid, {
mission: true
});

Expand Down
2 changes: 1 addition & 1 deletion api/web/src/workers/atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function connect(connection: string) {
};

if (body.type === 'Error') {
const err = body.data as {
const err = body as {
properties: { message: string }
};

Expand Down

0 comments on commit c475aa0

Please sign in to comment.