root.appendChild(viewportEl);
Element centerEl = doc.createElement("center");
viewportEl.appendChild(centerEl);
EastNorth center = Main.map.mapView.getCenter();
LatLon centerLL = Projections.inverseProject(center);
centerEl.setAttribute("lat", Double.toString(centerLL.lat()));
centerEl.setAttribute("lon", Double.toString(centerLL.lon()));
Element scale = doc.createElement("scale");
viewportEl.appendChild(scale);
double dist100px = Main.map.mapView.getDist100Pixel();
scale.setAttribute("meter-per-pixel", Double.toString(dist100px / 100));