Authored by Justin R. Miller

fixes #110: properly query local tile sources

... ... @@ -12,6 +12,8 @@
#import "RMTileSource.h"
#import "RMTileImage.h"
#import "RMTileCache.h"
#import "RMMBTilesSource.h"
#import "RMDBMapSource.h"
@implementation RMMapTiledLayerView
{
... ... @@ -118,6 +120,16 @@
if (zoom >= _tileSource.minZoom && zoom <= _tileSource.maxZoom)
{
if ([_tileSource isKindOfClass:[RMMBTilesSource class]] || [_tileSource isKindOfClass:[RMDBMapSource class]])
{
// for local tiles, query the source directly since trivial blocking
//
tileImage = [_tileSource imageForTile:RMTileMake(x, y, zoom) inCache:[_mapView tileCache]];
}
else
{
// for non-local tiles, consult cache directly first, else fetch asynchronously
//
tileImage = [[_mapView tileCache] cachedImage:RMTileMake(x, y, zoom) withCacheKey:[_tileSource uniqueTilecacheKey]];
if ( ! tileImage)
... ... @@ -134,6 +146,7 @@
});
}
}
}
if ( ! tileImage)
{
... ...