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
Thomas Rasch
13 years ago
Commit
a6b1a109cc7f1a58f095198afe543ad1931cce4a
1 parent
a11c19a1
Backported from route-me: Line shadows for RMPath
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletions
MapView/Map/RMPath.h
MapView/Map/RMPath.m
samples/LayeredMap/LayeredMap.xcodeproj/project.pbxproj
MapView/Map/RMPath.h
View file @
a6b1a10
...
...
@@ -69,6 +69,11 @@
size_t
_lineDashCount
;
CGFloat
lineDashPhase
;
// Line shadow
CGFloat
shadowBlur
;
CGSize
shadowOffset
;
BOOL
enableShadow
;
BOOL
scaleLineWidth
;
BOOL
scaleLineDash
;
// if YES line dashes will be scaled to keep a constant size if the layer is zoomed
...
...
@@ -86,6 +91,9 @@
@property
(
nonatomic
,
assign
)
BOOL
scaleLineDash
;
@property
(
nonatomic
,
assign
)
float
lineWidth
;
@property
(
nonatomic
,
assign
)
BOOL
scaleLineWidth
;
@property
(
nonatomic
,
assign
)
CGFloat
shadowBlur
;
@property
(
nonatomic
,
assign
)
CGSize
shadowOffset
;
@property
(
nonatomic
,
assign
)
BOOL
enableShadow
;
@property
(
nonatomic
,
retain
)
UIColor
*
lineColor
;
@property
(
nonatomic
,
retain
)
UIColor
*
fillColor
;
@property
(
nonatomic
,
readonly
)
CGRect
pathBoundingBox
;
...
...
MapView/Map/RMPath.m
View file @
a6b1a10
...
...
@@ -36,6 +36,9 @@
@synthesize
scaleLineWidth
;
@synthesize
lineDashPhase
;
@synthesize
scaleLineDash
;
@synthesize
shadowBlur
;
@synthesize
shadowOffset
;
@synthesize
enableShadow
;
@synthesize
pathBoundingBox
;
#define kDefaultLineWidth 2
...
...
@@ -64,6 +67,10 @@
_scaledLineDashLengths
=
NULL
;
lineDashPhase
=
0
.
0
;
self
.
shadowBlur
=
0
.
0
;
self
.
shadowOffset
=
CGSizeMake
(
0
,
0
);
self
.
enableShadow
=
NO
;
self
.
masksToBounds
=
YES
;
scaleLineWidth
=
NO
;
...
...
@@ -274,6 +281,9 @@
if
(
_lineDashLengths
)
CGContextSetLineDash
(
theContext
,
lineDashPhase
,
dashLengths
,
_lineDashCount
);
if
(
self
.
enableShadow
)
CGContextSetShadow
(
theContext
,
self
.
shadowOffset
,
self
.
shadowBlur
);
// according to Apple's documentation, DrawPath closes the path if it's a filled style, so a call to ClosePath isn't necessary
CGContextDrawPath
(
theContext
,
drawingMode
);
}
...
...
samples/LayeredMap/LayeredMap.xcodeproj/project.pbxproj
View file @
a6b1a10
...
...
@@ -61,7 +61,7 @@
2BE5B5030F7AF56F00EF8CC6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
2BE5B5070F7AF58000EF8CC6 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
2BE5B5090F7AF58900EF8CC6 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
32CA4F630368D1EE00C91783 /* LayeredMap_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; path = LayeredMap_Prefix.pch; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* LayeredMap_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4;
lastKnownFileType = sourcecode.c.h;
path = LayeredMap_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
...
...
Please
register
or
login
to post a comment