diff --git a/app/env.template b/app/env.template index 94ed3045..5bd89b8a 100644 --- a/app/env.template +++ b/app/env.template @@ -41,4 +41,6 @@ OAUTH2_REDIRECT_URL=https://localhost/api/auth/cuahsi/callback # VITE_OAUTH2_REDIRECT_URL="${VITE_APP_FULL_URL}#/auth-redirect" VITE_OAUTH2_REDIRECT_URL="https://localhost/#/auth-redirect" -OIDC_BASE_URL=https://auth.cuahsi.org/realms/CUAHSI/protocol/openid-connect/ \ No newline at end of file +OIDC_BASE_URL=https://auth.cuahsi.org/realms/CUAHSI/protocol/openid-connect/ + +VITE_GIS_SERVICES_URL=https://arcgis.cuahsi.org/arcgis/services \ No newline at end of file diff --git a/app/frontend/docker-entrypoint.sh b/app/frontend/docker-entrypoint.sh index 5951b171..3cc1f6df 100755 --- a/app/frontend/docker-entrypoint.sh +++ b/app/frontend/docker-entrypoint.sh @@ -8,6 +8,7 @@ do sed -i 's|VITE_APP_API_URL_PLACEHOLDER|'${VITE_APP_API_URL}'|g' $file sed -i 's|VITE_APP_FULL_URL_PLACEHOLDER|'${VITE_APP_FULL_URL}'|g' $file sed -i 's|VITE_APP_BASE_PLACEHOLDER|'${VITE_APP_BASE}'|g' $file + sed -i 's|VITE_GIS_SERVICES_URL_PLACEHOLDER|'${VITE_GIS_SERVICES_URL}'|g' $file done exec "$@" \ No newline at end of file diff --git a/app/frontend/src/components/TheLeafletMap.vue b/app/frontend/src/components/TheLeafletMap.vue index 8d47e9bc..17b824a1 100644 --- a/app/frontend/src/components/TheLeafletMap.vue +++ b/app/frontend/src/components/TheLeafletMap.vue @@ -11,6 +11,7 @@ import { onMounted, onUpdated } from 'vue' import { useMapStore } from '@/stores/map' import { useModelsStore } from '@/stores/models' import { useAlertStore } from '@/stores/alerts' +import { GIS_SERVICES_URL } from '@/constants' const mapStore = useMapStore() const modelsStore = useModelsStore(); @@ -91,7 +92,7 @@ onMounted(() => { }).addTo(map); // WMS LAYER - let url = 'http://arcgis.cuahsi.org/arcgis/services/US_WBD/HUC_WBD/MapServer/WmsServer?' + let url = `${GIS_SERVICES_URL}/US_WBD/HUC_WBD/MapServer/WmsServer?` // HUC WMS Naming // -------------- @@ -139,7 +140,7 @@ onMounted(() => { }).addTo(map); // add USGS gage layer to map - url = 'http://arcgis.cuahsi.org/arcgis/services/NHD/usgs_gages/MapServer/WmsServer?'; + url = `${GIS_SERVICES_URL}/NHD/usgs_gages/MapServer/WmsServer?`; let gages = L.tileLayer.wms(url, { layers: 0, transparent: 'true', @@ -423,7 +424,7 @@ async function getGageInfo(e) { SrsName: 'EPSG:4326', outputFormat: 'ESRIGEOJSON' }; - let root = 'https://arcgis.cuahsi.org/arcgis/services/NHD/usgs_gages/MapServer/WFSServer'; + let root = `${GIS_SERVICES_URL}/NHD/usgs_gages/MapServer/WFSServer`; let parameters = L.Util.extend(defaultParameters); let gageURL = root + L.Util.getParamString(parameters); @@ -502,7 +503,7 @@ async function mapClick(e) { typeName: 'HUC_WBD:HUC12_US', SrsName: 'EPSG:4326' }; - let root = 'https://arcgis.cuahsi.org/arcgis/services/US_WBD/HUC_WBD/MapServer/WFSServer'; + let root = `${GIS_SERVICES_URL}/US_WBD/HUC_WBD/MapServer/WFSServer`; let parameters = L.Util.extend(defaultParameters); let URL = root + L.Util.getParamString(parameters); @@ -570,7 +571,7 @@ function traceUpstream(usgs_gage) { typeName: 'HUC_WBD:HUC12_US', SrsName: 'EPSG:4326' }; - let root = 'https://arcgis.cuahsi.org/arcgis/services/US_WBD/HUC_WBD/MapServer/WFSServer'; + let root = `${GIS_SERVICES_URL}/US_WBD/HUC_WBD/MapServer/WFSServer`; let parameters = L.Util.extend(defaultParameters); let URL = root + L.Util.getParamString(parameters); @@ -810,7 +811,7 @@ function addFeatureByHUC(hucid) { SrsName: 'EPSG:4326', Filter: filter }; - let root = 'https://arcgis.cuahsi.org/arcgis/services/US_WBD/HUC_WBD/MapServer/WFSServer'; + let root = `${GIS_SERVICES_URL}/US_WBD/HUC_WBD/MapServer/WFSServer`; let parameters = L.Util.extend(defaultParameters); let URL = root + L.Util.getParamString(parameters); diff --git a/app/frontend/src/constants.js b/app/frontend/src/constants.js index bb370123..2c3a83d4 100644 --- a/app/frontend/src/constants.js +++ b/app/frontend/src/constants.js @@ -3,6 +3,8 @@ export const APP_BASE = import.meta.env.VITE_APP_BASE || "VITE_APP_BASE_PLACEHOL let APP_URL_IN = import.meta.env.VITE_APP_FULL_URL || "VITE_APP_FULL_URL_PLACEHOLDER"; export const APP_URL = APP_URL_IN.endsWith("/") ? APP_URL_IN : `${APP_URL_IN}/` +export const GIS_SERVICES_URL = import.meta.env.VITE_GIS_SERVICES_URL || "VITE_GIS_SERVICES_URL_PLACEHOLDER"; + export const API_BASE = import.meta.env.VITE_APP_API_URL || "VITE_APP_API_URL_PLACEHOLDER"; export const ENDPOINTS = { openapi: `${API_BASE}/openapi.json`,