Add regional map functionality, and edit global map zoom settings

This commit is contained in:
Daniel S. Hansen
2025-07-31 14:39:35 -07:00
parent 31d38e5113
commit e6b7d82310
3 changed files with 22 additions and 24 deletions
+2
View File
@@ -1,4 +1,6 @@
import Dashboard from './components/layout/Dashboard.jsx' import Dashboard from './components/layout/Dashboard.jsx'
import 'leaflet/dist/leaflet.css';
function App() { function App() {
return ( return (
@@ -1,11 +1,11 @@
import React from "react"; import React from "react";
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
import 'leaflet/dist/leaflet.css'; // import 'leaflet/dist/leaflet.css';
export default function GlobalMapCanvas() { export default function GlobalMapCanvas() {
const position = [45.61142478054226, -122.49630033167544]; // [latitude, longitude] const position = [45.61142478054226, -122.49630033167544]; // [latitude, longitude]
return ( return (
<MapContainer center={position} zoom={13} style={{ height: "100%", width: "100%" }}> <MapContainer center={position} zoom={3} style={{ height: "100%", width: "100%" }}>
<TileLayer <TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; OpenStreetMap contributors' attribution='&copy; OpenStreetMap contributors'
@@ -1,24 +1,20 @@
import { Box, Text } from '@chakra-ui/react'; import React from "react";
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
// import 'leaflet/dist/leaflet.css';
export default function RegionalMapCanvas() { export default function GlobalMapCanvas() {
const position = [45.61142478054226, -122.49630033167544]; // [latitude, longitude]
return ( return (
<Box p={8} mt={4} ml="auto" mr="auto" width="600px"> <MapContainer center={position} zoom={13} style={{ height: "100%", width: "100%" }}>
<Box <TileLayer
bg="bg" url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
shadow="md" attribution='&copy; OpenStreetMap contributors'
borderRadius="md" />
p={8} <Marker position={position}>
width="600px" <Popup>
height="100px" CVO Home of the volcanoligists
textAlign="center" </Popup>
display="flex" </Marker>
alignItems="center" </MapContainer>
justifyContent="center"
>
<Text fontsize="2xl" fontWeight="bold" color="gray.700">
Regional Map Canvas coming soon!
</Text>
</Box>
</Box>
); );
} }