也许这里是一个愚蠢的问题,但我的 html 技能现在已经褪色了.. :)
我正在通过单击按钮创建一个 KML 文件,并且 KML 标签的所有代码都在那里。我需要的是使用多个标签。它将在 KML 的开头进行硬编码。KML 应如下所示:
所以这段代码是从后面的 C# 代码生成的。所以问题是如何获得
<Style id= "randomColorIcon">
然后像 /Style 一样正确关闭标签而没有 id 部分?
在 C# 代码中,我有类似的东西,但我发现它没有读取其他 Style id 标签
kml.WriteStartElement("Style");
kml.WriteElementString("id", "randomColorIcon"); //not suitable for more than one Style tags
kml.WriteStartElement("IconStyle");
kml.WriteStartElement("Icon");
kml.WriteElementString("href", "http://maps.google.com/mapfiles/kml/pal3/icon23.png");
kml.WriteEndElement(); //</Icon>
kml.WriteEndElement(); //</IconStyle> ??
kml.WriteEndElement(); //</Style>
提前致谢 :)