Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[web][photos] Remove Stadia Maps proxy worker and update TripLayout

anandbaburajan876215680d99
diff --git a/infra/workers/stadia-maps-proxy/package.json b/infra/workers/stadia-maps-proxy/package.json
deleted file mode 100644
index 269f2d85c6..0000000000
--- a/infra/workers/stadia-maps-proxy/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "stadia-maps-proxy",
- "version": "0.0.0",
- "private": true
-}
\ No newline at end of file
diff --git a/infra/workers/stadia-maps-proxy/src/index.ts b/infra/workers/stadia-maps-proxy/src/index.ts
deleted file mode 100644
index 9a73bee5d3..0000000000
--- a/infra/workers/stadia-maps-proxy/src/index.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/** Proxy requests for Stadia Maps tiles and geocoding. */
-
-export default {
- async fetch(request, env, ctx) {
- const url = new URL(request.url);
-
- // Handle tiles requests
- const tileMatch = url.pathname.match(/^\/tiles\/([^\/]+)\/(\d+)\/(\d+)\/(\d+)(@2x)?\.(\w+)$/);
- if (tileMatch) {
- const [, style, z, x, y, retina, format] = tileMatch;
- const stadiaUrl = `https://tiles.stadiamaps.com/tiles/${style}/${z}/${x}/${y}${retina || ''}.${format}?api_key=${env.STADIA_API_KEY}`;
-
- const response = await fetch(stadiaUrl);
-
- return new Response(response.body, {
- status: response.status,
- headers: {
- ...Object.fromEntries(response.headers),
- 'Access-Control-Allow-Origin': '*',
- 'Cache-Control': 'public, max-age=86400',
- }
- });
- }
-
- // Handle geocoding requests
- const geocodingMatch = url.pathname.match(/^\/geocoding\/(.+)$/);
- if (geocodingMatch) {
- const path = geocodingMatch[1];
- const stadiaUrl = `https://api.stadiamaps.com/geocoding/${path}?${url.searchParams.toString()}&api_key=${env.STADIA_API_KEY}`;
-
- const response = await fetch(stadiaUrl);
- const data = await response.text();
-
- return new Response(data, {
- status: response.status,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Content-Type': 'application/json',
- }
- });
- }
-
- return new Response('Not found', { status: 404 });
- }
-};
\ No newline at end of file
diff --git a/infra/workers/stadia-maps-proxy/tsconfig.json b/infra/workers/stadia-maps-proxy/tsconfig.json
deleted file mode 100644
index 858da1aa7e..0000000000
--- a/infra/workers/stadia-maps-proxy/tsconfig.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "extends": "../tsconfig.base.json", "include": ["src"] }
\ No newline at end of file
diff --git a/infra/workers/stadia-maps-proxy/wrangler.toml b/infra/workers/stadia-maps-proxy/wrangler.toml
deleted file mode 100644
index 4f455b3167..0000000000
--- a/infra/workers/stadia-maps-proxy/wrangler.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-name = "stadia-maps-proxy"
-main = "src/index.ts"
-compatibility_date = "2025-06-03"
-
-routes = [
- { pattern = "stadia-maps-proxy.ente.io", custom_domain = true }
-]
-
-tail_consumers = [
- { service = "tail" }
-]
-
-[vars]
-# Added as a secret via the Cloudflare dashboard
-# STADIA_API_KEY = ""
\ No newline at end of file
diff --git a/web/apps/photos/src/components/TripLayout/TripMap.tsx b/web/apps/photos/src/components/TripLayout/TripMap.tsx
index 00f55eb590..085c876d55 100644
--- a/web/apps/photos/src/components/TripLayout/TripMap.tsx
+++ b/web/apps/photos/src/components/TripLayout/TripMap.tsx
@@ -95,7 +95,7 @@ export const TripMap: React.FC<TripMapProps> = ({
? ""
: '&copy; <a href="https://stadiamaps.com/">Stadia Maps</a>, &copy; <a href="https://openmaptiles.org/">OpenMapTiles</a> &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
}
- url="https://stadia-maps-proxy.ente.io/tiles/alidade_satellite/{z}/{x}/{y}{r}.jpg"
+ url="https://tiles.stadiamaps.com/tiles/alidade_satellite/{z}/{x}/{y}{r}.jpg"
maxZoom={20}
updateWhenZooming={false}
keepBuffer={1}
diff --git a/web/apps/photos/src/components/TripLayout/utils/geocoding.ts b/web/apps/photos/src/components/TripLayout/utils/geocoding.ts
index c0ef1e3f18..b79666095c 100644
--- a/web/apps/photos/src/components/TripLayout/utils/geocoding.ts
+++ b/web/apps/photos/src/components/TripLayout/utils/geocoding.ts
@@ -65,7 +65,7 @@ export const getLocationName = async (
try {
const response = await fetch(
- `https://stadia-maps-proxy.ente.io/geocoding/v1/reverse?point.lat=${lat}&point.lon=${lng}`,
+ `https://api.stadiamaps.com/geocoding/v1/reverse?point.lat=${lat}&point.lon=${lng}`,
);
if (!response.ok) {