Skip to content

Commit

Permalink
Fix IndexOutOfBoundsException (#68)
Browse files Browse the repository at this point in the history
* Fix IndexOutOfBoundsException

Fixes #67

* Update copyright
  • Loading branch information
rjolly authored May 22, 2022
1 parent 162f3ed commit a99da5d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions maps/src/main/java/com/gluonhq/impl/maps/TileImageView.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Gluon
* Copyright (c) 2020, 2022, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,6 +29,7 @@

import com.gluonhq.maps.tile.TileRetriever;
import com.gluonhq.maps.tile.TileRetrieverProvider;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanWrapper;
import javafx.beans.property.ReadOnlyDoubleProperty;
Expand Down Expand Up @@ -67,9 +68,11 @@ public TileImageView(int zoom, long i, long j) {
return image;
}).thenAccept(file -> {
logger.fine("Tile from downloaded file " + zoom + "/" + i + "/" + j);
downloading.setValue(false);
setImage(file);
setProgress(1);
Platform.runLater(() -> {
downloading.setValue(false);
setImage(file);
setProgress(1);
});
});
} else {
logger.fine("Tile from file cache");
Expand Down

0 comments on commit a99da5d

Please sign in to comment.