Authored by Thomas Rasch

o Fixed some merge problems

... ... @@ -185,6 +185,38 @@
}
}
if (mapView.debugTiles)
{
UIGraphicsBeginImageContext(tileImage.size);
CGContextRef debugContext = UIGraphicsGetCurrentContext();
CGRect debugRect = CGRectMake(0, 0, tileImage.size.width, tileImage.size.height);
[tileImage drawInRect:debugRect];
CGColorRef color = CGColorCreateCopyWithAlpha([[UIColor redColor] CGColor], 0.25);
UIFont *font = [UIFont systemFontOfSize:36.0];
CGContextSetStrokeColorWithColor(debugContext, color);
CGContextSetLineWidth(debugContext, 5.0);
CGContextStrokeRect(debugContext, debugRect);
CGContextSetFillColorWithColor(debugContext, color);
NSString *debugString = [NSString stringWithFormat:@"%i,%i,%i", zoom, x, y];
CGSize debugSize = [debugString sizeWithFont:font];
[debugString drawInRect:CGRectMake(5.0, 5.0, debugSize.width, debugSize.height) withFont:font];
tileImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
[tileImage drawInRect:rect];
UIGraphicsPopContext();
... ...
... ... @@ -143,6 +143,8 @@ typedef enum {
/// subview for the background image displayed while tiles are loading.
@property (nonatomic, retain) UIView *backgroundView;
@property (nonatomic, assign) BOOL debugTiles;
#pragma mark - Initializers
- (id)initWithFrame:(CGRect)frame andTilesource:(id <RMTileSource>)newTilesource;
... ...
... ... @@ -121,6 +121,7 @@
@synthesize enableClustering, positionClusterMarkersAtTheGravityCenter, clusterMarkerSize, clusterAreaSize;
@synthesize adjustTilesForRetinaDisplay;
@synthesize missingTilesDepth;
@synthesize debugTiles;
#pragma mark -
#pragma mark Initialization
... ... @@ -1686,6 +1687,17 @@
return [[mercatorToTileProjection retain] autorelease];
}
- (void)setDebugTiles:(BOOL)shouldDebug;
{
debugTiles = shouldDebug;
for (RMMapTiledLayerView *tiledLayerView in _tiledLayersSuperview.subviews)
{
tiledLayerView.layer.contents = nil;
[tiledLayerView.layer setNeedsDisplay];
}
}
#pragma mark -
#pragma mark LatLng/Pixel translation functions
... ...
... ... @@ -96,6 +96,7 @@
// mapView.decelerationMode = RMMapDecelerationOff;
// mapView.enableBouncing = NO;
// mapView.enableDragging = YES;
// mapView.debugTiles = YES;
// [mapView setConstraintsSouthWest:CLLocationCoordinate2DMake(47.0, 10.0) northEast:CLLocationCoordinate2DMake(48.0, 11.0)];
UIImage *clusterMarkerImage = [UIImage imageNamed:@"marker-blue.png"];
... ...