]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - src/tim/prune/gui/map/MapTileManager.java
Never overzoom when initially opening a track
[GpsPrune.git] / src / tim / prune / gui / map / MapTileManager.java
index 8c2c6eed9e3f7e70ccf251ba91e01ebe4f550be9..233e4d9cfdac9d96f356e2bd4e2de57c500015bd 100644 (file)
@@ -70,10 +70,19 @@ public class MapTileManager implements ImageObserver
         * @return true if zoom is too high for tiles
         */
        public boolean isOverzoomed()
+       {
+               return _zoom > getMaxZoomLevel();
+       }
+
+       /**
+        * @return the maximum useable zoom level for tiles
+        */
+       public int getMaxZoomLevel()
        {
                // Ask current map source what maximum zoom is
                int maxZoom = (_mapSource == null?0:_mapSource.getMaxZoomLevel());
-               return (_zoom > maxZoom);
+               return maxZoom;
+
        }
 
        /**
@@ -210,6 +219,9 @@ public class MapTileManager implements ImageObserver
                                }
                        }
                        catch (MalformedURLException urle) {} // ignore
+                       catch (CacheFailure cf) {
+                               _consumer.reportCacheFailure();
+                       }
                }
                return tileImage;
        }