@Test public void testKmlPlacemarks() throws IOException, SAXException, ParserConfigurationException { KmlDocument doc1 = new KmlDocument("pins", null); doc1.addChild(new KmlPlacemark("placemark 1", null, new Point2D.Double(80.0, 89.0))); doc1.addChild(new KmlPlacemark("placemark 2", null, new Point2D.Double(70.0, 70.0))); doc1.addChild(new KmlPlacemark("placemark 3", null, new Point2D.Double(60.0, 60.0))); doc1.addChild(new KmlPlacemark("placemark 4", null, new Point2D.Double(40.0, 50.0))); final String xml = KmzExporter.createKml(doc1); final Document document = convertToDocument(xml); assertNotNull(document); final Element root = document.getRootElement(); assertNotNull(root); Namespace nameSpace = root.getNamespace(); final Element doc = root.getChild("Document", nameSpace); assertNotNull(doc); final List placemarks = doc.getChildren("Placemark", nameSpace); assertEquals(4, placemarks.size()); for (int i = 0; i < placemarks.size(); i++) { validatePlacemark((Element) placemarks.get(i), "placemark " + (i + 1), 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);  }