diff --git a/backend/metadata-database/init-db.js b/backend/metadata-database/init-db.js index c6727bd..4914ab1 100644 --- a/backend/metadata-database/init-db.js +++ b/backend/metadata-database/init-db.js @@ -89,7 +89,47 @@ const datasets = [ PolygonColoring: { attributeName: "nutzart", colors: [ - { color: "darkred", values: ["halde", "friedhof", "wohnbaufläche"] }, + { + color: "Plum", + values: [ + "Wohnbaufläche", + "Industrie- und Gewerbefläche", + "Halde", + "Bergbaubetrieb", + "Tagebau, Grube Steinbruch", + "Fläche gemischter Nutzung", + "Fläche besonderer funktionaler Prägung", + "Sport-, Freizeit- und Erholungsfläche", + "Friedhof", + ], + }, + { + color: "LightGreen", + values: [ + "Landwirtschaft", + "Wald", + "Gehölz", + "Heide", + "Moor", + "Sumpf", + "Unland/Vegetationslose Fläche", + ], + }, + { + color: "RosyBrown", + values: [ + "Straßenverkehr", + "Weg", + "Platz", + "Bahnverkehr", + "Flugverkehr", + "Schiffsverkehr", + ], + }, + { + color: "SkyBlue", + values: ["Fließgewässer", "Hafenbecken", "Stehendes Gewässer"], + }, ], }, Tables: [], diff --git a/frontend/src/components/MapView/MapDatasetVisualizer.tsx b/frontend/src/components/MapView/MapDatasetVisualizer.tsx index fb8c69a..544c251 100644 --- a/frontend/src/components/MapView/MapDatasetVisualizer.tsx +++ b/frontend/src/components/MapView/MapDatasetVisualizer.tsx @@ -55,6 +55,9 @@ const MapDatasetVisualizer: React.FC = ({ new LatLng(51.505, -0.09) ); + /** + * Updates the data for a specific dataset. + */ const updateDatasetData = useCallback( (newData: FeatureCollection, bounds: LatLngBounds) => { setCurrentTabsCache((prevCache) => { @@ -87,7 +90,11 @@ const MapDatasetVisualizer: React.FC = ({ updateDatasetData ); - // Function to determine the color based on usageType using PolygonColoring from metadata + /** + * Function to determine the color based on usageType using PolygonColoring from metadata + * @param usageType the usage type string + * @returns the color to use + */ const getColor = (usageType: string) => { if (dataset.metaData && dataset.metaData.polygonColoring) { const coloring = dataset.metaData.polygonColoring; @@ -100,6 +107,9 @@ const MapDatasetVisualizer: React.FC = ({ return "#3388ff"; }; + /** + * Fetches the data for current viewport. + */ useEffect(() => { // Check if data has been fetched if (!geoData || !dataset.metaData) return;