SVG-Struktur & Technische Details
📋 Übersicht
Dieses Dokument erklärt, wie SVG-Dateien für das Wayfinding-System strukturiert werden müssen, damit Shops, Services und andere Elemente automatisch erkannt werden.
🎯 Grundprinzip
Das System erkennt Elemente anhand von:
- Layer-Namen (SVG
<g>Gruppen mitidAttribut) - Element-IDs (einzelne Shapes mit
idAttribut) - CSS-Klassen (optional:
classAttribut) - Data-Attribute (optional:
data-name,data-category, etc.)
🏗️ SVG-Struktur
Basis-Template:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 800">
<!-- 1️⃣ SHOPS LAYER -->
<g id="shops">
<rect id="shop-1" x="100" y="100" width="80" height="60"
fill="#4CAF50"
data-name="Aldi"
data-category="Lebensmittel" />
<rect id="shop-2" x="200" y="100" width="80" height="60"
fill="#4CAF50"
data-name="H&M"
data-category="Mode" />
</g>
<!-- 2️⃣ SERVICES LAYER -->
<g id="services">
<rect id="service-1" x="100" y="200" width="40" height="40"
fill="#95a5a6"
data-name="Information" />
<circle id="service-2" cx="200" cy="220" r="20"
fill="#95a5a6"
data-name="WC" />
</g>
<!-- 3️⃣ FACILITIES LAYER -->
<g id="facilities">
<rect id="elevator-1" x="300" y="100" width="30" height="30"
fill="#FF9800"
data-name="Aufzug"
class="elevator" />
<rect id="stairs-1" x="350" y="100" width="30" height="30"
fill="#FF9800"
data-name="Treppe"
class="stairs" />
</g>
<!-- 4️⃣ ENTRANCES LAYER -->
<g id="entrances">
<rect id="entrance-1" x="50" y="400" width="60" height="20"
fill="#3498db"
data-name="Haupteingang" />
</g>
<!-- 5️⃣ WAYPOINTS LAYER (optional) -->
<g id="waypoints">
<circle id="wp-1" cx="150" cy="150" r="5" fill="#805AD5" />
<circle id="wp-2" cx="250" cy="150" r="5" fill="#805AD5" />
</g>
</svg>
📦 Erkannte Layer-Namen
1. Shops 🏪
Layer-IDs:
#shops(Standard)g[id*="shop"](z.B.shops-eg,shop-layer)g[id*="SCM-shop"](SCM-spezifisch)
Element-IDs:
shop-1,shop-2, etc.SCM-shop-EG-1,SCM-shop-EG-2, etc.
Attribute:
data-name: Shop-Name (z.B. "Aldi", "H&M")data-category: Kategorie (z.B. "Mode", "Lebensmittel")fill: Farbe (Standard:#4CAF50grün)
Beispiel:
<g id="shops">
<rect id="shop-aldi" x="100" y="100" width="80" height="60"
fill="#4CAF50"
data-name="Aldi"
data-category="Lebensmittel" />
</g>
2. Services 🛠️
Layer-IDs:
#services(Standard)g[id*="service"]
Element-IDs:
service-1,service-2, etc.info-1,wc-1,atm-1, etc.
Attribute:
data-name: Service-Name (z.B. "Information", "WC", "Geldautomat")fill: Farbe (Standard:#95a5a6grau)
Beispiel:
<g id="services">
<rect id="service-info" x="100" y="200" width="40" height="40"
fill="#95a5a6"
data-name="Information" />
<circle id="service-wc" cx="200" cy="220" r="20"
fill="#95a5a6"
data-name="WC" />
</g>
3. Facilities 🏢
Layer-IDs:
#facilities(Standard)g[id*="facility"]
Element-IDs:
elevator-1,stairs-1,toilet-1, etc.
CSS-Klassen:
.elevator,.stairs,.toilet,.info
Attribute:
data-name: Facility-Namefill: Farbe (Standard:#FF9800orange)
Beispiel:
<g id="facilities">
<rect id="elevator-1" x="300" y="100" width="30" height="30"
fill="#FF9800"
data-name="Aufzug"
class="elevator" />
<rect id="stairs-1" x="350" y="100" width="30" height="30"
fill="#FF9800"
data-name="Treppe"
class="stairs" />
</g>
4. Entrances 🚪
Layer-IDs:
#entrances(Standard)g[id*="entrance"]
Element-IDs:
entrance-1,entrance-main, etc.
Attribute:
data-name: Eingangs-Name (z.B. "Haupteingang", "Nebeneingang")fill: Farbe (Standard:#3498dbblau)
Beispiel:
<g id="entrances">
<rect id="entrance-main" x="50" y="400" width="60" height="20"
fill="#3498db"
data-name="Haupteingang" />
</g>
5. Waypoints 📍 (Optional)
Layer-IDs:
#waypoints(Standard)#key-waypoints
Element-IDs:
wp-1,wp-2, etc.waypoint-1,waypoint-2, etc.
Attribute:
data-name: Waypoint-Name (optional)fill: Farbe (Standard:#805AD5lila)
Beispiel:
<g id="waypoints">
<circle id="wp-1" cx="150" cy="150" r="5" fill="#805AD5" />
<circle id="wp-2" cx="250" cy="150" r="5" fill="#805AD5" />
</g>
🏢 Multi-Floor Support
Floor-spezifische Layer:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 800">
<!-- ERDGESCHOSS (EG) -->
<g id="floor-eg">
<g id="shops-floor-eg">
<rect id="shop-eg-1" x="100" y="100" width="80" height="60"
fill="#4CAF50" data-name="Aldi EG" />
</g>
<g id="services-floor-eg">
<rect id="service-eg-1" x="100" y="200" width="40" height="40"
fill="#95a5a6" data-name="Info EG" />
</g>
</g>
<!-- 1. OBERGESCHOSS (OG1) -->
<g id="floor-og1">
<g id="shops-floor-og1">
<rect id="shop-og1-1" x="100" y="100" width="80" height="60"
fill="#4CAF50" data-name="H&M OG1" />
</g>
</g>
</svg>
Erkannte Floor-Konventionen:
floor-eg,floor-og1,floor-og2,floor-ug1etage-0,etage-1,etage-2level-0,level-1,level-2stock-0,stock-1,stock-2
🎨 Farb-Konventionen
| Element-Typ | Standard-Farbe | Hex-Code |
|---|---|---|
| Shops | Grün | #4CAF50 |
| Services | Grau | #95a5a6 |
| Facilities | Orange | #FF9800 |
| Entrances | Blau | #3498db |
| Waypoints | Lila | #805AD5 |
| Corridors | Hellgrau | #E0E0E0 |
| Parking | Dunkelgrau | #A0AEC0 |
📐 Größen-Empfehlungen
| Element-Typ | Min. Breite | Min. Höhe | Empfohlen |
|---|---|---|---|
| Shops | 40px | 30px | 80x60px |
| Services | 20px | 20px | 40x40px |
| Facilities | 20px | 20px | 30x30px |
| Entrances | 30px | 15px | 60x20px |
| Waypoints | 5px Radius | - | 5-10px Radius |
✅ Checkliste für SVG-Erstellung
- ViewBox definiert (z.B.
viewBox="0 0 1000 800") - Layer-Gruppen mit korrekten IDs (
#shops,#services, etc.) - Element-IDs eindeutig und sprechend (
shop-aldi,service-info) - data-name Attribute für alle wichtigen Elemente
- Farben gemäß Konventionen
- Größen ausreichend (min. 20x20px)
- Multi-Floor: Floor-Gruppen korrekt benannt
- Keine überlappenden IDs zwischen Floors
🛠️ Tools für SVG-Erstellung
Adobe Illustrator:
- Ebenen-Namen = Layer-IDs
- Objekt-Namen = Element-IDs
- Export: "SVG" → "Presentation Attributes"
Inkscape:
- Ebenen-ID setzen (Rechtsklick → Ebenen-Eigenschaften)
- Objekt-ID setzen (Rechtsklick → Objekt-Eigenschaften)
- Export: "Optimiertes SVG"
Figma:
- Frames = Gruppen
- Layer-Namen = IDs
- Export: "SVG"
🚀 Upload & Verarbeitung
1. SVG hochladen:
Dashboard → Wayfinding → SVG-Karte erstellen
2. Automatische Erkennung:
- System analysiert SVG-Struktur
- Extrahiert Shops, Services, Facilities
- Zeigt Vorschau mit erkannten Elementen
3. Mapping:
Dashboard → Wayfinding → Karten-Mapping
- Shops/Services per Drag & Drop auf Karte platzieren
- Koordinaten werden automatisch gespeichert
🐛 Troubleshooting
Problem: Shops werden nicht erkannt
Lösung:
- Prüfe Layer-ID: Muss
shopsodershopenthalten - Prüfe Element-IDs: Müssen eindeutig sein
- Prüfe Größe: Min. 40x30px
Problem: Falsche Farben
Lösung:
- Setze
fillAttribut explizit - Verwende Hex-Codes statt RGB
Problem: Multi-Floor funktioniert nicht
Lösung:
- Floor-Gruppen müssen
floor,etage,leveloderstockim ID enthalten - Shops müssen innerhalb der Floor-Gruppe sein
📞 Support
Bei Fragen oder Problemen:
- Dokumentation:
/docs/wayfinding/ - Beispiel-SVGs:
/docs/wayfinding/examples/ - API-Referenz:
/docs/api/wayfinding.md