-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
276 lines (259 loc) · 13.4 KB
/
Copy pathindex.html
File metadata and controls
276 lines (259 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Explore Swiss building data. Open, accessible, and designed for everyone.">
<title>OpenBuildings.ch</title>
<!-- Preconnect to external domains (do this FIRST for faster connections) -->
<link rel="preconnect" href="https://unpkg.com">
<link rel="preconnect" href="https://api.protomaps.com">
<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://vectortiles.geo.admin.ch">
<!-- MapLibre GL CSS -->
<link href="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css" rel="stylesheet">
<!-- Fonts - display=swap already ensures text is visible immediately -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- Application CSS -->
<link href="css/styles.css" rel="stylesheet">
<!-- Scripts with defer - downloads in parallel, executes after HTML parsing -->
<script defer src="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2" crossorigin="anonymous"></script>
<!-- Main app as ES module for code-splitting support -->
<script type="module" src="js/app.js"></script>
</head>
<body>
<!-- SVG Symbol Definitions (hidden, referenced via <use>) -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="icon-eye-open" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
<circle cx="12" cy="12" r="3"></circle>
</symbol>
<symbol id="icon-eye-closed" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
<line x1="1" y1="1" x2="23" y2="23"></line>
</symbol>
</svg>
<main>
<div id="map"></div>
<!-- Search overlay -->
<div class="search-container">
<div class="search-input-wrapper">
<svg class="search-icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"></circle>
<path d="m21 21-4.35-4.35"></path>
</svg>
<input type="text" id="searchInput" placeholder="Search by address, EGID, or place..." autocomplete="off">
<button class="search-clear" id="searchClear" type="button" aria-label="Clear search">×</button>
</div>
<div class="search-dropdown" id="searchDropdown">
<div class="search-section" id="locationsSection">
<div class="search-section-header">Locations</div>
<div class="search-results" id="locationsResults"></div>
</div>
<div class="search-section" id="layersSection">
<div class="search-section-header">Layers</div>
<div class="search-results" id="layersResults"></div>
</div>
</div>
</div>
<!-- Custom Map Navigation -->
<div class="map-nav">
<button class="map-nav-btn" id="zoomInBtn" title="Zoom in" aria-label="Zoom in">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<button class="map-nav-btn" id="zoomOutBtn" title="Zoom out" aria-label="Zoom out">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<div class="map-nav-divider"></div>
<button class="map-nav-btn" id="compassBtn" title="Reset north" aria-label="Reset north">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polygon points="12,2 15,10 12,8 9,10" fill="currentColor" stroke="none"></polygon>
<polygon points="12,22 9,14 12,16 15,14" fill="none"></polygon>
</svg>
</button>
<button class="map-nav-btn" id="homeBtn" title="Reset view" aria-label="Reset view">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg>
</button>
<button class="map-nav-btn" id="toggle3DBtn" title="Toggle 3D view" aria-label="Toggle 3D view">
3D
</button>
</div>
<div class="basemap-selector" id="basemapSelector">
<div class="basemap-toggle light" id="basemapToggle"></div>
<div class="basemap-options">
<div class="basemap-option light active" data-style="white" data-label="White"></div>
<div class="basemap-option streets" data-style="light" data-label="Light"></div>
<div class="basemap-option outdoors" data-style="grayscale" data-label="Gray"></div>
<div class="basemap-option satellite" data-style="dark" data-label="Dark"></div>
</div>
</div>
<!-- Legend Accordion -->
<div class="legend-accordion expanded" id="legendAccordion">
<button class="legend-accordion-header" id="legendAccordionHeader" aria-expanded="true">
<svg class="legend-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
<circle cx="7" cy="6" r="2" fill="currentColor"></circle>
<circle cx="14" cy="12" r="2" fill="currentColor"></circle>
<circle cx="10" cy="18" r="2" fill="currentColor"></circle>
</svg>
<span class="legend-accordion-title">Legende</span>
<svg class="legend-chevron" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div class="legend-accordion-content" id="legendAccordionContent">
<!-- Buildings Layer Section -->
<div class="legend-section" data-layer="buildings">
<div class="legend-section-header">
<span class="legend-section-title">Gebäude</span>
<button class="legend-layer-toggle active" data-layer="buildings" title="Layer ein-/ausblenden">
<svg class="eye-open" width="16" height="16"><use href="#icon-eye-open"/></svg>
<svg class="eye-closed" width="16" height="16"><use href="#icon-eye-closed"/></svg>
</button>
</div>
<div class="legend-color-toggle" id="buildingColorToggle">
<button class="legend-color-btn" data-building-color="none">Keine</button>
<button class="legend-color-btn" data-building-color="status">Status</button>
<button class="legend-color-btn active" data-building-color="category">Kategorie</button>
<button class="legend-color-btn" data-building-color="period">Periode</button>
</div>
<div class="legend-section-content" id="buildingsLegendItems">
<!-- Populated dynamically -->
</div>
</div>
<!-- Landcovers Layer Section -->
<div class="legend-section" data-layer="landcovers">
<div class="legend-section-header">
<span class="legend-section-title">Bodenbedeckung</span>
<button class="legend-layer-toggle active" data-layer="landcovers" title="Layer ein-/ausblenden">
<svg class="eye-open" width="16" height="16"><use href="#icon-eye-open"/></svg>
<svg class="eye-closed" width="16" height="16"><use href="#icon-eye-closed"/></svg>
</button>
</div>
<div class="legend-section-content" id="landcoversLegendItems">
<!-- Populated dynamically -->
</div>
</div>
<!-- Parcels Layer Section -->
<div class="legend-section" data-layer="parcels">
<div class="legend-section-header">
<span class="legend-section-title">Parzellen</span>
<button class="legend-layer-toggle active" data-layer="parcels" title="Layer ein-/ausblenden">
<svg class="eye-open" width="16" height="16"><use href="#icon-eye-open"/></svg>
<svg class="eye-closed" width="16" height="16"><use href="#icon-eye-closed"/></svg>
</button>
</div>
<div class="legend-section-content">
<div class="legend-item">
<span class="legend-swatch legend-swatch-outline" style="border-color: #1e3a5f"></span>
<span class="legend-label">Parzelle</span>
</div>
</div>
</div>
</div>
</div>
<!-- Building Panel -->
<aside class="building-panel" id="buildingPanel">
<div class="building-panel-header">
<div class="building-panel-title">
<h2 id="panelBuildingName">Building Name</h2>
<div class="location" id="panelBuildingLocation">Location</div>
</div>
<button class="building-panel-close" id="closePanelBtn" aria-label="Close panel">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 6L6 18M6 6l12 12"></path>
</svg>
</button>
</div>
<div class="building-panel-content">
<div class="building-panel-metrics" id="panelMetrics">
<!-- Metrics will be populated dynamically -->
</div>
</div>
<div class="building-panel-footer">
<button class="btn-primary" id="downloadReportBtn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"></path>
</svg>
Download Report
</button>
</div>
</aside>
<!-- Map Scale Overlay -->
<div class="map-scale-overlay" id="scaleContainer"></div>
<!-- Map Context Menu (right-click) -->
<div class="map-context-menu" id="mapContextMenu">
<button class="context-menu-coords" id="contextMenuCoords">
<span class="coords-text">47.35191, 8.49471</span>
<svg class="copy-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path>
</svg>
</button>
<div class="context-menu-divider"></div>
<button class="context-menu-item" id="contextMenuShare">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="18" cy="5" r="3"></circle>
<circle cx="6" cy="12" r="3"></circle>
<circle cx="18" cy="19" r="3"></circle>
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line>
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line>
</svg>
Share this location
</button>
<button class="context-menu-item" id="contextMenuPrint">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 6 2 18 2 18 9"></polyline>
<path d="M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2"></path>
<rect x="6" y="14" width="12" height="8"></rect>
</svg>
Print
</button>
<div class="context-menu-divider"></div>
<button class="context-menu-item" id="contextMenuMeasure" disabled>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<path d="M2 12h2M6 12h2M10 12h2M14 12h2M18 12h2M22 12h2"></path>
<line x1="2" y1="8" x2="2" y2="16"></line>
<line x1="22" y1="8" x2="22" y2="16"></line>
</svg>
Measure distance
</button>
<button class="context-menu-item" id="contextMenuReport" disabled>
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path>
<line x1="4" y1="22" x2="4" y2="15"></line>
</svg>
Report a data problem
</button>
</div>
<div class="loading-overlay" id="loadingOverlay">
<div class="loading-spinner"></div>
<span class="loading-text">Loading map...</span>
</div>
</main>
<!-- App Footer -->
<footer class="app-footer" id="appFooter">
<div class="app-footer-coords" id="mouseCoords">WGS 84 | Koordinaten: –</div>
<div class="app-footer-links">
<a href="https://github.com/davras5/OpenBuildings" target="_blank" rel="noopener">GitHub</a>
<span class="app-footer-divider">·</span>
<a href="https://awnypgafushbsvqlsjyg.supabase.co" target="_blank" rel="noopener">API</a>
</div>
</footer>
<!-- Toast notifications container -->
<div class="toast-container" id="toastContainer"></div>
</body>
</html>