Issue #3686 fix kml export when maps are the only thing loaded

Change-Id: I4741da935b0ef24bd8d0d0d114151404038828a0

Former-commit-id: 446e0bcdf6 [formerly 446e0bcdf6 [formerly 9dac0fcf997feeecdd8c581ae8fd72581c32d095]]
Former-commit-id: 9025e166dd
Former-commit-id: 00adad9546
This commit is contained in:
Nate Jensen 2014-10-06 15:41:42 -05:00
parent 074e12da64
commit 7d4f951822

View file

@ -102,7 +102,7 @@ import de.micromata.opengis.kml.v_2_2_0.Vec2;
* ------------- -------- ----------- --------------------------
* Jun0 6, 2012 bsteffen Initial creation
* Jan 23, 2014 2703 bsteffen Use framesInfo for frame count.
*
* Oct 06, 2014 3686 njensen Ensure lastIndex is at least 1
*
* </pre>
*
@ -305,6 +305,8 @@ public class KmlExportJob extends Job {
int lastIndex = options.getLastFrameIndex();
lastIndex = Math.min(lastIndex, descriptor.getFramesInfo()
.getFrameCount());
// in case there's zero frames (i.e. all time agnostic)
lastIndex = Math.max(lastIndex, 1);
rscmonitor.beginTask("Saving " + rsc.getName(), lastIndex
- startIndex);
DataTime[] times = descriptor.getFramesInfo().getTimeMap()
@ -321,6 +323,7 @@ public class KmlExportJob extends Job {
}
}
}
List<DataTime> pastFrames = new ArrayList<DataTime>();
for (int i = startIndex; i < lastIndex; i += 1) {
descriptor.setFramesInfo(new FramesInfo(i));