From 79adb2d49d59fe8081382cf58142fa06349cdb50 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 25 Jul 2023 17:05:20 +0100 Subject: [PATCH] New Keys for Typology category - Keys for all subcategories (except original building use) - Buttons to change key/visible layer Re: Issue #1212 --- app/map_styles/polygon.xml | 151 ++++++++++++++++++ .../building/data-containers/typology.tsx | 56 +++++++ .../frontend/config/category-maps-config.ts | 76 +++++++-- app/src/frontend/config/data-fields-config.ts | 2 +- app/src/frontend/config/tileserver-config.ts | 5 +- app/src/tiles/dataDefinition.ts | 21 +++ 6 files changed, 298 insertions(+), 13 deletions(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index 652f698d..d90205d5 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -973,4 +973,155 @@ + + + diff --git a/app/src/frontend/building/data-containers/typology.tsx b/app/src/frontend/building/data-containers/typology.tsx index 3a8e33e0..430943db 100644 --- a/app/src/frontend/building/data-containers/typology.tsx +++ b/app/src/frontend/building/data-containers/typology.tsx @@ -11,6 +11,7 @@ import { CategoryViewProps } from './category-view-props'; import InfoBox from '../../components/info-box'; import { DataEntryGroup } from '../data-components/data-entry-group'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; +import { useDisplayPreferences } from '../../displayPreferences-context'; const AttachmentFormOptions = [ "Detached", @@ -23,9 +24,37 @@ const AttachmentFormOptions = [ * Type view/edit section */ const TypeView: React.FunctionComponent = (props) => { + const { darkLightTheme } = useDisplayPreferences(); + + const switchToClassificationMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_classification') + } + const switchToStylePeriodMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_style_period') + } + const switchToDynamicClassificationMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_dynamic_classification') + } + const switchToAttachmentMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('building_attachment_form') + } + return ( + {(props.mapColourScale == "typology_classification") ? + + : + + } = (props) => { } + {(props.mapColourScale == "typology_style_period") ? + + : + + } = (props) => { } + {(props.mapColourScale == "typology_dynamic_classification") ? + + : + + } = (props) => { } + {(props.mapColourScale == "building_attachment_form") ? + + : + + } 0 OR dynamics_has_demolished_buildings = FALSE`, + typology_classification: ` + SELECT + geometry_id, + typology_classification + FROM + buildings + WHERE typology_classification IS NOT NULL`, + typology_style_period: ` + SELECT + geometry_id, + typology_style_period + FROM + buildings + WHERE typology_style_period IS NOT NULL`, + typology_dynamic_classification: ` + SELECT + geometry_id, + typology_dynamic_classification + FROM + buildings + WHERE typology_dynamic_classification IS NOT NULL`, }; const GEOMETRY_FIELD = 'geometry_geom';