@Test public void testLegend() throws IOException, SAXException, ParserConfigurationException { final String xml = KmzExporter.createKml(new KmlScreenOverlay("Legend", new DummyTestOpImage(4, 10))); final Document document = convertToDocument(xml); assertNotNull(document); final Element root = document.getRootElement(); assertNotNull(root); Namespace nameSpace = root.getNamespace(); final Element screenOverlay = root.getChild("ScreenOverlay", nameSpace); assertNotNull(screenOverlay); assertEquals("Legend", screenOverlay.getChildText("name", nameSpace)); final Element icon = screenOverlay.getChild("Icon", nameSpace); assertNotNull(icon); assertEquals("Legend.png", icon.getChildText("href", nameSpace)); assertNotNull(screenOverlay.getChild("overlayXY", nameSpace)); assertNotNull(screenOverlay.getChild("screenXY", nameSpace)); }
static String createKml(KmlFeature kmlFeature) { StringBuilder result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); result.append("<kml xmlns=\"http: kmlFeature.createKml(result); result.append("</kml>"); return result.toString(); }
KmzExporter { static String createKml(KmlFeature kmlFeature) { StringBuilder result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); result.append("<kml xmlns=\"http: kmlFeature.createKml(result); result.append("</kml>"); return result.toString(); } }
KmzExporter { static String createKml(KmlFeature kmlFeature) { StringBuilder result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); result.append("<kml xmlns=\"http: kmlFeature.createKml(result); result.append("</kml>"); return result.toString(); }  }
KmzExporter { static String createKml(KmlFeature kmlFeature) { StringBuilder result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); result.append("<kml xmlns=\"http: kmlFeature.createKml(result); result.append("</kml>"); return result.toString(); }  void export(KmlFeature kmlFeature, ZipOutputStream zipOutputStream, final ProgressMonitor pm); }
KmzExporter { static String createKml(KmlFeature kmlFeature) { StringBuilder result = new StringBuilder(); result.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); result.append("<kml xmlns=\"http: kmlFeature.createKml(result); result.append("</kml>"); return result.toString(); }  void export(KmlFeature kmlFeature, ZipOutputStream zipOutputStream, final ProgressMonitor pm);  }