fix(rover-locations): use circleMarker; default marker icons aren't bundled

This commit is contained in:
Graham McIntire 2026-04-26 14:03:05 -05:00
parent df475a8199
commit f9e3dd50e4
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -2,7 +2,7 @@ import type { ViewHook } from "phoenix_live_view"
interface LocationMapHook extends ViewHook {
map: L.Map
marker: L.Marker
marker: L.CircleMarker
visibilityHandler: (() => void) | null
}
@ -38,7 +38,14 @@ export const LocationMap: Partial<LocationMapHook> = {
{ position: "topright", collapsed: false }
).addTo(map)
this.marker = L.marker([lat, lon]).addTo(map)
this.marker = L.circleMarker([lat, lon], {
radius: 8,
color: "#ffffff",
weight: 2,
fillColor: "#ef4444",
fillOpacity: 0.95,
pane: "markerPane"
}).addTo(map)
this.marker.bindPopup(`${lat.toFixed(6)}, ${lon.toFixed(6)}`)
// LiveView reconnect / tab visibility — Leaflet needs invalidateSize.