aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAriel Costas Guerrero <94913521+arielcostas@users.noreply.github.com>2025-03-03 22:57:47 +0100
committerAriel Costas Guerrero <94913521+arielcostas@users.noreply.github.com>2025-03-03 22:57:47 +0100
commit647e69e9c3afb317885fbc04e609e9b3b945941a (patch)
tree4ec5c2e30fedbb1131b419a335bfcaf24247a81f /src
parent2e90c813d0cf924bb9e8b383c1202aae15b14684 (diff)
Manually add pin icon
Diffstat (limited to 'src')
-rw-r--r--src/Layout.tsx1
-rw-r--r--src/pages/Map.tsx12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Layout.tsx b/src/Layout.tsx
index 30db47b..de5a16a 100644
--- a/src/Layout.tsx
+++ b/src/Layout.tsx
@@ -1,7 +1,6 @@
import { ReactNode } from 'react';
import { Link, useLocation } from 'react-router';
import { MapPin, Map, Info } from 'lucide-react';
-import { useTheme } from './ThemeContext';
import './Layout.css';
interface LayoutProps {
diff --git a/src/pages/Map.tsx b/src/pages/Map.tsx
index 9b960be..3368e09 100644
--- a/src/pages/Map.tsx
+++ b/src/pages/Map.tsx
@@ -8,7 +8,15 @@ import LineIcon from '../components/LineIcon';
import { Link } from 'react-router';
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
import MarkerClusterGroup from "react-leaflet-markercluster";
-import { LatLngTuple } from "leaflet";
+import { Icon, LatLngTuple } from "leaflet";
+
+const icon = new Icon({
+ iconUrl: '/map-pin-icon.png',
+ iconSize: [25, 41],
+ iconAnchor: [12, 41],
+ popupAnchor: [1, -34],
+ shadowSize: [41, 41]
+});
const sdp = new StopDataProvider();
@@ -28,7 +36,7 @@ export function StopMap() {
/>
<MarkerClusterGroup>
{stops.map((stop) => (
- <Marker key={stop.stopId} position={[stop.latitude, stop.longitude] as LatLngTuple}>
+ <Marker key={stop.stopId} position={[stop.latitude, stop.longitude] as LatLngTuple} icon={icon}>
<Popup>
<Link to={`/estimates/${stop.stopId}`}>{stop.name}</Link>
<br />