title: KML should draw a red polyline or blue polyline?
body: <h2>Please tell me which one is "correct behavior as KML file format".</h2>
  
  <p>As you may know, the &lt;color&gt; tag of KML contains the color information with the order <strong>AABBGGRR</strong>. This is defined in the OGC KML document. </p>
  
  <blockquote>
    <p>16.9    kml:colorType</p>
    
    <p>The order of expression is aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff).
    <a href="http://docs.opengeospatial.org/is/12-007r2/12-007r2.html" rel="nofollow noreferrer">http://docs.opengeospatial.org/is/12-007r2/12-007r2.html</a></p>
  </blockquote>
  
  <p>So, the <code>&lt;color&gt;7f0000ff&lt;/color&gt;</code> should be red color.</p>
  
  <hr>
  
  <h2>Example1:</h2>
  
  <p>With this KML file, Google Earth and Google Maps API (KmlLayer) draw a <strong>red</strong> polyline correctly.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
    &lt;Document&gt;
      &lt;Style id="globalStyles"&gt;
        &lt;LineStyle id="line"&gt;
          &lt;color&gt;7f0000ff&lt;/color&gt;
          &lt;width&gt;4&lt;/width&gt;
        &lt;/LineStyle&gt;
      &lt;/Style&gt;
      &lt;Placemark&gt;
        &lt;styleUrl&gt;#globalStyles&lt;/styleUrl&gt;
        &lt;LineString&gt;
          &lt;tessellate&gt;1&lt;/tessellate&gt;
          &lt;coordinates&gt;-14.405821,-7.963539 -14.381448,-7.975707&lt;/coordinates&gt;
        &lt;/LineString&gt;
      &lt;/Placemark&gt;
    &lt;/Document&gt;
  &lt;/kml&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/wf9a5m75/xnw0hvvf/6/" rel="nofollow noreferrer">https://jsfiddle.net/wf9a5m75/xnw0hvvf/6/</a>
  <a href="https://i.stack.imgur.com/VAMKq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VAMKq.jpg" alt="enter image description here"></a></p>
  
  <hr>
  
  <h2>Example2:</h2>
  
  <p>However, with this KML file, the Google Maps API draws a <strong>blue</strong> line, but Google Earth draws still a <strong>red</strong> polyline.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
    &lt;Document&gt;
      &lt;Style id="globalStyles"&gt;
        &lt;LineStyle id="line"&gt;
          &lt;color&gt;7f0000ff&lt;/color&gt;
          &lt;width&gt;4&lt;/width&gt;
        &lt;/LineStyle&gt;
      &lt;/Style&gt;
        &lt;Placemark&gt;
          &lt;name&gt;runway&lt;/name&gt;
          &lt;styleUrl&gt;#globalStyles&lt;/styleUrl&gt;
          &lt;Style&gt;
            &lt;LineStyle&gt;
              &lt;!--
              Coloring is implicitly merged from the global style, width is
              explicitly overridden.
              --&gt;
              &lt;width&gt;10&lt;/width&gt;
            &lt;/LineStyle&gt;
          &lt;/Style&gt;
          &lt;LineString&gt;
            &lt;tessellate&gt;1&lt;/tessellate&gt;
            &lt;coordinates&gt;-14.405821,-7.963539 -14.381448,-7.975707&lt;/coordinates&gt;
          &lt;/LineString&gt;
        &lt;/Placemark&gt;
    &lt;/Document&gt;
  &lt;/kml&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/wf9a5m75/xnw0hvvf/5/" rel="nofollow noreferrer">https://jsfiddle.net/wf9a5m75/xnw0hvvf/5/</a></p>
  
  <p><a href="https://i.stack.imgur.com/ltEeD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ltEeD.jpg" alt="enter image description here"></a></p>
  
  <hr>
  
  <h2>Answer from Google</h2>
  
  <p>I believe this is a bug of Google Maps JS API v3, and I reported this to Google.</p>
  
  <p>But Google says </p>
  
  <blockquote>
    <p>Status: Won't Fix (Intended Behavior)</p>
    
    <p>Yes. I believe Google Maps Javascript API follows the "hexadecimal" <a href="https://i.stack.imgur.com/VAMKq.jpg" rel="nofollow noreferrer">1</a> format for colors. What I would recommend is, if possible, to adjust your color settings to follow the hexadecimal format of Google Maps Javascript API.</p>
  </blockquote>
  
  <p><a href="https://issuetracker.google.com/issues/71991422#comment2" rel="nofollow noreferrer">https://issuetracker.google.com/issues/71991422#comment2</a></p>
  
  <p>Wow, does they really intend this?</p>
  
  <hr>
  
  <h2>In real situation problem</h2>
  
  <p>Losing a color information means losing the meaning of the polyline/polygon.</p>
  
  <p>For example, the National Oceanic and atmospheric administration (NOAA) of United states provides realtime weather hazard using KMZ file.
  <a href="https://www.weather.gov/source/crh/shapefiles/" rel="nofollow noreferrer">https://www.weather.gov/source/crh/shapefiles/</a></p>
  
  <p>Google Earth draws polygons with correct colors (at least I think so), but the KmlLayer of Google Maps API v3 draws all blue polygons.
  <strong>Changing colors means changing meaning of the polygons.</strong>
  Don't you think this is serious problem?</p>
  
  <p><a href="https://i.stack.imgur.com/O8CRk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8CRk.jpg" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>So, in order to ask to fix the problem of Google Maps JS API v3, I need to know which one (red or blue) is correct.
  Please tell me your answer with valid information.</p>