diff options
| author | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2025-03-04 00:17:11 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2025-03-04 00:17:11 +0100 |
| commit | f94bb4470652d819df0821daf9446189e0790eb2 (patch) | |
| tree | 19e29df4c2c03d9bbed876e76423cb30ed973417 /src/pages/Map.tsx | |
| parent | cf525fe1cc12d4355482a506fd59cdf506d4e5db (diff) | |
Add location button to map
Diffstat (limited to 'src/pages/Map.tsx')
| -rw-r--r-- | src/pages/Map.tsx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pages/Map.tsx b/src/pages/Map.tsx index 3368e09..e7a7b2f 100644 --- a/src/pages/Map.tsx +++ b/src/pages/Map.tsx @@ -9,6 +9,7 @@ import { Link } from 'react-router'; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import MarkerClusterGroup from "react-leaflet-markercluster"; import { Icon, LatLngTuple } from "leaflet"; +import { LocateControl } from "../controls/LocateControl"; const icon = new Icon({ iconUrl: '/map-pin-icon.png', @@ -34,6 +35,7 @@ export function StopMap() { attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a>, © <a href="https://carto.com/attributions">CARTO</a>' url="https://d.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}@2x.png" /> + <LocateControl /> <MarkerClusterGroup> {stops.map((stop) => ( <Marker key={stop.stopId} position={[stop.latitude, stop.longitude] as LatLngTuple} icon={icon}> |
