Skip to content

Commit

Permalink
Fix IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
rjolly committed May 9, 2022
1 parent 162f3ed commit db15058
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions maps/src/main/java/com/gluonhq/impl/maps/TileImageView.java
Original file line number Diff line number Diff line change
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 db15058

Please sign in to comment.