KML LineString OuterWidth and OuterColor issues

497 views
Skip to first unread message

Joseph Torp

unread,
Oct 22, 2012, 11:09:57 AM10/22/12
to kml-support-g...@googlegroups.com
I'm having an issue defining my linestyle in KML-I'm trying to have the inner part of the line a different color form the outer portion of the line (and ideally have those lines visible at all zoom levels), like the traffic lines in google maps.

Following the instructions here:
https://developers.google.com/kml/articles/draworder
I'm getting a solid line when I plug the KML file into google earth, instead of the desired two-tone line.

Additionally, if anyone knows where I can get the code for the google maps traffic linestyle, that would be greatly appreciated!

This is an example of my code for the linestyle
<Style id="LineStyle00">
    <LabelStyle>
      <color>00000000</color>
      <scale>0.000000</scale>
     </LabelStyle>
    <LineStyle>
      <gx:color>ff008000</gx:color>
      <width>12</width>
      <gx:outerColor>ff55ff55</gx:outerColor>
      <gx:outerWidth>3</gx:outerWidth>
    </LineStyle>
    <PolyStyle>
      <color>00000000</color>
      <outline>0</outline>
    </PolyStyle>

Cedric de La Beaujardiere

unread,
Apr 5, 2013, 3:14:31 AM4/5/13
to kml-support-g...@googlegroups.com
I'm having this issue too.  Did you ever resolve this?  I'm using Google Earth version 7.0.3.8542

A line with the style bellow should 4 pixels wide, 1 blue pixel to each side and 2 yellow pixels down the middle.  Instead it is all yellow.

<?xml version="1.0" encoding="UTF-8"?>
  <Document>
    <name>gx:AnimatedUpdate example test 7 fast two lines</name>
    <open>1</open>

    <Placemark id="STJ_line">
      <name>STJ_line</name>
      <styleUrl>#Yellow</styleUrl>
      <Snippet></Snippet>
      <MultiGeometry>
        <LineString>
          <tessellate>1</tessellate>
          <extrude>0</extrude>
          <altitudeMode>clampToGround</altitudeMode>
          <coordinates> -64.716828,18.317366,0.000000 -64.721526,18.319714,0.000000</coordinates>
        </LineString>
      </MultiGeometry>
    </Placemark>
    <Style id="Yellow">
      <LineStyle>
        <color>ff00FFff</color>
        <width>4.000000</width>
        <gx:outerColor>ffff0000</gx:outerColor>
<gx:outerWidth>0.5</gx:outerWidth>
      </LineStyle>
    </Style>
  </Document>
</kml>

I also tried using <physicalWidth> tag instead of <width>, but then my line was always 1 pixel, regardless of zoom level, even when the physical Width should have been 200 meters.

Cedric

Benjamin Saglio

unread,
May 3, 2013, 9:58:58 AM5/3/13
to kml-support-g...@googlegroups.com
First of all, <gx;outerColor> and <gx:outerWidth> should only work properly if <gx:physicalWidth> is used... Unfortunately, this limitation is not cleary written in the KML reference document.

One more remark, value for <gx:outerWidth> is not in pixels, so it should be fixed between 0 and 1 (like percent value).

On the road again !
Reply all
Reply to author
Forward
0 new messages