我正在使用KML自定义图标,如下所示:
<Style id='icon-1073'>
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://www.gstatic.com/mapspro/images/stock/1073-biz-real-estate.png</href>
</Icon>
</IconStyle>
</Style>
但是我似乎无法使用大图标...如果我使用100px x 100px,它仍会缩小。
根据KML参考,Google Maps或Google Maps Javascript API不支持scale标签。
<scale> no
选项:
Google Maps(将图标缩放到固定大小)
Google Maps Javascript API v3 KmlLayer(将图标缩放为固定大小)
geoxml3第三方KML解析器(支持缩放图标,但将KML呈现为原生Google Maps Javascript API v3对象,因此对于复杂的KML会出现性能问题)(geoxml3项目页面)
通过以上链接加载的KML:
<?xml version="1.0" encoding="UTF-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id='icon-1073'>
<IconStyle>
<scale>2.0</scale>
<Icon>
<href>http://www.gstatic.com/mapspro/images/stock/1073-biz-real-estate.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name><![CDATA[]]></name>
<description><![CDATA[]]></description>
<styleUrl>#icon-1073</styleUrl>
<Point>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>71.3232421875,21.596150576461437,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句