Add travel times
This commit is contained in:
parent
275e5afac6
commit
75950f0b1b
4 changed files with 122 additions and 38 deletions
|
|
@ -11,6 +11,7 @@ import type {
|
|||
POI,
|
||||
POIResponse,
|
||||
POICategoryGroup,
|
||||
ColorMode,
|
||||
} from './types';
|
||||
|
||||
const DEBOUNCE_MS = 150;
|
||||
|
|
@ -50,6 +51,8 @@ export default function App() {
|
|||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const abortControllerRef = useRef<AbortController | null>(null);
|
||||
|
||||
const [colorMode, setColorMode] = useState<ColorMode>('price');
|
||||
|
||||
// POI state
|
||||
const [pois, setPois] = useState<POI[]>([]);
|
||||
const [selectedPOICategories, setSelectedPOICategories] = useState<Set<POICategoryGroup>>(
|
||||
|
|
@ -166,9 +169,11 @@ export default function App() {
|
|||
zoom={zoom}
|
||||
selectedPOICategories={selectedPOICategories}
|
||||
onPOICategoriesChange={setSelectedPOICategories}
|
||||
colorMode={colorMode}
|
||||
onColorModeChange={setColorMode}
|
||||
/>
|
||||
<div className="flex-1 relative">
|
||||
<Map data={data} pois={pois} onViewChange={handleViewChange} />
|
||||
<Map data={data} pois={pois} onViewChange={handleViewChange} colorMode={colorMode} />
|
||||
{loading && (
|
||||
<div className="absolute top-4 right-4 bg-white px-3 py-1 rounded shadow">Loading...</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue