Repository Public MIT
1{2 "accessibility" : [3 "The title has the header trait. The side panel's buttons are labelled \"Collapse\" / \"Expand\" and \"Close\".",4 "Result rows are buttons combining title and subtitle; the selected row has the `.isSelected` trait and a checkmark.",5 "The sheet keeps the system's behaviour (drag indicator, VoiceOver detent actions, keyboard avoidance).",6 "With Reduce Transparency the side panel becomes an opaque themed surface."7 ],8 "category" : "maps",9 "changelog" : [10 {11 "changes" : [12 "Initial release."13 ],14 "date" : "2026-12-02",15 "version" : "1.0.0"16 }17 ],18 "dependencies" : [19 {20 "id" : "glass-foundation",21 "version" : "1.0.0"22 }23 ],24 "description" : "Extensible results panel that keeps the map behind it interactive.",25 "examples" : [26 {27 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassMapPanelExample: GlassExample {\n public static let componentID = \"glass-map-panel\"\n @State private var isPresented = false\n @State private var detent = GlassMapPanelDetent.half\n @State private var selection: String?\n @State private var query = \"\"\n @State private var engine = SampleMapEngine()\n\n /// Fictitious results.\n private let results = [\n GlassMapResult(id: \"1\", title: \"Café Exemple\", subtitle: \"Sample data · 120 m\", systemImage: \"cup.and.saucer\"),\n GlassMapResult(id: \"2\", title: \"Bibliothèque fictive\", subtitle: \"Sample data · 350 m\", systemImage: \"books.vertical\"),\n GlassMapResult(id: \"3\", title: \"A place with a very long name that wraps over several lines in a narrow panel\", subtitle: \"Sample data · 1.2 km\"),\n GlassMapResult(id: \"4\", title: \"مقهى تجريبي\", subtitle: \"Sample data · 2 km\", systemImage: \"cup.and.saucer\"),\n GlassMapResult(id: \"5\", title: \"Parc d’essai\", subtitle: \"Sample data · 2.4 km\", systemImage: \"tree\"),\n ]\n\n private var filteredResults: [GlassMapResult] {\n let trimmed = query.trimmingCharacters(in: .whitespaces)\n return trimmed.isEmpty ? results : results.filter { $0.title.localizedStandardContains(trimmed) }\n }\n\n public init() {}\n\n public var body: some View {\n GlassMapPanel(\"Nearby\", isPresented: $isPresented, detent: $detent) {\n SampleMapBackdrop(heading: engine.heading ?? 0, zoom: engine.zoomScale)\n .overlay(alignment: .topTrailing) {\n // The map and its controls stay usable while the panel is open.\n GlassMapControls(engine: engine)\n .padding()\n }\n .overlay(alignment: .bottomTrailing) {\n GlassButton(isPresented ? \"Hide results\" : \"Show results\", systemImage: \"list.bullet\") {\n isPresented.toggle()\n }\n .padding()\n }\n } content: {\n VStack(alignment: .leading, spacing: 12) {\n TextField(\"Search sample places\", text: $query)\n .textFieldStyle(.roundedBorder)\n GlassMapResultList(results: filteredResults, selection: selection) { result in\n selection = result.id\n detent = .peek\n }\n }\n }\n }\n}\n\n#Preview(\"GlassMapPanel\") { GlassMapPanelExample().glassTheme(.ocean) }\n",28 "title" : "GlassMapPanel example"29 }30 ],31 "files" : [32 {33 "bytes" : 13050,34 "path" : "Maps/Maps/GlassMapPanel.swift",35 "sha256" : "a2ddcfa3943565dffdf9b56c0afda6d4937dd1f5ad3c433dcf8a3964b58699ac"36 }37 ],38 "frameworks" : [3940 ],41 "id" : "glass-map-panel",42 "kind" : "native-wrapper",43 "license" : "MIT",44 "minimumOS" : {45 "iOS" : "26.0",46 "iPadOS" : "26.0",47 "macOS" : "26.0"48 },49 "name" : "GlassMapPanel",50 "platforms" : [51 "iOS",52 "iPadOS",53 "macOS"54 ],55 "schemaVersion" : 1,56 "sha256" : "be89c8886cbbb17e267b5c19a384ca027f7262b2e01d280626dfe61eb4ce3e74",57 "symbols" : [58 "GlassMapPanelDetent",59 "GlassMapPanelForm",60 "GlassMapPanelLayout",61 "GlassMapPanel",62 "GlassMapResult",63 "GlassMapResultList"64 ],65 "version" : "1.0.0"66}67