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 "Release 1.1.0: see the project changelog."13 ],14 "date" : "2026-12-03",15 "version" : "1.1.0"16 },17 {18 "changes" : [19 "Initial release."20 ],21 "date" : "2026-12-02",22 "version" : "1.0.0"23 }24 ],25 "dependencies" : [26 {27 "id" : "glass-foundation",28 "version" : "1.1.0"29 }30 ],31 "description" : "Extensible results panel that keeps the map behind it interactive.",32 "examples" : [33 {34 "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 · café\", systemImage: \"cup.and.saucer.fill\", detail: \"120 m\"),\n GlassMapResult(id: \"2\", title: \"Bibliothèque fictive\", subtitle: \"Sample data · library\", systemImage: \"books.vertical.fill\", detail: \"350 m\"),\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",35 "title" : "GlassMapPanel example"36 }37 ],38 "files" : [39 {40 "bytes" : 20253,41 "path" : "Maps/Maps/GlassMapPanel.swift",42 "sha256" : "603a342b8ff6f8a1045e164bf1588af45ff0ce2c88a3f71464c6acfd4c490cb0"43 }44 ],45 "frameworks" : [4647 ],48 "id" : "glass-map-panel",49 "kind" : "native-wrapper",50 "license" : "MIT",51 "minimumOS" : {52 "iOS" : "26.0",53 "iPadOS" : "26.0",54 "macOS" : "26.0"55 },56 "name" : "GlassMapPanel",57 "platforms" : [58 "iOS",59 "iPadOS",60 "macOS"61 ],62 "schemaVersion" : 1,63 "sha256" : "076c2a7480eeb0f7e5cdbeb6603d25103f569ffaacf45ca0e3dce0f10b20734e",64 "symbols" : [65 "GlassMapPanelDetent",66 "GlassMapPanelForm",67 "GlassMapPanelLayout",68 "GlassMapPanel",69 "GlassMapResult",70 "GlassMapResultList"71 ],72 "version" : "1.1.0"73}74