Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Wrong tiles after map source change #183

ManuelRiegler opened this Issue Jul 20, 2012 · 2 comments


None yet
2 participants

If you change the RMMapContents' tile source at runtime it happens that tiles from the "old" tile source are displayed and it ends up in a "wonderful" map tile mix. It looks like that the problem is somewhere at the DB (sql) cache, cause tiles are stored to the wrong DB cache.

There have been already discussions, but since that the problem still exists:

removeAllCachedTiles is not really an option and [[NSURLCache sharedURLCache] removeAllCachedResponses] right before tile source change made it better, but does not fix the problem.


vyskocil commented Jul 20, 2012

Yes this bug is still there, if I remember well the culprit is the iOS NSURLrequest cache not being cleared.
A workaround is to use something like that after changing the tile source :

// workaround to update display
[self.tilesView moveBy:CGSizeMake(640,960)];
[self.tilesView moveBy:CGSizeMake(-640,-960)]; 

the problem is that somehow tiles are stored into the wrong DB. once stored in the wrong DB, a view "refresh", like the above workaround does not help.

I put some log output into "-(RMTileImage *) tileImage: (RMTile) tile" method in the RMCachedTileSource class to see which tileSource is called and to which DB the tiles are stored. I made map changes like Alpstein -> OCM -> GoogleMap -> GoogleSatellite ...always correct unit GoogleSatellite!! at GoogleSatellite the tiles were first stored correctly to its corresponding DB, but right after the tile source changed "MAGICALLY" to Alpstein and stored the tiles also in this DB!

I really dont know why!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment