-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature suggestion: tiles loading/downloading finished notification #82
Comments
Did you have a look at:
|
Yes, i already use it to save System.currentTimeMillis() value and i have a thread to evaluate the time elapsed since last tile loaded and when the timeout is reached i make an event. This method works (with previous release, with some glitch on slow connexion) but with the current release, i have (most of the time) missing tiles. I just did a quick test with no further investigation. The cleaner way (for my case) would be an event to know when all tiles are downloaded.
|
What about getPendingTiles() in AbstractTileFactory? |
I used this method too but you can have a getPendingTiles() == 0 but the tile is not yet loaded because getPendingTiles return tileQueue . size() and in the TileRunner class, at the beginning of the run method you have " final Tile tile = tileQueue . remove();" before loading it.
|
Valid request, I will see what can be done here. |
I came across this ticket as I had the same challenge, and I used a combination of the AtomicInteger numLoadingTiles = new AtomicInteger(0);
DefaultTileFactory tileFactory = new DefaultTileFactory(nodeSettings.getTileFactoryInfo()) {
@Override
protected synchronized void startLoading(Tile tile) {
numLoadingTiles.incrementAndGet();
super.startLoading(tile);
}
};
tileFactory.addTileListener(tile -> numLoadingTiles.decrementAndGet()); This seems to work fine for us -- the counter gets incremented when loading starts, and decremented once the loading has finished. |
It would be very useful to have a notification when tiles cache loading/downloading is finished (with error status).
The text was updated successfully, but these errors were encountered: