MCPcopy Create free account
hub / github.com/cartesiancs/map3d / BuildingHeights

Function BuildingHeights

src/components/map/Processing.tsx:15–77  ·  view source on GitHub ↗
({
  buildings,
  loading,
}: {
  buildings: Building[];
  loading: boolean;
})

Source from the content-addressed store, hash-verified

13`;
14
15export function BuildingHeights({
16 buildings,
17 loading,
18}: {
19 buildings: Building[];
20 loading: boolean;
21}) {
22 return (
23 <div
24 css={css({
25 position: "relative",
26 })}
27 >
28 {loading && (
29 <div
30 css={css({
31 display: "flex",
32 alignItems: "center",
33 gap: "0.5rem",
34 color: "#555",
35 })}
36 >
37 <Loader2
38 css={css({
39 animation: `${spinAnimation} 1s linear infinite`,
40 })}
41 size={16}
42 />
43 Fetching building information...
44 </div>
45 )}
46 <ul
47 css={css({
48 overflow: "scroll",
49 zIndex: 999,
50 position: "absolute",
51 top: "1rem",
52 height: "80vh",
53 })}
54 >
55 {buildings.map((b) => (
56 <li key={b.id}>
57 <div>Building {b.id}</div>
58 <div>Height: {b.tags.height || "No height info"}</div>
59 <div>Location/Shape:</div>
60 {b.geometry ? (
61 <ul>
62 {b.geometry.map((pt, index) => (
63 <li key={index}>
64 ({pt.lat.toFixed(5)}, {pt.lng.toFixed(5)})
65 </li>
66 ))}
67 </ul>
68 ) : (
69 <div>No geometry info</div>
70 )}
71 <div>Other Tags: {JSON.stringify(b.tags)}</div>
72 </li>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected