M2-T09: build data visualization UI (heatmap map as home page)
- self-contained RecordsMap (only module importing leaflet/react-leaflet/ leaflet.heat/leaflet.markercluster); OSM tiles, swappable behind clean props - heatmap layers for location + poo (primary); time-range selector fetches only the window (locations server-filtered; poo client-filtered) - toggleable scatter layer with marker clustering; point-select reuses T10's edit/delete modals + hooks; query-key prefixes refresh map on mutation - pure map logic isolated + unit-tested; leaflet mocked in component tests - responsive layout; typed client only
This commit is contained in:
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Ambient type declarations for leaflet.heat (no @types package available).
|
||||
*
|
||||
* This file must be a MODULE (has a top-level export) so that `declare module 'leaflet'`
|
||||
* is treated as an AUGMENTATION of the existing leaflet types, not a replacement.
|
||||
* Without the export, the `declare module 'leaflet'` block would shadow all of @types/leaflet.
|
||||
*/
|
||||
|
||||
// This empty export makes the file a module, enabling proper augmentation semantics.
|
||||
export {}
|
||||
|
||||
// Augment the 'leaflet' module to add heatLayer and HeatLayer types.
|
||||
declare module 'leaflet' {
|
||||
type HeatLatLngTuple = [number, number] | [number, number, number]
|
||||
|
||||
interface HeatLayerOptions {
|
||||
minOpacity?: number
|
||||
maxZoom?: number
|
||||
max?: number
|
||||
radius?: number
|
||||
blur?: number
|
||||
gradient?: Record<number, string>
|
||||
}
|
||||
|
||||
class HeatLayer extends Layer {
|
||||
setLatLngs(latlngs: HeatLatLngTuple[]): this
|
||||
addLatLng(latlng: HeatLatLngTuple): this
|
||||
setOptions(options: HeatLayerOptions): this
|
||||
redraw(): this
|
||||
}
|
||||
|
||||
function heatLayer(latlngs: HeatLatLngTuple[], options?: HeatLayerOptions): HeatLayer
|
||||
}
|
||||
|
||||
// Declare leaflet.heat as a side-effect-only module.
|
||||
declare module 'leaflet.heat' {
|
||||
// Side-effect: augments the Leaflet global with the heatLayer plugin.
|
||||
const _: undefined
|
||||
export default _
|
||||
}
|
||||
Reference in New Issue
Block a user