-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubletMapContent.tsx
More file actions
37 lines (33 loc) · 926 Bytes
/
SubletMapContent.tsx
File metadata and controls
37 lines (33 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use client";
import "leaflet/dist/leaflet.css";
import { MapContainer, TileLayer, Circle } from "react-leaflet";
interface Props {
latitude: number;
longitude: number;
}
const CIRCLE_RADIUS_METERS = 200;
export const SubletMapContent = ({ latitude, longitude }: Props) => {
return (
<MapContainer
center={[latitude, longitude]}
zoom={15}
scrollWheelZoom={false}
className="z-0 h-72 w-full rounded-lg sm:h-80"
>
<TileLayer
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Circle
center={[latitude, longitude]}
radius={CIRCLE_RADIUS_METERS}
pathOptions={{
color: "#3b82f6",
fillColor: "#3b82f6",
fillOpacity: 0.2,
weight: 2,
}}
/>
</MapContainer>
);
};