feat(leaflet): https://react-leaflet.js.org/docs/start-setup/
This commit is contained in:
parent
6e78f00b87
commit
4d89166ae8
|
@ -1,9 +1,20 @@
|
|||
import React from 'react';
|
||||
import { MapContainer, TileLayer, useMap } from 'react-leaflet'
|
||||
import { MapContainer, TileLayer, useMap, Marker, Popup } from 'react-leaflet'
|
||||
const Map = () => {
|
||||
return (
|
||||
<>
|
||||
<h2>Map</h2>
|
||||
<MapContainer center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
|
||||
<TileLayer
|
||||
attribution='© <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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue