Authored by Hal Mueller

added Debug-build NSAsserts to verify tiles requested are within legal zoom range

... ... @@ -33,6 +33,9 @@
-(NSString*) tileURL: (RMTile) tile
{
NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
@"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
self, tile.zoom, self.minZoom, self.maxZoom);
return [NSString stringWithFormat:@"http://a.tile.cloudmade.com/0199bdee456e59ce950b0156029d6934/2/%d/%d/%d/%d.png",[RMCloudMadeMapSource tileSideLength], tile.zoom, tile.x, tile.y];
}
... ...
... ... @@ -31,8 +31,15 @@
-(NSString*) tileURL: (RMTile) tile
{
NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
@"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
self, tile.zoom, self.minZoom, self.maxZoom);
return [NSString stringWithFormat:@"http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/%d/%d/%d.png", tile.zoom, tile.x, tile.y];
}
-(NSString*) description
{
return @"OpenAerialMap";
}
@end
... ...
... ... @@ -31,6 +31,9 @@
-(NSString*) tileURL: (RMTile) tile
{
NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
@"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
self, tile.zoom, self.minZoom, self.maxZoom);
return [NSString stringWithFormat:@"http://tile.openstreetmap.org/%d/%d/%d.png", tile.zoom, tile.x, tile.y];
}
... ...
... ... @@ -38,6 +38,9 @@
-(NSString*) quadKeyForTile: (RMTile) tile
{
NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
@"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
self, tile.zoom, self.minZoom, self.maxZoom);
NSMutableString *quadKey = [NSMutableString string];
for (int i = tile.zoom; i > 0; i--)
{
... ...
... ... @@ -691,7 +691,9 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MapView_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=0";
GCC_PREPROCESSOR_DEFINITIONS = (
"NS_BLOCK_ASSERTIONS=1",
);
HEADER_SEARCH_PATHS = ../Proj4;
PREBINDING = NO;
PRODUCT_NAME = MapView;
... ...
... ... @@ -17,5 +17,6 @@
#define RMLog(args...) // do nothing.
#define LogMethod()
#define NS_BLOCK_ASSERTIONS 1
#endif
... ...