【发布时间】:2015-10-01 15:49:46
【问题描述】:
我有一个使用 ArcMap 生成的 SIMPLE.KML 文件,其中包含如下矢量:
<Placemark id="ID_0001">
<name>0</name>
<styleUrl>#IconStyle00</styleUrl>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<coordinates> -6.745,43.568,1.511693</coordinates>
</Point>
</Placemark>
还有这种风格:
<Style id="IconStyle00">
<IconStyle>
<Icon><href>SYMBOL_XXX.png</href></Icon>
<scale>1.0</scale>
</IconStyle>
<LabelStyle>
<color>00000000</color>
<scale>0.000000</scale>
</LabelStyle>
<PolyStyle>
<color>ff000000</color>
<outline>0</outline>
</PolyStyle>
</Style>
SYMBOL_XXX.png 文件与 SIMPLE.KML 位于同一文件夹中。
问题是当我尝试在地图中加载 kml 时,OL3 的图标“未找到”(如在 http://openlayers.org/en/v3.9.0/examples/kml.html 中,使用 extractStyles:true),因为 它认为 href 是绝对 url ,而不是相对的。
我想知道有一种解决方法,无需编辑 .kml(我有大量的 kmls,但仍然没有明确的文件夹结构)。
对于这个用例('localResources': true'...),在 ol.format.KML 中有某种选项不是很有用吗?
谢谢!
【问题讨论】:
标签: kml openlayers-3