diff --git a/next.config.ts b/next.config.ts index e9ffa30..765d934 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,14 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + async rewrites() { + return [ + { + source: "/map-styles/:path*", + destination: "https://basemaps.cartocdn.com/gl/:path*", + }, + ]; + }, }; export default nextConfig; diff --git a/src/components/ui/map.tsx b/src/components/ui/map.tsx index 69dd287..5f181cf 100644 --- a/src/components/ui/map.tsx +++ b/src/components/ui/map.tsx @@ -22,8 +22,8 @@ import { X, Minus, Plus, Locate, Maximize, Loader2 } from "lucide-react"; import { cn } from "@/lib/utils"; const defaultStyles = { - dark: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json", - light: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json", + dark: "/map-styles/dark-matter-gl-style/style.json", + light: "/map-styles/positron-gl-style/style.json", }; type Theme = "light" | "dark";