Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9618)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9619)
@@ -19,5 +19,4 @@
 import javax.swing.ImageIcon;
 
-import org.openstreetmap.gui.jmapviewer.OsmMercator;
 import org.openstreetmap.gui.jmapviewer.interfaces.Attributed;
 import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
@@ -221,5 +220,5 @@
         @pref Map<String, List<String>> noTileHeaders;
         @pref Map<String, List<String>> noTileChecksums;
-        @pref int tileSize = OsmMercator.DEFAUL_TILE_SIZE;
+        @pref int tileSize = -1;
         @pref Map<String, String> metadataHeaders;
         @pref boolean valid_georeference;
Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 9618)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 9619)
@@ -594,9 +594,7 @@
      */
     public void initProjection(Projection proj) {
-        String layerName = null;
-        if (currentLayer != null) {
-            layerName = currentLayer.name;
-        }
-        Collection<Layer> candidates = getLayers(layerName, proj.toCode());
+        // getLayers will return only layers matching the name, if the user already choose the layer
+        // so we will not ask the user again to chose the layer, if he just changes projection
+        Collection<Layer> candidates = getLayers(currentLayer != null ? currentLayer.name : null, proj.toCode());
         if (!candidates.isEmpty()) {
             Layer newLayer = userSelectLayer(candidates);
@@ -610,9 +608,17 @@
     }
 
+    /**
+     *
+     * @param name of the layer to match
+     * @param projectionCode projection code to match
+     * @return Collection of layers matching the name of the layer and projection, or only projection if name is not provided
+     */
     private Collection<Layer> getLayers(String name, String projectionCode) {
         Collection<Layer> ret = new ArrayList<>();
-        for (Layer layer: this.layers) {
-            if ((name == null || name.equals(layer.name)) && (projectionCode == null || projectionCode.equals(layer.tileMatrixSet.crs))) {
-                ret.add(layer);
+        if (this.layers != null) {
+            for (Layer layer: this.layers) {
+                if ((name == null || name.equals(layer.name)) && (projectionCode == null || projectionCode.equals(layer.tileMatrixSet.crs))) {
+                    ret.add(layer);
+                }
             }
         }
@@ -621,6 +627,14 @@
 
     @Override
-    public int getDefaultTileSize() {
-        return getTileSize();
+    public int getTileSize() {
+        // no support for non-square tiles (tileHeight != tileWidth)
+        // and for different tile sizes at different zoom levels
+        Collection<Layer> layers = getLayers(null, Main.getProjection().toCode());
+        if (!layers.isEmpty()) {
+            return layers.iterator().next().tileMatrixSet.tileMatrix.first().tileHeight;
+        }
+        // if no layers is found, fallback to default mercator tile size. Maybe it will work
+        Main.warn("WMTS: Could not determine tile size. Using default tile size of: {0}", getDefaultTileSize());
+        return getDefaultTileSize();
     }
 
Index: trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 9618)
+++ trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 9619)
@@ -152,5 +152,5 @@
                         "icon",
                         "tile-size",
-                        "validGeoreference",
+                        "valid-georeference",
                         "epsg4326to3857Supported",
                 }).contains(qName)) {
