String desc = wpt.getDesc();
String name = wpt.getName();
name = (name == null) ? "Wpt" : name.trim();
mapjs.append("gpxmap.addWpt({lon:");
mapjs.append(format.asLatLon(wpt.getLon()));
mapjs.append(",lat:").append(format.asLatLon(wpt.getLat()));
mapjs.append(",desc:'<div class=\"wpt-name\">")
.append(name.replace('\'', ' ')).append("</div>");
if (desc != null && desc.length() != 0
&& !desc.trim().equals(name)) {
mapjs.append("<div class=\"wpt-desc\">").append(