changeset 7789:fac461c67d24 minfo-opt

Try to load default zoom scales if no zoom scale defined for the current river.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 06 Mar 2014 14:02:36 +0100
parents a18c97f9d752
children 6ed8bc0c461c
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java	Wed Mar 05 19:47:54 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java	Thu Mar 06 14:02:36 2014 +0100
@@ -38,7 +38,11 @@
         double range = Math.abs(upper) - Math.abs(lower);
         TreeMap<Double, Double> ranges = rivers.get(river);
         if (ranges == null) {
-            return 0.001;
+            TreeMap<Double, Double> defaultRanges = rivers.get("default");
+            if (defaultRanges == null) {
+                return 0.001;
+            }
+            ranges = defaultRanges;
         }
         Map.Entry<Double, Double> next = ranges.higherEntry(range);
         Map.Entry<Double, Double> prev = ranges.lowerEntry(range);

http://dive4elements.wald.intevation.org