From 03a5e527d4ec12fff337cbbdddb135628045f16c Mon Sep 17 00:00:00 2001 From: vergiLgood1 Date: Mon, 5 May 2025 04:57:32 +0700 Subject: [PATCH] Refactor map layers and components for improved structure and functionality - Removed the MapLayerManager component and integrated its functionality into the Layers component. - Added FlyToHandler component to manage map fly-to animations and highlight incidents. - Introduced ClusterLayer and UnclusteredPointLayer components for better handling of crime incident clustering and display. - Updated types in map.ts to include new interfaces for district features and layer props. - Enhanced crime data processing functions for better data management and visualization. - Adjusted button styles in button.tsx for improved UI consistency. --- .../map/controls/top/additional-tooltips.tsx | 2 +- .../map/controls/top/crime-tooltips.tsx | 11 +- .../map/controls/top/search-control.tsx | 2 +- .../app/_components/map/crime-map.tsx | 10 +- sigap-website/app/_components/map/fly-to.tsx | 93 ++ .../app/_components/map/layers/base-layer.tsx | 31 - .../_components/map/layers/cluster-layer.tsx | 162 +++ .../map/layers/crime-cluster-layer.tsx | 337 ----- .../map/layers/district-extrusion-layer.tsx | 272 ++-- .../_components/map/layers/district-layer.tsx | 1169 +++-------------- .../app/_components/map/layers/layers.tsx | 231 ++++ .../map/layers/map-layer-manager.tsx | 226 ---- .../map/layers/uncluster-layer.tsx | 124 ++ sigap-website/app/_components/ui/button.tsx | 5 +- sigap-website/app/_utils/map.ts | 252 ++++ sigap-website/app/_utils/types/map.ts | 88 +- 16 files changed, 1285 insertions(+), 1730 deletions(-) create mode 100644 sigap-website/app/_components/map/fly-to.tsx delete mode 100644 sigap-website/app/_components/map/layers/base-layer.tsx create mode 100644 sigap-website/app/_components/map/layers/cluster-layer.tsx delete mode 100644 sigap-website/app/_components/map/layers/crime-cluster-layer.tsx create mode 100644 sigap-website/app/_components/map/layers/layers.tsx delete mode 100644 sigap-website/app/_components/map/layers/map-layer-manager.tsx create mode 100644 sigap-website/app/_components/map/layers/uncluster-layer.tsx create mode 100644 sigap-website/app/_utils/map.ts diff --git a/sigap-website/app/_components/map/controls/top/additional-tooltips.tsx b/sigap-website/app/_components/map/controls/top/additional-tooltips.tsx index e68eb30..4ef0e8d 100644 --- a/sigap-website/app/_components/map/controls/top/additional-tooltips.tsx +++ b/sigap-website/app/_components/map/controls/top/additional-tooltips.tsx @@ -59,7 +59,7 @@ export default function AdditionalTooltips({