Change Icons
This commit is contained in:
parent
8e66686c7c
commit
e9fbc4d13f
@ -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 += "<style type=\"text/css\">#marker-icon #person { display: inline; }</style>";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "person-org":
|
||||
XmlNodeList xmlpersonorg = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']");
|
||||
if (xmlpersonorg.Count == 1) {
|
||||
xmlpersonorg.Item(0).InnerXml += "<style type=\"text/css\">#person-layer-org #person-layer-org-"+ keyvalue[1] + " { display: inline; }</style>";
|
||||
}
|
||||
break;
|
||||
case "person-funct":
|
||||
XmlNodeList xmlpersonfunct = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']");
|
||||
if (xmlpersonfunct.Count == 1) {
|
||||
xmlpersonfunct.Item(0).InnerXml += "<style type=\"text/css\">#person-layer-funct #person-layer-funct-" + keyvalue[1] + " { display: inline; }</style>";
|
||||
}
|
||||
break;
|
||||
case "person-rang":
|
||||
XmlNodeList xmlpersonrang = this.svg.DocumentElement.SelectNodes("//*[local-name()='defs'][@id='people-def']");
|
||||
if (xmlpersonrang.Count == 1) {
|
||||
xmlpersonrang.Item(0).InnerXml += "<style type=\"text/css\">#person-layer-rang #person-layer-rang-" + keyvalue[1] + " { display: inline; }</style>";
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
@ -15,11 +15,6 @@
|
||||
font-family: DIN1451;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
#marker-icon #person {
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g inkscape:groupmode="layer" id="marker-bg" inkscape:label="Marker">
|
||||
<rect style="fill:#ffffff;stroke:#000000;stroke-width:1.5px;" width="82.5" height="110" x="2" y="0.75" />
|
||||
@ -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;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
#person-layer-org #person-layer-org-thw {
|
||||
display: inline;
|
||||
}
|
||||
#person-layer-funct #person-layer-funct-fueh {
|
||||
display: inline;
|
||||
}
|
||||
#person-layer-rang #person-layer-rang-trupp {
|
||||
display: inline;
|
||||
}
|
||||
#person-layer-typ #person-layer-typ-b1 {
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g inkscape:groupmode="layer" id="person-layer-org" inkscape:label="Organisation">
|
||||
<g inkscape:groupmode="layer" id="person-layer-org-thw" inkscape:label="THW">
|
||||
@ -131,24 +112,7 @@
|
||||
</g>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ" inkscape:label="Typ">
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-b1" inkscape:label="B1">
|
||||
<text><tspan y="42" x="0">B1</tspan></text>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-b2" inkscape:label="B2">
|
||||
<text><tspan y="42" x="0">B2</tspan></text>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-b" inkscape:label="B">
|
||||
<text><tspan y="42" x="0">B</tspan></text>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-tz-1" inkscape:label="TZ-1">
|
||||
<text><tspan y="42" x="0">TZ-1</tspan></text>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-tz-2" inkscape:label="TZ-2">
|
||||
<text><tspan y="42" x="0">TZ-2</tspan></text>
|
||||
</g>
|
||||
<g inkscape:groupmode="layer" id="person-layer-typ-tz" inkscape:label="TZ">
|
||||
<text><tspan y="42" x="0">TZ</tspan></text>
|
||||
</g>
|
||||
<text><tspan y="42" x="0" id="person-layer-typ-text"></tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 4.9 KiB |
Loading…
Reference in New Issue
Block a user