MiguelEspinozaMedina / javaapiforkml

Automatically exported from code.google.com/p/javaapiforkml
0 stars 0 forks source link

Unable to specify no header for IconStyle #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.creating an IconStyle with no heading always gives it a heading.

<Style id="product_Icon">
<IconStyle>
  <scale>1.0</scale>
  <heading>0.0</heading>
  <Icon>
    <href>http://172.20.1.205:8080/......jpg</href>
    <refreshInterval>0.0</refreshInterval>
    <viewRefreshTime>0.0</viewRefreshTime>
    <viewBoundScale>0.0</viewBoundScale>
  </Icon>
  </IconStyle>
</Style>

What is the expected output? What do you see instead?
I was hopping to be able to specify no heading and the icons are always placed 
upright and not dependent upon the position of the globe (ie always facing 
North at 0.0 heading)

What version of the product are you using? On what operating system?
Google Earth: 6.0.3.2197
Windows XP
Downloaded the latest JAK release

Please provide any additional information below.
I think it would be nice to not have these
 <refreshInterval>0.0</refreshInterval>
 <viewRefreshTime>0.0</viewRefreshTime>
 <viewBoundScale>0.0</viewBoundScale>
in the KML as I believe these are default values.

Original issue reported on code.google.com by Grene...@gmail.com on 30 Jun 2011 at 9:25

GoogleCodeExporter commented 9 years ago
The solution I used to get around this was to create a temp StringWriter to 
marsh the kml to and then send it to my real printWrtier

///////////////BEFORE///////////////////////////
kml.marshal(out);

///////////////NOW///////////////////////////
StringWriter sw = new StringWriter();
kml.marshal(sw);
out.print(sw.toString().replaceAll("<heading>0.0</heading>",""));

Original comment by Grene...@gmail.com on 1 Jul 2011 at 1:08

GoogleCodeExporter commented 9 years ago
This doesn't work when you want to marshal as KMZ!  Does anyone have a better 
solution?

Original comment by danny.j.cohn@gmail.com on 1 Aug 2011 at 9:49