Index: /trunk/scripts/SyncEditorLayerIndex.groovy
===================================================================
--- /trunk/scripts/SyncEditorLayerIndex.groovy	(revision 11966)
+++ /trunk/scripts/SyncEditorLayerIndex.groovy	(revision 11967)
@@ -17,4 +17,5 @@
  * Add option "-h" to show the available command line flags.
  */
+import java.text.DecimalFormat
 import javax.json.Json
 import javax.json.JsonArray
@@ -48,4 +49,5 @@
      */
     static main(def args) {
+        Locale.setDefault(Locale.ROOT);
         parse_command_line_arguments(args)
         def script = new SyncEditorLayerIndex()
@@ -196,5 +198,20 @@
     }
 
+    String maininfo(def entry, String offset) {
+        String res = offset + "<type>${getType(entry)}</type>\n"
+        res += offset + "<url><![CDATA[${getUrl(entry)}]]></url>\n"
+        if(getType(entry) == "tms") {
+            if(getMinZoom(entry) != null)
+                res += offset + "<min-zoom>${getMinZoom(entry)}</min-zoom>\n"
+            if(getMaxZoom(entry) != null)
+                res += offset + "<max-zoom>${getMaxZoom(entry)}</max-zoom>\n"
+        }
+        return res
+    }
+
+    
     void printentries(def entries, def stream) {
+        DecimalFormat df = new DecimalFormat("#.#######")
+        df.setRoundingMode(java.math.RoundingMode.CEILING)
         stream.write "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
         stream.write "<imagery xmlns=\"http://josm.openstreetmap.de/maps-1.0\">\n"
@@ -204,4 +221,10 @@
             stream.write "        <name>${getName(e)}</name>\n"
             stream.write "        <id>${getId(e)}</id>\n"
+            if(getDate(e) != "")
+                stream.write "        <date>${getDate(e)}</date>\n"
+            stream.write maininfo(e, "        ")
+            for (def m : getMirrors(e)) {
+                    stream.write "        <mirror>\n"+maininfo(m, "            ")+"        </mirror>\n"
+            }
             def minlat = 1000
             def minlon = 1000
@@ -223,13 +246,13 @@
                         shapes += sep + "    "
                     }
-                    shapes += "<point lat='${String.format(Locale.ROOT, "%.7f",lat)}' lon='${String.format(Locale.ROOT, "%.7f",lon)}'/>"
+                    shapes += "<point lat='${df.format(lat)}' lon='${df.format(lon)}'/>"
                 }
                 shapes += sep + "</shape>\n"
             }
             if(shapes) {
-                stream.write "        <bounds min-lat='${minlat}' min-lon='${minlon}' max-lat='${maxlat}' max-lon='${maxlon}'>\n"
+                stream.write "        <bounds min-lat='${df.format(minlat)}' min-lon='${df.format(minlon)}' max-lat='${df.format(maxlat)}' max-lon='${df.format(maxlon)}'>\n"
                 stream.write shapes + "        </bounds>\n"
-                stream.write "    </entry>\n"
-            }
+            }
+            stream.write "    </entry>\n"
         }
         stream.write "</imagery>\n"
@@ -580,4 +603,8 @@
         return e.get("properties").getString("name")
     }
+    static List<Object> getMirrors(Object e) {
+        if (e instanceof ImageryInfo) return e.getMirrors()
+        return []
+    }
     static List<Shape> getShapes(Object e) {
         if (e instanceof ImageryInfo) {
