What steps will reproduce the problem?
1.Create a simple KML object with a point with an icon
2.Marshal KML and view results in Google Earth or Maps
3.Icon does not appear since scale was initialised to zero
4.Validate KML file (http://www.kmlvalidator.com or http://feedvalidator.org/)
5.Other elements initialised to zero causing validation errors
(refreshInterval, viewRefreshTime, viewBoundScale)
What is the expected output? What do you see instead?
The unspecified elements should not be included in the KML. The above and
attached are only simple examples. There may be other elements that are also
being invalidly initialised and included.
See attachments below
What version of the product are you using? On what operating system?
Revision 38
Windows XP
Please provide any additional information below.
example code:
final Kml kml = new Kml();// <kml ...
final Document doc = new Document();// <Document>
doc.setName("Can't be zero example");// <name>Can't be zero example</name>
final Placemark mark = new Placemark();// <Placemark>
mark.setName("Invalid Icon");// <name>Correct Icon</name>
final Style style = new Style();// <Style>
final IconStyle iconStyle = new IconStyle();// <IconStyle>
final Icon icon = new Icon();// <Icon>
icon.setHref("http://code.google.com/p/javaapiforkml/logo?cct=1289397818");//
<href>http://code.google.com/p/javaapiforkml/logo?cct=1289397818</href>
iconStyle.setIcon(icon);// </Icon>
style.setIconStyle(iconStyle);// </IconStyle>
mark.setStyleSelector(Arrays.asList((StyleSelector) style));// </Style>
final Point point = new Point();// <Point>
point.setCoordinates(Arrays.asList(new Coordinate(1d, 1d)));//
<coordinates>1.0,1.0</coordinates>
mark.setGeometry(point);// </Point>
doc.addToFeature(mark);// </Placemark>
kml.setFeature(doc);// </Document>
kml.marshal(new File("actual.kml"));// </kml>
Original issue reported on code.google.com by andrethe...@gmail.com on 17 Feb 2011 at 6:32
Original issue reported on code.google.com by
andrethe...@gmail.com
on 17 Feb 2011 at 6:32Attachments: