传单杂食动物KML标记图标

时间:2016-03-22 17:07:03

标签: javascript leaflet kml mapbox

我正在使用传单,地图框和杂食动物来构建地图。我在.kml文件中有一组标记,我可以使用杂食动物将其加载到传单中。

  leafletData.getMap('map').then(function(map) {
    var pointLayer = omnivore.kml('/kml/points-of-interest-places-to-eat-kml.kml').addTo(map)
    .on('error', function(error) {
      console.log(error);
    })
  }
)

这些标记中的每一个都应该在.kml文件中具有与它们关联的样式和图标:

<Style id="buildingLabel">
    <IconStyle>
        <Icon>
            <href>/icons/building-label.png</href>
        </Icon>
    </IconStyle>
</Style>

<Placemark>
    <name>Building</name>
    <description>Building description</description>
    <styleUrl>#buildingLabel</styleUrl>
    <Point>
        <coordinates>-78.893733888,43.944767691,0.0</coordinates>
    </Point>
</Placemark>

.kml文件加载标记很好,但它们显示为通用标记,不使用.kml文件中的descibed图标(在Google地图中使用相同的文件,它们显示正常)。

我如何获取杂食/传单来使用这些图标?

谢谢!

0 个答案:

没有答案
相关问题