-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
231 lines (203 loc) · 10.1 KB
/
index.html
File metadata and controls
231 lines (203 loc) · 10.1 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
<!--
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mapillary API Demo</title>
<!-- MapLibre GL JS -->
<link href="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css" rel="stylesheet" />
<script src="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.js"></script>
<!-- MapillaryJS -->
<link href="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.css" rel="stylesheet" />
<script src="https://unpkg.com/mapillary-js@4.1.2/dist/mapillary.js"></script>
<!-- Flatpickr date picker -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/dark.css" />
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="app">
<!-- ── Header ──────────────────────────────────────────────────────────── -->
<header id="header">
<div id="header-left">
<img id="logo-icon" src="logo_green.svg" alt="Mapillary" />
<span id="logo-text">Mapillary API Demo</span>
</div>
<div id="header-right">
<div id="token-group" class="collapsed">
<button id="token-toggle-btn">Change access token</button>
<label for="token-input" class="sr-only">Access Token</label>
<input
id="token-input"
type="password"
placeholder="Paste your Mapillary access token…"
autocomplete="off"
spellcheck="false"
/>
<button id="token-apply-btn">Apply</button>
<button id="token-cancel-btn">Cancel</button>
</div>
<a href="https://www.mapillary.com/terms" target="_blank" rel="noopener noreferrer" id="terms-link">Terms of Use</a>
<div id="status-indicator" aria-live="polite">
<span id="status-dot" class="dot dot-idle"></span>
<span id="status-text">Enter token to begin</span>
</div>
</div>
</header>
<!-- ── Main content: map | viewer ──────────────────────────────────────── -->
<main id="main-content">
<!-- Map panel -->
<section id="map-panel" aria-label="Map">
<div id="map-container"></div>
<!-- Geocoder search bar -->
<div id="geocoder-wrap" aria-label="Search location">
<div id="geocoder-box">
<svg id="geocoder-icon" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<circle cx="8.5" cy="8.5" r="5.5" stroke="currentColor" stroke-width="1.8"/>
<line x1="12.5" y1="12.5" x2="17" y2="17" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
</svg>
<input
id="geocoder-input"
type="text"
placeholder="Search for a place…"
autocomplete="off"
spellcheck="false"
aria-label="Search for a place"
aria-autocomplete="list"
aria-controls="geocoder-suggestions"
/>
<button id="geocoder-clear" title="Clear" aria-label="Clear search" class="hidden">✕</button>
</div>
<ul id="geocoder-suggestions" role="listbox" aria-label="Suggestions"></ul>
</div>
<!-- Map layer toggles toolbar -->
<div id="map-toolbar" aria-label="Layer toggles">
<span class="toolbar-label">Layers</span>
<button class="layer-toggle" id="toggle-points" data-active="false" title="Toggle map feature points">
<span class="toggle-dot points-dot"></span> Map Features
</button>
<button class="layer-toggle" id="toggle-signs" data-active="false" title="Toggle traffic sign tiles">
<span class="toggle-dot signs-dot"></span> Traffic Signs
</button>
<span class="toolbar-sep"></span>
<button class="layer-toggle" id="filters-toggle-btn" data-active="false" title="Filter images">
<svg width="13" height="13" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" style="margin-right:4px;vertical-align:middle"><path d="M1 3h14v1.5L9.5 9v5l-3-1.5V9L1 4.5V3z"/></svg>
Filters
</button>
</div>
<!-- Filters panel (dropdown) -->
<div id="filters-panel" aria-label="Image filters">
<div class="filters-grid">
<label class="filter-label" for="filter-start-date">From date</label>
<input class="filter-input" id="filter-start-date" type="text" placeholder="Pick start date" readonly />
<label class="filter-label" for="filter-end-date">To date</label>
<input class="filter-input" id="filter-end-date" type="text" placeholder="Pick end date" readonly />
<label class="filter-label filter-pano-label" for="filter-pano-only">360° only</label>
<div class="filter-pano-wrap">
<input id="filter-pano-only" type="checkbox" />
</div>
</div>
<div class="filters-actions">
<button id="filter-reset-btn" class="filter-btn filter-btn-reset">Reset</button>
<button id="filter-apply-btn" class="filter-btn filter-btn-apply">Apply Filters</button>
</div>
</div>
<div id="map-overlay" aria-hidden="true">
<div id="zoom-hint">Zoom in to see Mapillary coverage</div>
</div>
</section>
<!-- Drag-to-resize divider -->
<div id="divider" title="Drag to resize" role="separator" aria-orientation="vertical"></div>
<!-- Viewer panel -->
<section id="viewer-panel" aria-label="Street-level viewer">
<!-- Shown before any image is selected -->
<div id="viewer-placeholder">
<div id="placeholder-content">
<svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<rect x="4" y="12" width="56" height="40" rx="6" stroke="#05CB63" stroke-width="2.5"/>
<circle cx="32" cy="32" r="10" stroke="#05CB63" stroke-width="2.5"/>
<circle cx="32" cy="32" r="4" fill="#05CB63"/>
<circle cx="50" cy="18" r="3" fill="#05CB63"/>
</svg>
<p>Click a <strong>green</strong> sequence or image point on the map to open street-level imagery here.</p>
</div>
</div>
<!-- Tab bar -->
<div id="viewer-tabs" class="hidden">
<button class="viewer-tab active" data-tab="viewer">Viewer</button>
<button class="viewer-tab" data-tab="info">Image Info</button>
<button class="viewer-tab" data-tab="detections">Detections</button>
<button class="viewer-tab" data-tab="sequence">Sequence</button>
</div>
<!-- Tab panels -->
<div id="tab-viewer" class="tab-panel active">
<!-- MapillaryJS mounts here -->
<div id="mly-container"></div>
</div>
<div id="tab-info" class="tab-panel">
<div class="tab-scroll">
<div class="api-section-header">
<span class="api-badge badge-blue">GET</span>
<code class="api-url-display" id="info-api-url">graph.mapillary.com/{image_id}</code>
</div>
<div id="info-content" class="data-grid">
<div class="data-placeholder">Select an image to see its metadata</div>
</div>
</div>
</div>
<div id="tab-detections" class="tab-panel">
<div class="tab-scroll">
<div class="api-section-header">
<span class="api-badge badge-blue">GET</span>
<code class="api-url-display" id="detections-api-url">graph.mapillary.com/{image_id}/detections</code>
</div>
<div id="detections-content" class="detection-list">
<div class="data-placeholder">Select an image to see its detections</div>
</div>
</div>
</div>
<div id="tab-sequence" class="tab-panel">
<div class="tab-scroll">
<div class="api-section-header">
<span class="api-badge badge-blue">GET</span>
<code class="api-url-display" id="sequence-api-url">graph.mapillary.com/image_ids?sequence_id=…</code>
</div>
<div id="sequence-content" class="sequence-grid">
<div class="data-placeholder">Select an image to see its sequence</div>
</div>
</div>
</div>
<!-- Info bar shown when an image is active -->
<div id="viewer-info-bar" class="hidden">
<span id="viewer-attribution"></span>
<button id="viewer-close-btn" title="Close viewer" aria-label="Close viewer">✕</button>
</div>
</section>
</main>
<!-- ── API Console Drawer ──────────────────────────────────────────────── -->
<div id="api-console">
<div id="console-header">
<div id="console-header-left">
<span id="console-title">API Console</span>
<span id="console-call-count" class="console-badge">0 calls</span>
</div>
<div id="console-header-right">
<button id="console-clear-btn" title="Clear console">Clear</button>
<button id="console-toggle-btn" title="Toggle console" aria-expanded="false">▲</button>
</div>
</div>
<div id="console-body">
<div id="console-empty">No API calls yet — interact with the map to see live requests</div>
<div id="console-entries"></div>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>