diff --git a/afrc/src/afrc/Search/components/InteractiveMap/InteractiveMap.vue b/afrc/src/afrc/Search/components/InteractiveMap/InteractiveMap.vue new file mode 100644 index 0000000..14f4cd5 --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/InteractiveMap.vue @@ -0,0 +1,141 @@ + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/BasemapControls.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/BasemapControls.vue new file mode 100644 index 0000000..af9bd2b --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/BasemapControls.vue @@ -0,0 +1,51 @@ + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/InteractionsDrawer.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/InteractionsDrawer.vue new file mode 100644 index 0000000..4350d5a --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/InteractionsDrawer.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue new file mode 100644 index 0000000..b3ba9cc --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue @@ -0,0 +1,447 @@ + + + + + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/MapFilter.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/MapFilter.vue new file mode 100644 index 0000000..7ad5041 --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/MapFilter.vue @@ -0,0 +1,55 @@ + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/BufferControls.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/BufferControls.vue new file mode 100644 index 0000000..13c8547 --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/BufferControls.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/DrawControls.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/DrawControls.vue new file mode 100644 index 0000000..3a7bf3d --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/DrawControls.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/FeatureUploader.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/FeatureUploader.vue new file mode 100644 index 0000000..cc26a1a --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapFilter/components/FeatureUploader.vue @@ -0,0 +1,81 @@ + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/OverlayControls.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/OverlayControls.vue new file mode 100644 index 0000000..2b057f7 --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/OverlayControls.vue @@ -0,0 +1,35 @@ + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/PopupContainer.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/PopupContainer.vue new file mode 100644 index 0000000..9605d0d --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/PopupContainer.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/components/PopupContent.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/components/PopupContent.vue new file mode 100644 index 0000000..614cfc9 --- /dev/null +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/PopupContainer/components/PopupContent.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/afrc/src/afrc/Search/constants.ts b/afrc/src/afrc/Search/constants.ts new file mode 100644 index 0000000..3bad3a0 --- /dev/null +++ b/afrc/src/afrc/Search/constants.ts @@ -0,0 +1,34 @@ +import type { InjectionKey } from "vue"; + +import type { UserRefAndSetter } from "@/afrc/Search/types.ts"; + +export const ACTIVE_LANGUAGE_DIRECTION = "ACTIVE_LANGUAGE_DIRECTION"; +export const ANONYMOUS = "anonymous"; +export const BUFFER_LAYER_ID = "buffer-layer"; +export const CLICK_EVENT = "click"; +export const DEFAULT_ERROR_TOAST_LIFE = 8000; +export const DIRECT_SELECT = "direct_select"; +export const DRAW_CREATE_EVENT = "draw.create"; +export const DRAW_DELETE_EVENT = "draw.delete"; +export const DRAW_UPDATE_EVENT = "draw.update"; +export const DRAW_SELECTION_CHANGE_EVENT = "draw.selectionchange"; +export const DRAW_LINE_STRING = "draw_line_string"; +export const DRAW_POINT = "draw_point"; +export const DRAW_POLYGON = "draw_polygon"; +export const ERROR = "error"; +export const GEOMETRY_TYPE_LINESTRING = "LineString"; +export const GEOMETRY_TYPE_POINT = "Point"; +export const GEOMETRY_TYPE_POLYGON = "Polygon"; +export const IDLE = "idle"; +export const LEFT = "left"; +export const LINE = "line"; +export const LTR = "ltr"; +export const METERS = "meters"; +export const POINT = "point"; +export const POLYGON = "polygon"; +export const RIGHT = "right"; +export const SIMPLE_SELECT = "simple_select"; +export const STYLE_LOAD_EVENT = "style.load"; +export const TOP_LEFT = "top-left"; +export const TOP_RIGHT = "top-right"; +export const USER_KEY = Symbol() as InjectionKey; diff --git a/afrc/src/afrc/Search/types.ts b/afrc/src/afrc/Search/types.ts index c1d3a03..fddc722 100644 --- a/afrc/src/afrc/Search/types.ts +++ b/afrc/src/afrc/Search/types.ts @@ -1,2 +1,101 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any export type GenericObject = { [key: string]: any }; +import type { Component, Ref } from "vue"; +import type { Feature, FeatureCollection, Geometry, GeoJSON } from "geojson"; +import type { FilterSpecification } from "maplibre-gl"; + +export interface MapInteractionItem { + name: string; + header: string; + component: Component; + icon: string; +} + +export interface DrawEvent { + features: Feature[]; +} + +export interface Basemap { + id: string; + name: string; + value: string; + active: boolean; +} +export interface MapLayer { + activated?: boolean; + addtomap: boolean; + centerx?: number | null; + centery?: number | null; + icon: string; + id: number; + isoverlay: boolean; + ispublic?: boolean; + layer_json?: string; + layerdefinitions: LayerDefinition[]; + legend?: string | null; + maplayerid?: string; + name: string; + searchonly?: boolean; + sortorder?: number; + visible: boolean; + zoom?: number | null; + nodeid?: string; +} + +export interface LayerDefinition { + id: string; + type: string; + source?: string; + "source-layer"?: string; + layout?: Record; + paint?: Record; + filter?: FilterSpecification; + minzoom?: number; + maxzoom?: number; +} + +export interface MapSource { + id: number; + name: string; + source: { + type: string; + url: string; + data?: GeoJSON; + tileSize?: number; + coordinates?: [number, number]; + }; + source_json: string; +} + +export interface Settings { + ACTIVE_LANGUAGE: string; + ACTIVE_LANGUAGE_DIRECTION: string; + ARCGIS_TOKEN: string; +} + +export interface WithinGeometryAndBufferRequestData { + drawnFeatures: FeatureCollection; + bufferedFeatures: FeatureCollection; +} + +export interface BufferRequestData { + features: FeatureCollection; + distance: number; + units: string; +} + +export interface Buffer { + distance: number; + units: string; +} + +export interface User { + first_name: string; + last_name: string; + username: string; +} + +export interface UserRefAndSetter { + user: Ref; + setUser: (userToSet: User | null) => void; +} diff --git a/afrc/src/afrc/declarations.d.ts b/afrc/src/afrc/declarations.d.ts index 6e9a067..952a3ab 100644 --- a/afrc/src/afrc/declarations.d.ts +++ b/afrc/src/afrc/declarations.d.ts @@ -2,3 +2,4 @@ // Module homepage on npmjs.com uses logos "TS" or "DT" to indicate if typed import("@/arches/declarations.d.ts"); +declare module "@mapbox/mapbox-gl-draw";