MapXL / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

Changing the tile source doesn't clear caches #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If you change the RMMapContents' tile source, the caches aren't cleared.
This causes incorrect tiles to be displayed.

Original issue reported on code.google.com by jose...@gmail.com on 27 Oct 2008 at 2:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The cache should be cleared, not just at load time, but end clients will want to
expose the ability to switch between providers at runtime (eg. to switch between
satellite and road maps).  I would think the RMTile struct is going to need a 
couple
more properties to reflect tile provider and/or perhaps mapType.

Original comment by davigoli@gmail.com on 14 Dec 2008 at 12:53

GoogleCodeExporter commented 8 years ago
Bumping to high; this blocks work in other areas, such as supporting multiple 
map types.

Original comment by davigoli@gmail.com on 19 Dec 2008 at 7:24

GoogleCodeExporter commented 8 years ago
Pretty sure this has been fixed. Can someone verify?

Original comment by jose...@gmail.com on 20 Dec 2008 at 2:57

GoogleCodeExporter commented 8 years ago
It doesn't appear fixed to me.  After setting a new tile source, all 
newly-loaded
tiles are of the new type, but tiles from the old source are still retrieved 
from the
cache and used.

Original comment by foo...@gmail.com on 9 Jan 2009 at 9:06

GoogleCodeExporter commented 8 years ago
This patch adds methods to empty the map caches.  To use a different tileset, 
empty
the cache before changing the tile source, like this:

[mapContents emptyCache];
mapContents.tileSource = newTileSource;

Original comment by foo...@gmail.com on 16 Jan 2009 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
If you use different tiles from Virtual Earth when you change the .tileSource, 
you also need to clear the cache 
for the 'new' tileSource as well. Otherwise, you may get 'satellite' images vs. 
'road' images - depending on 
what was last in the database cache.  So, I would do this:
[mapContents emptyCache];
mapContents.tilesource = newTileSource;
[mapContents emptyCache];

that will clear any 'old' tiles out of the 'new' tile source.

Original comment by ggces...@gmail.com on 18 Feb 2009 at 5:18

GoogleCodeExporter commented 8 years ago
I've applied this patch to a repository copy and will test as soon as I can.

Original comment by halmuel...@gmail.com on 3 Mar 2009 at 9:25

GoogleCodeExporter commented 8 years ago
Vladimir Vyskocil posted this to the mailing list:

I don't understand this because in my project I can switch from
several source (openstreetmap, virtualearth,..) and there are one
sqlite cache db file per source in Documents directory, not only one
for all the sources. But It's true that displayed tiles aren't updated
with the current image as soon as I switch the source, I must scroll
or zoom in/ou to display the good images. So I think the bug lies in
the memory cache only not in the db.

Original comment by halmuel...@gmail.com on 3 Mar 2009 at 11:18

GoogleCodeExporter commented 8 years ago

Original comment by halmuel...@gmail.com on 4 Mar 2009 at 9:50

GoogleCodeExporter commented 8 years ago
Switching among tile sources now works fairly well, after the change to the 
-uniqueTilecacheKey (which was 
named -description). Run-time switching still does not update the visible 
tiles. As a workaround, use this:
        // workaround to update display
        [self moveBy:CGSizeMake(640,960)];
        [self moveBy:CGSizeMake(-640,-960)];

Original comment by halmuel...@gmail.com on 28 Mar 2009 at 9:14

GoogleCodeExporter commented 8 years ago
My issue is similar to this, but I'm not changing the tilesource.  In my 
project, I have a zip search and when i, 
for example, go from the east coast to a west coast zip code, I move the map 
and I get the white background 
with the greyish grid lines running through as my "map" because the tiles 
weren't loaded.  I've tried clearing 
the cache and after I move the map, reallocating the tilesource but still get 
the same results.  I'm looking for a 
reload/refresh tilesource.  I'm fine with writing this myself as all it would 
need to do is clear the tilesource 
cache and then call some code to basically go and reload the tiles for where my 
map coordinates are at.  

 I'm fairly new with this, so any patience is very much appreciated.

Thanks!

Original comment by heru...@gmail.com on 29 Jul 2009 at 5:02

GoogleCodeExporter commented 8 years ago
Seriously? You want to nuke a 250 MB cache every time you jump to a new 
position?

There's a missing piece somewhere that refreshes the onscreen maps. It just 
takes someone with some 
time/patience to dig in and find it. 

You'll get more eyeballs and help if you bring this up on the mailing list.

Original comment by halmuel...@gmail.com on 29 Jul 2009 at 6:45

GoogleCodeExporter commented 8 years ago
No i don't need to blow away the cache, I was just saying that because of the 
above 
posts.  I just want to manually reload the tile source at the new location that 
I 
went to because when i call the [mapView moveToLatLong:newLocation] the tile 
source 
isn't updated automatically for me.  It just shows the white/grey grid lines 
until I 
zoom in/out to make the tiles reload based off of my zoom level.  

FYI...I'm currently in the zoom logic to see what code is executed to 
reload/refresh 
the tiles so i can see if i can call that in the code when i do the zip search. 

Original comment by heru...@gmail.com on 29 Jul 2009 at 7:37

GoogleCodeExporter commented 8 years ago
I found that if i call moveToLocation by using [ 
performSelectorOnMainThread:....] it
works fine and get all tiles .  but if i call moveToLocation directly from 
somewhere
(Not from another Thread!) it cause bug described by herubin.

Original comment by vit...@gmail.com on 7 Jun 2010 at 4:05

GoogleCodeExporter commented 8 years ago
In addition to previous . RMPath and markers also visible on map , but  when 
moving
map to new coordinates part of path that were out of visible area, not showed . 

Original comment by vit...@gmail.com on 7 Jun 2010 at 4:18