dancingCycle 2022-09-14 20:21:45 +02:00
parent 4d89166ae8
commit 69b304a03e
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,9 @@
import React from 'react';
import { MapContainer, TileLayer, useMap, Marker, Popup } from 'react-leaflet'
import { MapContainer, TileLayer } from 'react-leaflet'
/*JS module import (vs cdn or style link)*/
import 'leaflet/dist/leaflet.css'
/*set up the height of .leaflet-container
*/import '../../style.css';
const Map = () => {
return (
<>
@ -9,11 +13,6 @@ const Map = () => {
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={[51.505, -0.09]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
</>
);

View File

@ -1,3 +1,7 @@
h1 { color: red; }
h2 { color: green; }
h3 { color: blue; }
/*set up the height of*/
.leaflet-container {
height: 50vh;
}