Authored by Tracy Harton

- fix for valid < 512 byte tiles

- Don't cache "missing" proxy tile
... ... @@ -37,5 +37,6 @@
+(UIImage*) errorTile;
+(UIImage*) loadingTile;
+(UIImage*) missingTile;
@end
... ...
... ... @@ -31,6 +31,7 @@
static UIImage *_errorTile = nil;
static UIImage *_loadingTile = nil;
static UIImage *_missingTile = nil;
+ (UIImage*) errorTile
{
... ... @@ -48,4 +49,12 @@ static UIImage *_loadingTile = nil;
return _loadingTile;
}
+ (UIImage*) missingTile
{
if (_missingTile) return _missingTile;
_missingTile = [[UIImage imageNamed:@"missing.png"] retain];
return _missingTile;
}
@end
... ...
... ... @@ -155,7 +155,7 @@
/// \bug magic number
else if(statusCode == 404) // Not Found
{
[self updateImageUsingData:UIImagePNGRepresentation([UIImage imageNamed:@"missing.png"])];
[super displayProxy:[RMTileProxy missingTile]];
[self cancelLoading];
}
else // Other Error
... ... @@ -217,9 +217,9 @@
- (void)connectionDidFinishLoading:(NSURLConnection *)_connection
{
/// \bug magic number
if ([data length] < 512) {
if ([data length] == 0) {
//RMLog(@"connectionDidFinishLoading %@ data size %d", _connection, [data length]);
/// \bug magic number
retryCode = 512;
[self requestTile];
}
... ...