问题描述
我有一组位置(纬度和经度),可以添加到KML文件中以创建“热图”。我将每个位置都添加为地标,因为我向文件中添加了更多和位置,所以我可以建立一个显示位置和密度簇的热图。
问题在于图标(例如默认的黄色图钉)根本太大了。有没有办法添加单个点或微小标记?跨过几个像素就可以了。
解决方法
您是否正在寻找类似的东西?:
KML:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<Style id="measle">
<IconStyle id="measle">
<!-- specific to IconStyle -->
<scale>1</scale>
<Icon>
<href>https://maps.gstatic.com/intl/en_us/mapfiles/markers2/measle.png</href>
</Icon>
<hotSpot x="0.5" y="0.5"
xunits="fraction" yunits="fraction"/>
</IconStyle>
</Style>
<Placemark id="pm123">
<styleUrl>#measle</styleUrl>
<name>point123</name>
<Point>
<coordinates>-95.44,40.42,0</coordinates>
</Point>
</Placemark>
<Placemark id="pm456">
<styleUrl>#measle</styleUrl>
<name>point456</name>
<Point>
<coordinates>-95.43,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
example showing on a Google Maps Javascript API v3 map with KmlLayer