[PATCH 1 of 8] Try to load default zoom scales if no zoom scale defined for the current river
Wald Commits
scm-commit at wald.intevation.org
Thu Mar 6 15:22:26 CET 2014
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1394110956 -3600
# Branch minfo-opt
# Node ID fac461c67d24d2f877d2142f563446b636be2f11
# Parent a18c97f9d7520556a880caec7620f694a869c41b
Try to load default zoom scales if no zoom scale defined for the current river.
diff -r a18c97f9d752 -r fac461c67d24 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ZoomScale.java
--- 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);
More information about the Dive4elements-commits
mailing list