feat(rover): default 50mi max distance and frame map to that radius

This commit is contained in:
Graham McIntire 2026-04-25 17:37:17 -05:00
parent 083c393bc8
commit 6462acffc6
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 11 additions and 3 deletions

View file

@ -152,6 +152,10 @@ export const RoverMap: Partial<RoverMapHook> = {
fill: false
}).addTo(map)
// Frame the initial view around the drive-radius circle so the
// user starts zoomed in at the configured max-distance level.
map.fitBounds(this.driveCircle.getBounds(), { padding: [20, 20] })
L.control.scale({ metric: false, imperial: true, position: "bottomleft" }).addTo(map)
// Render initial stations from data attribute
@ -189,8 +193,12 @@ export const RoverMap: Partial<RoverMapHook> = {
this.homeLat = lat
this.homeLon = lon
if (this.homeMarker) this.homeMarker.setLatLng([lat, lon])
if (this.driveCircle) this.driveCircle.setLatLng([lat, lon])
this.map.flyTo([lat, lon], Math.max(this.map.getZoom(), 8), { duration: 0.6 })
if (this.driveCircle) {
this.driveCircle.setLatLng([lat, lon])
this.map.flyToBounds(this.driveCircle.getBounds(), { padding: [20, 20], duration: 0.6 })
} else {
this.map.flyTo([lat, lon], Math.max(this.map.getZoom(), 8), { duration: 0.6 })
}
})
this.handleEvent("rover_results", (

View file

@ -31,7 +31,7 @@ defmodule MicrowavepropWeb.RoverLive do
@default_band 10_000
@default_mode :ssb
@default_forecast_hour 0
@default_max_distance_mi 80
@default_max_distance_mi 50
@km_per_mi 1.609344
@avg_speed_kmh 65.0