diff --git a/apps/goat/app/api/map/filtering/layer/get-feature-keys/[layer_id]/route.ts b/apps/goat/app/api/map/filtering/layer/get-feature-keys/[layer_id]/route.ts index e4d229da..be9745e9 100644 --- a/apps/goat/app/api/map/filtering/layer/get-feature-keys/[layer_id]/route.ts +++ b/apps/goat/app/api/map/filtering/layer/get-feature-keys/[layer_id]/route.ts @@ -1,12 +1,11 @@ import { NextResponse } from "next/server"; - -const url = "http://127.0.0.1:8080"; +import { GET_FEATURE_PROPERTY_KEYS } from "@/lib/api/apiConstants"; export async function GET(request: Request) { const layer_id = request.url.slice(request.url.lastIndexOf("/") + 1); - console.log(layer_id); + try { - const res = await fetch(`${url}/collections/${layer_id}/queryables`); + const res = await fetch(GET_FEATURE_PROPERTY_KEYS(layer_id)); const keys = await res.json(); diff --git a/apps/goat/components/map/Layers.tsx b/apps/goat/components/map/Layers.tsx index 7086c7e8..b4eeb03e 100644 --- a/apps/goat/components/map/Layers.tsx +++ b/apps/goat/components/map/Layers.tsx @@ -8,6 +8,7 @@ import { and_operator, or_operator } from "@/lib/utils/filtering_cql"; import type { LayerProps } from "react-map-gl"; import { v4 } from "uuid"; import type { Layer } from "@/lib/store/styling/slice"; +import { GET_NON_FILTERED_LAYER } from "@/lib/api/apiConstants"; interface LayersProps { layers: XYZ_Layer[]; @@ -66,7 +67,8 @@ const Layers = (props: LayersProps) => { addLayer([ { id: "layer1", - sourceUrl: `https://geoapi.goat.dev.plan4better.de/collections/${projectId}/tiles/{z}/{x}/{y}`, + // sourceUrl: `https://geoapi.goat.dev.plan4better.de/collections/${projectId}/tiles/{z}/{x}/{y}`, + sourceUrl: GET_NON_FILTERED_LAYER(sampleLayerID), color: "#FF0000", }, ]); diff --git a/apps/goat/lib/api/apiConstants.ts b/apps/goat/lib/api/apiConstants.ts index c0204933..b921c1a4 100644 --- a/apps/goat/lib/api/apiConstants.ts +++ b/apps/goat/lib/api/apiConstants.ts @@ -8,4 +8,6 @@ export const API = { project: "api/v2/content/project", }; // export const FILTERING = "http://localhost:3000/api/map/filtering/layer/"; -export const FILTERING = (layer_id: string) => `http://127.0.0.1:8080/collections/${layer_id}/tiles/{z}/{x}/{y}`; \ No newline at end of file +export const FILTERING = (layer_id: string) => `https://geoapi.goat.dev.plan4better.de/collections/${layer_id}/tiles/{z}/{x}/{y}`; +export const GET_FEATURE_PROPERTY_KEYS = (layer_id: string) => `https://geoapi.goat.dev.plan4better.de/collections/${layer_id}/queryables` +export const GET_NON_FILTERED_LAYER = (layer_id: string) => `https://geoapi.goat.dev.plan4better.de/collections/${layer_id}/tiles/{z}/{x}/{y}` \ No newline at end of file