Skip to content
Snippets Groups Projects
Commit 703280c6 authored by Fabian Schmidt's avatar Fabian Schmidt
Browse files

add sidebar

parent f861b050
No related branches found
No related tags found
No related merge requests found
{ {
"singleQuote": true, "singleQuote": true,
"trailingComma": "all" "trailingComma": "all",
"printWidth" : 120
} }
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" class='h-full w-full'>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
crossorigin=""></script> crossorigin=""></script>
<title>Snowpack App</title> <title>Snowpack App</title>
</head> </head>
<body> <body class='h-full w-full'>
<div id="root"></div> <div id="root" class='h-full w-full'></div>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="/dist/index.js"></script> <script type="module" src="/dist/index.js"></script>
<!-- <!--
......
#mapid { height: 500px; }
import React from 'react'; import React from "react";
import type { LatLngExpression } from 'leaflet'; import type { LatLngExpression } from "leaflet";
import { TileLayer, MapContainer, Marker, Popup } from 'react-leaflet'; import { TileLayer, MapContainer, Marker, Popup } from "react-leaflet";
import './App.css'; import "./App.css";
import { Sidebar } from "./Sidebar";
interface AppProps {} interface AppProps {
}
function App({}: AppProps) { function App({}: AppProps) {
const hamburgCenter: LatLngExpression = [ const hamburgCenter: LatLngExpression = [
53.55035993851227, 53.55035993851227,
9.986701679608633, 9.986701679608633
]; ];
return ( return (
<MapContainer <div className={"flex h-full"}>
id={'mapid'} <Sidebar style={{flex: 1}} />
center={hamburgCenter} <MapContainer
zoom={13} id={"mapid"}
scrollWheelZoom={true} className={"h-full w-full"}
> style={{flex: 3}}
<TileLayer center={hamburgCenter}
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' zoom={13}
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" scrollWheelZoom={true}
/> >
<Marker position={hamburgCenter}> <TileLayer
<Popup> attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
A pretty CSS3 popup. <br /> Easily customizable. url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
</Popup> />
</Marker> <Marker position={hamburgCenter}>
</MapContainer> <Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
</div>
); );
} }
......
import React, { CSSProperties } from "react";
interface Props {
style?: CSSProperties,
className?: string,
}
export const Sidebar: React.FC<Props> = (props) => {
return (
<div style={props.style} className={props.className}>
</div>
)
}
\ No newline at end of file
...@@ -14,4 +14,4 @@ body { ...@@ -14,4 +14,4 @@ body {
code { code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace; monospace;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment