Files
nodeMap/docs/components/contextmenu/CoordinatePopup.md
2025-05-28 10:17:25 +02:00

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- /docs/components/contextmenu/CoordinatePopup.md -->
# 📌 CoordinatePopup.js
Zeigt ein modales Fenster mit Koordinateninformationen an, z.B. aus einem Kontextmenü heraus.
## Features
- Darstellung eines Koordinatenwerts (`lat,lng`)
- Kopieren in die Zwischenablage (Clipboard API + Fallback)
- Modal zentriert mit Tailwind CSS
- Zwei Buttons: „Kopieren“ und „Schließen“
## Props
| Name | Typ | Beschreibung |
| ------------- | ---------- | -------------------------------------------- |
| `isOpen` | `boolean` | Steuert Sichtbarkeit des Modals |
| `coordinates` | `string` | Zu zeigende Koordinaten (z.B. `"53.2,8.1"`) |
| `onClose` | `function` | Wird bei Klick auf „Schließen“ ausgelöst |
## Design
- Tailwind-Klassen für zentriertes Layout (`fixed`, `inset-0`, `z-50`)
- Leicht animierter Button-Hover
## Interne Logik
- Nutzt `navigator.clipboard.writeText` oder Fallback mit `document.execCommand("copy")`
- Stoppt Event-Bubbling, um Klick außerhalb zu erkennen
🔙 [Zurück zur Übersicht](./README.md)