<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">It seems to be a pure bug. Here is
      workaround code:<br>
      <br>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            MapServer.Format.KML =
      OpenLayers.Class(OpenLayers.Format.KML, {<br>
              CLASS_NAME: "MapServer.Format.KML",<br>
              parseStyle: function(node) {<br>
                var baseURI = node.baseURI.split("?")[0]; // remove
      query, if any<br>
                if (baseURI.lastIndexOf("/") != baseURI.length - 1) {<br>
                  baseURI = baseURI.substr(0, baseURI.lastIndexOf("/") +
      1);<br>
                }<br>
                var style = 
      OpenLayers.Format.KML.prototype.parseStyle.call(this, node);<br>
                if (typeof style.externalGraphic != "undefined"
      && style.externalGraphic.match(new RegExp("(^/)|(://)"))
      == null) {<br>
                  style.externalGraphic = baseURI +
      style.externalGraphic;<br>
                }<br>
                return style;<br>
              }<br>
            });<br>
      <br>
      Best reards,<br>
      Egil<br>
      <br>
      <br>
      On 02/12/2013 11:30 PM, Egil Möller wrote:<br>
    </div>
    <blockquote cite="mid:511A43E5.6040407@skytruth.org" type="cite">
      <pre wrap="">Hi!

I'm trying to load KML into a vector layer. The KML contains styles with
relative paths to icons:

            <IconStyle>
                <color>ff0099ff</color>
                <scale>0.5</scale>
                <heading>496.77</heading>
                <Icon>
                    <href>files/vd.png</href>
                </Icon>
            </IconStyle>

This results in a 404 on <a class="moz-txt-link-freetext" href="http://myserver.com/files/vd.png">http://myserver.com/files/vd.png</a> (the kml file
is not located in the root of my server...). I've tried to solve this
using new

                OpenLayers.Format.KML({
                  styleBaseUrl: <a class="moz-txt-link-rfc2396E" href="http://myserver.com/static/kml-files">"http://myserver.com/static/kml-files"</a>,
                  extractStyles: true,
                  extractAttributes: true,
                  maxDepth: 2
                })

That makes any errors go away, but no icon markers show up, and when I
check the network tab in the chrome debugger I don't see vd.png loaded
at all.

I actually don't get any errors regardless of what I set styleBaseUrl
to, as long as it is set.

Any ideas,
Egil
</pre>
    </blockquote>
    <br>
  </body>
</html>