diff --git a/.github/workflows/step_setup_and_build.yaml b/.github/workflows/step_setup_and_build.yaml index ebc336bd7..8a4988b2c 100644 --- a/.github/workflows/step_setup_and_build.yaml +++ b/.github/workflows/step_setup_and_build.yaml @@ -59,6 +59,7 @@ jobs: HUSKY: 0 # frontend env variables VITE_ENDPOINT: ${{ env.apiSubDomain }} + VITE_TILES_ENDPOINT: ${{ secrets.VITE_TILES_ENDPOINT}} NODE_ENV: ${{ env.nodeEnv }} # backend env variables HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }} diff --git a/apps/antalmanac/src/components/Map/Map.tsx b/apps/antalmanac/src/components/Map/Map.tsx index dd4937bbf..590a5e6f1 100644 --- a/apps/antalmanac/src/components/Map/Map.tsx +++ b/apps/antalmanac/src/components/Map/Map.tsx @@ -14,7 +14,7 @@ import locationIds from '$lib/location_ids'; import buildingCatalogue from '$lib/buildingCatalogue'; import type { Building } from '$lib/buildingCatalogue'; import type { CourseEvent } from '$components/Calendar/CourseCalendarEvent'; -import { MAPBOX_PROXY_TILES_ENDPOINT } from '$lib/api/endpoints'; +import { TILES_URL } from '$lib/api/endpoints'; const ATTRIBUTION_MARKUP = '© OpenStreetMap contributors | Images from UCI Map'; @@ -232,9 +232,10 @@ export default function CourseMap() { diff --git a/apps/antalmanac/src/lib/api/endpoints.ts b/apps/antalmanac/src/lib/api/endpoints.ts index 673b2cae8..2b8e9eb2f 100644 --- a/apps/antalmanac/src/lib/api/endpoints.ts +++ b/apps/antalmanac/src/lib/api/endpoints.ts @@ -14,7 +14,7 @@ function endpointTransform(path: string) { export const LOOKUP_NOTIFICATIONS_ENDPOINT = endpointTransform('/api/notifications/lookupNotifications'); export const REGISTER_NOTIFICATIONS_ENDPOINT = endpointTransform('/api/notifications/registerNotifications'); export const MAPBOX_PROXY_DIRECTIONS_ENDPOINT = endpointTransform('/mapbox/directions'); -export const MAPBOX_PROXY_TILES_ENDPOINT = endpointTransform('/mapbox/tiles'); +export const TILES_URL = import.meta.env.VITE_TILES_ENDPOINT || 'tile.openstreetmap.org'; // PeterPortal API export const PETERPORTAL_GRAPHQL_ENDPOINT = 'https://api-next.peterportal.org/v1/graphql'; diff --git a/apps/antalmanac/src/vite-env.d.ts b/apps/antalmanac/src/vite-env.d.ts index 55092e746..94d018c3c 100644 --- a/apps/antalmanac/src/vite-env.d.ts +++ b/apps/antalmanac/src/vite-env.d.ts @@ -7,6 +7,7 @@ interface ImportMetaEnv { // Both of these variables should rarely be set manually VITE_ENDPOINT?: string; // Sets the subdomain to use for API calls (ex. **staging-123**.api.antalmanac.com) VITE_LOCAL_SERVER?: string; // Sets the local server to use for API calls (e.g. http://localhost:8080) + VITE_TILES_ENDPOINT?: string; // Sets the url of the map tiles server } interface ImportMeta {