From e9fbc4d13f8ca245558ecf039a4bf9337fbc0a98 Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Thu, 14 Mar 2019 15:58:59 +0100 Subject: [PATCH] Change Icons --- Lora-Map/Model/Marker.cs | 45 +++++++++++++++++---- Lora-Map/names.json | 4 +- Lora-Map/resources/icons/marker/Marker.svg | 46 +++------------------- 3 files changed, 44 insertions(+), 51 deletions(-) diff --git a/Lora-Map/Model/Marker.cs b/Lora-Map/Model/Marker.cs index 962a158..17fd017 100644 --- a/Lora-Map/Model/Marker.cs +++ b/Lora-Map/Model/Marker.cs @@ -1,12 +1,9 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -namespace Fraunhofer.Fit.IoT.LoraMap.Model { +namespace Fraunhofer.Fit.IoT.LoraMap.Model +{ class Marker { private readonly XmlDocument svg = new XmlDocument(); @@ -22,9 +19,41 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model { if(keyvalue.Length == 2) { switch(keyvalue[0].ToLower()) { case "name": - XmlNodeList node = this.svg.DocumentElement.SelectNodes("//*[local-name()='tspan'][@id='marker-name-text']"); - if(node.Count == 1) { - node.Item(0).InnerText = keyvalue[1]; + XmlNodeList xmlname = this.svg.DocumentElement.SelectNodes("//*[local-name()='tspan'][@id='marker-name-text']"); + if(xmlname.Count == 1) { + xmlname.Item(0).InnerText = keyvalue[1]; + } + break; + case "icon": + if(keyvalue[1] == "person") { + XmlNodeList xmlicon = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='global-def']"); + if (xmlicon.Count == 1) { + xmlicon.Item(0).InnerXml += ""; + } + } + break; + case "person-org": + XmlNodeList xmlpersonorg = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']"); + if (xmlpersonorg.Count == 1) { + xmlpersonorg.Item(0).InnerXml += ""; + } + break; + case "person-funct": + XmlNodeList xmlpersonfunct = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']"); + if (xmlpersonfunct.Count == 1) { + xmlpersonfunct.Item(0).InnerXml += ""; + } + break; + case "person-rang": + XmlNodeList xmlpersonrang = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']"); + if (xmlpersonrang.Count == 1) { + xmlpersonrang.Item(0).InnerXml += ""; + } + break; + case "person-text": + XmlNodeList xmlpersontext = this.svg.DocumentElement.SelectNodes("//*[local-name()='tspan'][@id='person-layer-typ-text']"); + if (xmlpersontext.Count == 1) { + xmlpersontext.Item(0).InnerText = keyvalue[1]; } break; } diff --git a/Lora-Map/names.json b/Lora-Map/names.json index 03c7b06..da7f704 100644 --- a/Lora-Map/names.json +++ b/Lora-Map/names.json @@ -1,10 +1,10 @@ { "A": { "name": "26/91", - "icon": "icons/marker/thw/einheiten/26-91.png" + "icon": "icons/marker/Marker.svg?name=26/91&icon=person&person-org=thw&person-funct=fueh&person-rang=zug&person-text=TZ" }, "C": { "name": "27/92", - "icon": "icons/marker/thw/einheiten/27-92.png" + "icon": "icons/marker/Marker.svg?name=27/92&icon=person&person-org=thw&person-funct=fueh&person-rang=trupp&person-text=B1" } } \ No newline at end of file diff --git a/Lora-Map/resources/icons/marker/Marker.svg b/Lora-Map/resources/icons/marker/Marker.svg index 8034f2e..9526606 100644 --- a/Lora-Map/resources/icons/marker/Marker.svg +++ b/Lora-Map/resources/icons/marker/Marker.svg @@ -15,11 +15,6 @@ font-family: DIN1451; } - @@ -62,27 +57,13 @@ } #person-layer-typ tspan { - font-size:20px; + font-size: 20px; font-family: DIN1451; - text-align:center; - text-anchor:middle; - fill:#ffffff; + text-align: center; + text-anchor: middle; + fill: #ffffff; } - @@ -131,24 +112,7 @@ - - B1 - - - B2 - - - B - - - TZ-1 - - - TZ-2 - - - TZ - +