Skip to content

Commit

Permalink
Merge pull request #455 from dfpc-coe/globe
Browse files Browse the repository at this point in the history
Globe View
  • Loading branch information
ingalls authored Dec 20, 2024
2 parents 1482b6e + 1c29b42 commit cf7d858
Show file tree
Hide file tree
Showing 14 changed files with 3,513 additions and 1,312 deletions.
5 changes: 5 additions & 0 deletions api/lib/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export class toEnum {
}
}

export enum Profile_Projection {
MERCATOR = 'mercator',
GLOBE = 'globe',
}

export enum Basemap_Format {
PNG = 'png',
JPEG = 'jpeg',
Expand Down
3 changes: 2 additions & 1 deletion api/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TAKGroup, TAKRole } from './api/types.js';
import { Layer_Config } from './models/Layer.js';
import {
Layer_Priority,
Profile_Stale, Profile_Speed, Profile_Elevation, Profile_Distance, Profile_Text,
Profile_Stale, Profile_Speed, Profile_Elevation, Profile_Distance, Profile_Text, Profile_Projection,
Basemap_Type, Basemap_Format, Basemap_Style,
} from './enums.js';
import { json, boolean, uuid, numeric, integer, timestamp, pgTable, serial, varchar, text, unique, index } from 'drizzle-orm/pg-core';
Expand Down Expand Up @@ -42,6 +42,7 @@ export const Profile = pgTable('profile', {
display_distance: text().$type<Profile_Distance>().notNull().default(Profile_Distance.MILE),
display_elevation: text().$type<Profile_Elevation>().notNull().default(Profile_Elevation.FEET),
display_speed: text().$type<Profile_Speed>().notNull().default(Profile_Speed.MPH),
display_projection: text().$type<Profile_Projection>().notNull().default(Profile_Projection.GLOBE),
display_text: text().$type<Profile_Text>().notNull().default(Profile_Text.Medium),
system_admin: boolean().notNull().default(false),
agency_admin: json().notNull().$type<Array<number>>().default([])
Expand Down
2 changes: 2 additions & 0 deletions api/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createSelectSchema } from 'drizzle-typebox';
import { Type } from '@sinclair/typebox'
import * as schemas from './schema.js';
import { TAKGroup, TAKRole } from './api/types.js';
import { Profile_Projection } from './enums.js';
import { AugmentedData } from './models/Data.js';
import { AugmentedLayer } from './models/Layer.js';
import { Feature } from '@tak-ps/node-cot';
Expand Down Expand Up @@ -73,6 +74,7 @@ export const ProfileResponse = Type.Object({
coordinates: Type.Array(Type.Number())
}), Type.Null()]),
tak_loc_freq: Type.Integer(),
display_projection: Type.Enum(Profile_Projection),
display_stale: Type.String(),
display_text: Type.String(),
display_distance: Type.String(),
Expand Down
1 change: 1 addition & 0 deletions api/migrations/0076_messy_swordsman.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "profile" ADD COLUMN "display_projection" text DEFAULT 'globe' NOT NULL;
Loading

0 comments on commit cf7d858

Please sign in to comment.