@@ -22,7 +22,6 @@ import { keepPreviousData } from "@tanstack/react-query";
2222import { useStation } from "../hooks/use-station.js" ;
2323import { useStations } from "../hooks/use-stations.js" ;
2424import { useDebouncedCallback } from "../hooks/use-debounced-callback.js" ;
25- import { useDarkMode } from "../hooks/use-dark-mode.js" ;
2625import { useThemeColors } from "../hooks/use-theme-colors.js" ;
2726import { TideConditions } from "./TideConditions.js" ;
2827import type { StationSummary } from "../types.js" ;
@@ -31,8 +30,6 @@ import type { StationSummary } from "../types.js";
3130type ManagedMapProps = "onMove" | "onClick" | "interactiveLayerIds" | "style" | "cursor" ;
3231
3332export interface StationsMapProps extends Omit < ComponentProps < typeof Map > , ManagedMapProps > {
34- /** Optional dark mode style URL. Switches automatically based on .dark class or prefers-color-scheme. */
35- darkMapStyle ?: string ;
3633 onStationSelect ?: ( station : StationSummary ) => void ;
3734 onBoundsChange ?: ( bounds : { north : number ; south : number ; east : number ; west : number } ) => void ;
3835 /** Whether to show the geolocation button. Defaults to true. */
@@ -77,8 +74,6 @@ function StationPreviewCard({ stationId }: { stationId: string }) {
7774
7875export const StationsMap = forwardRef < MapRef , StationsMapProps > ( function StationsMap (
7976 {
80- mapStyle,
81- darkMapStyle,
8277 onStationSelect,
8378 onBoundsChange,
8479 focusStation,
@@ -98,9 +93,7 @@ export const StationsMap = forwardRef<MapRef, StationsMapProps>(function Station
9893 const debouncedSetBbox = useDebouncedCallback ( setBbox , 200 ) ;
9994 const [ selectedStation , setSelectedStation ] = useState < StationSummary | null > ( null ) ;
10095
101- const isDarkMode = useDarkMode ( ) ;
10296 const colors = useThemeColors ( ) ;
103- const effectiveMapStyle = isDarkMode && darkMapStyle ? darkMapStyle : mapStyle ;
10497
10598 const {
10699 data : stations = [ ] ,
@@ -218,7 +211,6 @@ export const StationsMap = forwardRef<MapRef, StationsMapProps>(function Station
218211 onMove = { handleMove }
219212 onClick = { handleMapClick }
220213 interactiveLayerIds = { [ "clusters" , "unclustered-point" ] }
221- mapStyle = { effectiveMapStyle }
222214 style = { { width : "100%" , height : "100%" } }
223215 cursor = "pointer"
224216 attributionControl = { false }
@@ -291,17 +283,18 @@ export const StationsMap = forwardRef<MapRef, StationsMapProps>(function Station
291283 id = "station-labels"
292284 type = "symbol"
293285 filter = { [ "!" , [ "has" , "point_count" ] ] }
294- minzoom = { 8 }
286+ minzoom = { 7 }
295287 layout = { {
296288 "text-field" : [ "get" , "name" ] ,
297- "text-size" : 11 ,
289+ "text-size" : 13 ,
298290 "text-offset" : [ 0 , 1.5 ] ,
299291 "text-anchor" : "top" ,
300292 "text-max-width" : 10 ,
293+ "text-font" : [ "Open Sans Bold" , "Arial Unicode MS Bold" ] ,
301294 } }
302295 paint = { {
303- "text-color" : colors . text ,
304- "text-halo-color" : colors . bg ,
296+ "text-color" : colors . mapText ,
297+ "text-halo-color" : colors . mapBg ,
305298 "text-halo-width" : 1.5 ,
306299 } }
307300 />
@@ -325,15 +318,15 @@ export const StationsMap = forwardRef<MapRef, StationsMapProps>(function Station
325318 type = "symbol"
326319 layout = { {
327320 "text-field" : [ "get" , "name" ] ,
328- "text-size" : 12 ,
321+ "text-size" : 14 ,
329322 "text-offset" : [ 0 , 1.8 ] ,
330323 "text-anchor" : "top" ,
331324 "text-max-width" : 10 ,
332325 "text-font" : [ "Open Sans Bold" , "Arial Unicode MS Bold" ] ,
333326 } }
334327 paint = { {
335- "text-color" : colors . text ,
336- "text-halo-color" : colors . bg ,
328+ "text-color" : colors . mapText ,
329+ "text-halo-color" : colors . mapBg ,
337330 "text-halo-width" : 2 ,
338331 } }
339332 />
0 commit comments