Remove grid squares toggle from rover planner page
The rover page now shows only: station markers, band selector, propagation heatmap, and URL sharing. Grid overlay remains on the main /map page.
This commit is contained in:
parent
1d76497db5
commit
ac36441102
2 changed files with 1 additions and 41 deletions
|
|
@ -1,13 +1,9 @@
|
||||||
import { updateGridOverlay } from "./maidenhead_grid"
|
|
||||||
|
|
||||||
export const RoverMap = {
|
export const RoverMap = {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.stations = []
|
this.stations = []
|
||||||
this.stationMarkers = L.layerGroup()
|
this.stationMarkers = L.layerGroup()
|
||||||
this.scoreOverlay = null
|
this.scoreOverlay = null
|
||||||
this.gridLookup = new Map()
|
this.gridLookup = new Map()
|
||||||
this.gridLayer = L.layerGroup()
|
|
||||||
this.gridVisible = true
|
|
||||||
|
|
||||||
this.colorScale = [
|
this.colorScale = [
|
||||||
{ min: 80, r: 0, g: 255, b: 163 },
|
{ min: 80, r: 0, g: 255, b: 163 },
|
||||||
|
|
@ -30,8 +26,6 @@ export const RoverMap = {
|
||||||
|
|
||||||
this.map = map
|
this.map = map
|
||||||
this.stationMarkers.addTo(map)
|
this.stationMarkers.addTo(map)
|
||||||
this.gridLayer.addTo(map)
|
|
||||||
updateGridOverlay(map, this.gridLayer)
|
|
||||||
|
|
||||||
// Render pre-loaded propagation scores
|
// Render pre-loaded propagation scores
|
||||||
const initialScores = JSON.parse(this.el.dataset.scores || "[]")
|
const initialScores = JSON.parse(this.el.dataset.scores || "[]")
|
||||||
|
|
@ -50,9 +44,6 @@ export const RoverMap = {
|
||||||
|
|
||||||
map.on("moveend", () => {
|
map.on("moveend", () => {
|
||||||
pushBounds()
|
pushBounds()
|
||||||
if (this.gridVisible) {
|
|
||||||
updateGridOverlay(map, this.gridLayer)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.handleEvent("update_scores", ({ scores }) => {
|
this.handleEvent("update_scores", ({ scores }) => {
|
||||||
|
|
@ -64,15 +55,6 @@ export const RoverMap = {
|
||||||
this.renderStations()
|
this.renderStations()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.handleEvent("toggle_grid", ({ visible }) => {
|
|
||||||
this.gridVisible = visible
|
|
||||||
if (visible) {
|
|
||||||
this.gridLayer.addTo(map)
|
|
||||||
updateGridOverlay(map, this.gridLayer)
|
|
||||||
} else {
|
|
||||||
this.gridLayer.remove()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// --- Propagation score overlay (same as main map) ---
|
// --- Propagation score overlay (same as main map) ---
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ defmodule MicrowavepropWeb.RoverLive do
|
||||||
resolving: false,
|
resolving: false,
|
||||||
url_loaded: false,
|
url_loaded: false,
|
||||||
initial_scores_json: Jason.encode!(initial_scores),
|
initial_scores_json: Jason.encode!(initial_scores),
|
||||||
bounds: @initial_bounds,
|
bounds: @initial_bounds
|
||||||
grid_visible: true
|
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -99,17 +98,6 @@ defmodule MicrowavepropWeb.RoverLive do
|
||||||
{:noreply, push_url(socket)}
|
{:noreply, push_url(socket)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_event("toggle_grid", _params, socket) do
|
|
||||||
visible = !socket.assigns.grid_visible
|
|
||||||
|
|
||||||
socket =
|
|
||||||
socket
|
|
||||||
|> assign(:grid_visible, visible)
|
|
||||||
|> push_event("toggle_grid", %{visible: visible})
|
|
||||||
|
|
||||||
{:noreply, socket}
|
|
||||||
end
|
|
||||||
|
|
||||||
def handle_event("map_bounds", bounds, socket) do
|
def handle_event("map_bounds", bounds, socket) do
|
||||||
scores = Propagation.latest_scores(socket.assigns.band, bounds)
|
scores = Propagation.latest_scores(socket.assigns.band, bounds)
|
||||||
|
|
||||||
|
|
@ -224,16 +212,6 @@ defmodule MicrowavepropWeb.RoverLive do
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<label class="flex items-center gap-2 cursor-pointer px-1">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
class="toggle toggle-sm toggle-primary"
|
|
||||||
checked={@grid_visible}
|
|
||||||
phx-click="toggle_grid"
|
|
||||||
/>
|
|
||||||
<span class="text-sm">Grid squares</span>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<form phx-submit="add_station" class="flex gap-1">
|
<form phx-submit="add_station" class="flex gap-1">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue