Toggle navigation
Toggle navigation
This project
Loading...
Sign in
尹诚
/
Mapbox-iOS-SDK
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Justin R. Miller
13 years ago
Commit
39b591357b0392d2da44d455737f63a8e2e17e78
1 parent
e8512cd1
added tile debug labeling switch
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
MapView/Map/RMMapTiledLayerView.m
MapView/Map/RMMapView.h
MapView/Map/RMMapView.m
MapView/Map/RMMapTiledLayerView.m
View file @
39b5913
...
...
@@ -179,6 +179,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
];
CGContextSetStrokeColorWithColor
(
debugContext
,
color
);
CGContextSetLineWidth
(
debugContext
,
5
);
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
,
5
,
debugSize
.
width
,
debugSize
.
height
)
withFont
:
font
];
tileImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
}
[
tileImage
drawInRect
:
rect
];
UIGraphicsPopContext
();
...
...
MapView/Map/RMMapView.h
View file @
39b5913
...
...
@@ -144,6 +144,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 -
#pragma mark Initializers
...
...
MapView/Map/RMMapView.m
View file @
39b5913
...
...
@@ -118,6 +118,7 @@
@synthesize
enableClustering
,
positionClusterMarkersAtTheGravityCenter
,
clusterMarkerSize
,
clusterAreaSize
;
@synthesize
adjustTilesForRetinaDisplay
;
@synthesize
missingTilesDepth
;
@synthesize
debugTiles
;
#pragma mark -
#pragma mark Initialization
...
...
@@ -1561,6 +1562,15 @@
return
[[
mercatorToTileProjection
retain
]
autorelease
];
}
-
(
void
)
setDebugTiles
:
(
BOOL
)
shouldDebug
;
{
debugTiles
=
shouldDebug
;
tiledLayerView
.
layer
.
contents
=
nil
;
[
tiledLayerView
.
layer
setNeedsDisplay
];
}
#pragma mark -
#pragma mark LatLng/Pixel translation functions
...
...
Please
register
or
login
to post a comment