0
点赞
收藏
分享

微信扫一扫

TE相关:kml浮动窗口图标

阎小妍 2022-09-27 阅读 27

TE在数据制作的过程中,可以通过加载kml文字,配合图片,在地图上浮动半透明的图标,已加载的kml图层,在信息树也是显示图层,可以控制显示和隐藏,缺点是交互性比较差,只能作为一个效果进行查看。

加载的效果如下:

TE相关:kml浮动窗口图标_加载

KML(Keyhole Markup Language,Keyhole 标记语言)最初是由Google 旗下的Keyhole 公司开发和维护的一种基于XML 的标记语言,利用XML 语法格式描述地理空间数据(如点、线、面、多边形和模型等),适合网络环境下的地理信息协作与共享。

kml最根本就是xml文件,使用文本编辑器,可以查看kml文件的内容,打开以上这种kml文件的,可以看到如下的内容:

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://earth.google.com/kml/2.2">
<ScreenOverlay>
<name>all</name>
<color>c0c0c0c0</color>
<description>ɝǷ͵</description>
<drawOrder>99</drawOrder>
<Icon> <href>main.jpg</href> </Icon>
<Transparent>0.01</Transparent>
<overlayXY x="10" y="0" xunits="pixels" yunits="pixels"/>
<screenXY x="-100" y="15" xunits="pixels" yunits="pixels"/>
<size x="2500" y="50" xunits="pixels" yunits="pixels"/>
</ScreenOverlay>
<ScreenOverlay>
<name>one</name>
<description>дť1</description>
<drawOrder>99</drawOrder>
<Icon> <href>1.png</href> </Icon>
<overlayXY x="10" y="0" xunits="pixels" yunits="pixels"/>
<screenXY x="30" y="25" xunits="pixels" yunits="pixels"/>
<size x="30" y="30" xunits="pixels" yunits="pixels"/>
</ScreenOverlay>
<ScreenOverlay>
<name>two</name>
<description>дť2</description>
<drawOrder>99</drawOrder>
<Icon> <href>2.png</href> </Icon>
<overlayXY x="10" y="0" xunits="pixels" yunits="pixels"/>
<screenXY x="90" y="25" xunits="pixels" yunits="pixels"/>
<size x="30" y="30" xunits="pixels" yunits="pixels"/>
</ScreenOverlay>
</kml>

其中关键处,<Icon> <href>图片详细路径</href> </Icon>,设置图标的位置,<screenXY x="90" y="25" xunits="pixels" yunits="pixels"/> 是在屏幕上的位置,可以将图片设置到屏幕指定的位置,<Transparent>0.01</Transparent> 透明度的设置;<size x="30" y="30" xunits="pixels" yunits="pixels"/>图标的尺寸设置。


举报

相关推荐

0 条评论