String name = marker.getAsString("name");
String desc = marker.getAsString("description");
if (desc != null) {
descriptions.put(name, desc);
}
PointLayer p = new PointLayer(coords, name, null);
p.setDisplayName(true);
String style = marker.getAsString("styleUrl");
if (style == null) {
style = "default";
}
setMarkerIcon(p, kml, style);
addPoint(p);
}
}
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
PointLayer p = (PointLayer) evt.getSource();
System.out.println("pressed " + p);
String name = p.getName();
final Dialog d = new Dialog(name);
d.setLayout(new BorderLayout());
WebBrowser wb = new WebBrowser();
wb.setPage(getDescription(name), "http://localhost");
d.addComponent(BorderLayout.CENTER, wb);