fix(rover-locations): use circleMarker; default marker icons aren't bundled
This commit is contained in:
parent
df475a8199
commit
f9e3dd50e4
1 changed files with 9 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import type { ViewHook } from "phoenix_live_view"
|
||||||
|
|
||||||
interface LocationMapHook extends ViewHook {
|
interface LocationMapHook extends ViewHook {
|
||||||
map: L.Map
|
map: L.Map
|
||||||
marker: L.Marker
|
marker: L.CircleMarker
|
||||||
visibilityHandler: (() => void) | null
|
visibilityHandler: (() => void) | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +38,14 @@ export const LocationMap: Partial<LocationMapHook> = {
|
||||||
{ position: "topright", collapsed: false }
|
{ position: "topright", collapsed: false }
|
||||||
).addTo(map)
|
).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)}`)
|
this.marker.bindPopup(`${lat.toFixed(6)}, ${lon.toFixed(6)}`)
|
||||||
|
|
||||||
// LiveView reconnect / tab visibility — Leaflet needs invalidateSize.
|
// LiveView reconnect / tab visibility — Leaflet needs invalidateSize.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue