Skip to content
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

update tiles frequently #55

Open
newten82 opened this issue Jan 22, 2015 · 1 comment
Open

update tiles frequently #55

newten82 opened this issue Jan 22, 2015 · 1 comment
Labels

Comments

@newten82
Copy link

I have a raster layer with a custom httpDataSource that pulls a small set of tiles. The tiles need to be updated about twice a second. I was able to get the layer to update the tiles by calling reloadTiles() on the data source. However this causes the screen to flicker as the old tile is removed then goes to empty background which then goes to the new tile. All of which takes enough time to see it flash.

is there a way to smoothly transition between new and old tiles. I tried layer.updateVisibleTiles() but that doesn't seem to do anything.

I've tried the following settings with no luck.
mapOptions.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
layer.setMemoryCaching(false);
layer.setPersistentCaching(false);
layer.setTileFading(true);

@newten82
Copy link
Author

I found a work around that appears to work. In my data source I maintain a list of tiles that I need to refresh. Then I added a timer in my raster layer to periodically call fetchTile for each in the list from the data source. This gives me the smooth update to the tile. I believe the flashing was caused by the textureMemoryCache clearing out prior to loading the new tile.

Whenever a tile fails to load some background thread continues to poll for it. If the tile is found it stops polling. What I was looking for was a way to keep polling the tiles on a regular interval even if they loaded. Still wonder if there is a better way to do this.

@jaakla jaakla added the ready label Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants