gpt4 book ai didi

kml - 使用KML在 map 上显示名称

转载 作者:行者123 更新时间:2023-12-03 18:23:17 25 4
gpt4 key购买 nike

我可以使用KML显示多边形,圆形等。
现在,我只想使用KML显示一些名称。这可能吗 ?

最佳答案

如果要禁止(通过KML)在Google Earth的 map 上显示地标标签,则可以将比例尺0的LabelStyle添加到地标中(请参见下面的示例中的sn_hide样式)。如果您想在 map 上隐藏标签名称,直到将鼠标悬停在图标上,那么StyleMaps是您最好的选择。

以下示例中的第一个地标的名称显示在“位置”面板中,但使用LabelStyle从 map 中隐藏了。第二个地标#2使用StyleMap来隐藏标签,直到用户突出显示或将鼠标悬停在该图标上,该图标才会激活显示标签的突出显示样式。第三个地标#3使用始终显示标签的默认样式。

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Hide and show labels</name>
<Style id="sn_hide">
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="sh_style">
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<StyleMap id="msn_hide">
<Pair>
<key>normal</key>
<styleUrl>#sn_hide</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_style</styleUrl>
</Pair>
</StyleMap>

<Placemark>
<name>Placemark 1</name>
<description>Label name always hidden</description>
<styleUrl>#sn_hide</styleUrl>
<Point>
<coordinates>-119.232195,36.016021</coordinates>
</Point>
</Placemark>

<Placemark>
<name>Placemark 2</name>
<description>Hover over place to show label</description>
<styleUrl>#msn_hide</styleUrl>
<Point>
<coordinates>-119.2324,36.0155</coordinates>
</Point>
</Placemark>

<Placemark>
<name>Placemark 3</name>
<description>Always showing</description>
<Point>
<coordinates>-119.232672,36.014837</coordinates>
</Point>
</Placemark>
</Document>
</kml>

关于kml - 使用KML在 map 上显示名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13378030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com