-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fd4325
commit c5dc289
Showing
2 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
client-next/src/components/MapView/GeometryPropertyPopup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { LngLat, Popup } from 'react-map-gl'; | ||
import { Table } from 'react-bootstrap'; | ||
|
||
export function GeometryPropertyPopup({ | ||
coordinates, | ||
properties, | ||
onClose, | ||
}: { | ||
coordinates: LngLat; | ||
properties: { [s: string]: string }; | ||
onClose: () => void; | ||
}) { | ||
return ( | ||
<Popup latitude={coordinates.lat} longitude={coordinates.lng} closeButton={true} onClose={() => onClose()}> | ||
<Table bordered> | ||
<tbody> | ||
{Object.entries(properties).map(([key, value]) => ( | ||
<tr key={key}> | ||
<th scope="row">{key}</th> | ||
<td>{value}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</Popup> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters