From 5ef298feed7019c348c1085ca95be9e801e88e63 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 20 Nov 2026 21:58:12 -0800 Subject: [PATCH 1/2] Say the map is drawing when nothing new is being added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit onAddStart now comes with total 0 for a filter that only hides cells and while the camera moves to undrawn tiles; show "Drawing the map…" then instead of "Adding to the map… 0 / 0". --- .../Sources/pages/circle/AntennaHorizonsPage.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift b/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift index 978c204..3c1fd29 100644 --- a/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift +++ b/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift @@ -120,7 +120,8 @@ struct AntennaHorizonsPage: View { Text(error ?? (rows.isEmpty ? "Loading OpenCellID data…" : "\(circles.count) / \(rows.count) circles")) .accessibilityIdentifier("antenna-circle-count") if let adding { - Text("Adding to the map… \(adding.added) / \(adding.total)") + // total is 0 when nothing new is added: a filter that only hides cells, or the camera moving. + Text(adding.total == 0 ? "Drawing the map…" : "Adding to the map… \(adding.added) / \(adding.total)") .accessibilityIdentifier("antenna-add-progress") } HStack { Button("US overview") { moveCamera(39, -98, 4) }; Button("Alaska") { moveCamera(64, -150, 5) } } From c366ea8c0c15f58db91a235f6d9bb270dc7a7420 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 20 Nov 2026 23:16:12 -0800 Subject: [PATCH 2/2] Show the antenna sample's progress over the map Between onAddStart and onAddEnd the sample only changed a line in the card under the map. It now also shows a spinner with that line over the map, after 150 ms as the web and Android samples' overlays do, without taking touches so the map can still be moved while it draws. --- .../pages/circle/AntennaHorizonsPage.swift | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift b/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift index 3c1fd29..1a3a4d6 100644 --- a/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift +++ b/samples/MapConductorSampleApp/Sources/pages/circle/AntennaHorizonsPage.swift @@ -115,6 +115,11 @@ struct AntennaHorizonsPage: View { return content }() } + .overlay { + if let adding { + DrawingOverlay(text: Text(adding.total == 0 ? "Drawing the map…" : "Adding to the map… \(adding.added) / \(adding.total)")) + } + } VStack(alignment: .leading, spacing: 8) { Text("US cell positions (MCC 310–314)").font(.headline) Text(error ?? (rows.isEmpty ? "Loading OpenCellID data…" : "\(circles.count) / \(rows.count) circles")) @@ -220,3 +225,34 @@ private struct CarrierToggle: View { .accessibilityIdentifier(icon) } } + +/// Over the map while circles are added or their tiles drawn (between onAddStart and +/// onAddEnd). Shown after 150 ms, as the web and Android samples' overlays are, so that a +/// short redraw does not flash; it does not take touches, so the map can still be moved +/// while it draws. +private struct DrawingOverlay: View { + let text: Text + @State private var visible = false + + var body: some View { + ZStack { + if visible { + Color(red: 0x0F / 255, green: 0x17 / 255, blue: 0x2A / 255).opacity(0.2) + VStack(spacing: 10) { + ProgressView() + text.font(.callout) + } + .padding(.horizontal, 20).padding(.vertical, 16) + .background(Color(UIColor.secondarySystemBackground)) + .clipShape(RoundedRectangle(cornerRadius: 12)) + .accessibilityElement(children: .combine) + .accessibilityIdentifier("antenna-drawing-overlay") + } + } + .allowsHitTesting(false) + .task { + try? await Task.sleep(nanoseconds: 150_000_000) + visible = true + } + } +}