爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3780|回复: 0

[混合编程] KML之样式设置的2种方法

[复制链接]

新浪微博达人勋

发表于 2019-1-14 16:08:50 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
设置Style,既可在地标内设置,也可在外写好再给个ID,这与写函数类似;以下是效果一样的两种写法:

1、在地标内设置:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>ao</name>
<Placemark>
<name>test1</name>
<Style>
<IconStyle>
<scale>5</scale>
<color>ff0000ff</color>
<Icon>
<href>

                               
登录/注册后可看大图
</href>

</Icon>
</IconStyle>
<LabelStyle>
<color>ff0000ff</color>
<scale>3</scale>
</LabelStyle>
</Style>
<Point>
<coordinates>120.8,32.5,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

2、引用样式:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>ao</name>
<Style id="style000">
<IconStyle>
<scale>5</scale>
<color>ff0000ff</color>
<Icon>
<href>

                               
登录/注册后可看大图
        </href>
</Icon>
</IconStyle>
<LabelStyle>
<color>ff0000ff</color>
<scale>3</scale>
</LabelStyle>
</Style>
<Placemark>
<name>test1</name>
<styleUrl>#style000</styleUrl>
<Point>
<coordinates>120.8,32.5,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>


密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表