From c5e9ae42c8ac889b16bb72bb079d0b0080f03303 Mon Sep 17 00:00:00 2001 From: Sujit Date: Fri, 15 Nov 2024 16:12:13 +0545 Subject: [PATCH] feat: add `COG_URL` --- .env.example | 1 + .../DroneOperatorTask/ModalContent/TaskOrthophotoPreview.tsx | 4 ++-- src/frontend/vite.config.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 0ded43ef..815265be 100644 --- a/.env.example +++ b/.env.example @@ -47,6 +47,7 @@ SITE_NAME=${SITE_NAME:-"DTM-Drone Tasking Manager"} BASE_URL=${BASE_URL:-http://localhost:8000/api} API_URL_V1=${API_URL_V1:-http://localhost:8000/api} NODE_ODM_URL=${NODE_ODM_URL:-http://odm-api:3000} +COG_URL=${COG_URL} ### ODM ### diff --git a/src/frontend/src/components/DroneOperatorTask/ModalContent/TaskOrthophotoPreview.tsx b/src/frontend/src/components/DroneOperatorTask/ModalContent/TaskOrthophotoPreview.tsx index ab48fe26..902068be 100644 --- a/src/frontend/src/components/DroneOperatorTask/ModalContent/TaskOrthophotoPreview.tsx +++ b/src/frontend/src/components/DroneOperatorTask/ModalContent/TaskOrthophotoPreview.tsx @@ -8,7 +8,7 @@ import { LngLatBoundsLike, RasterSourceSpecification } from 'maplibre-gl'; import { useEffect, useMemo } from 'react'; import { useDispatch } from 'react-redux'; -const { S3_ENDPOINT } = process.env; +const { COG_URL } = process.env; const TaskOrthophotoPreview = () => { const dispatch = useDispatch(); @@ -35,7 +35,7 @@ const TaskOrthophotoPreview = () => { const orthophotoSource: RasterSourceSpecification = useMemo( () => ({ type: 'raster', - url: `cog://${S3_ENDPOINT}/dtm-data/projects/${projectId}/${taskId}/orthophoto/odm_orthophoto.tif`, + url: `cog://${COG_URL}/dtm-data/projects/${projectId}/${taskId}/orthophoto/odm_orthophoto.tif`, tileSize: 256, }), diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index 6e3900ca..b96e6fc8 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -46,7 +46,7 @@ export default defineConfig({ API_URL_V1: process.env.API_URL_V1, SITE_NAME: process.env.SITE_NAME, STATIC_BASE_URL: process.env.STATIC_BASE_URL, - S3_ENDPOINT: process.env.S3_ENDPOINT, + COG_URL: process.env.COG_URL, }, }, server: {