RMShape Class Reference
Inherits from | RMMapLayer : CAScrollLayer |
Declared in | RMShape.h |
Overview
An RMShape object is used to represent a line, polygon, or other shape composed of two or more points connected by lines. An RMShape object changes visible size in response to map zooms in order to consistently represent coverage of the same geographic area.
Tasks
Creating Shape Objects
Accessing the Drawing Properties
-
lineColor
property -
fillColor
property -
fillPatternImage
property -
lineWidth
property -
pathBoundingBox
property -
additionalTouchPadding
property
Drawing Shapes
-
– moveToProjectedPoint:
-
– moveToScreenPoint:
-
– moveToCoordinate:
-
– addLineToProjectedPoint:
-
– addLineToScreenPoint:
-
– addLineToCoordinate:
-
– addCurveToCoordinate:controlCoordinate1:controlCoordinate2:
-
– addQuadCurveToCoordinate:controlCoordinate:
-
– addCurveToProjectedPoint:controlProjectedPoint1:controlProjectedPoint2:
-
– addQuadCurveToProjectedPoint:controlProjectedPoint:
-
– performBatchOperations:
-
– closePath
Properties
additionalTouchPadding
An additional pixel area around the shape that is applied to touch hit testing events. Defaults to none.
@property (nonatomic, assign) CGFloat additionalTouchPadding
Discussion
An additional pixel area around the shape that is applied to touch hit testing events. Defaults to none.
Declared In
RMShape.h
fillColor
The fill color of the shape. Defaults to clear.
@property (nonatomic, strong) UIColor *fillColor
Discussion
The fill color of the shape. Defaults to clear.
Declared In
RMShape.h
fillPatternImage
The fill pattern image of the shape. If set, the fillColor is set to nil
.
@property (nonatomic, strong) UIImage *fillPatternImage
Discussion
The fill pattern image of the shape. If set, the fillColor is set to nil
.
Declared In
RMShape.h
lineColor
The line color of the shape. Defaults to black.
@property (nonatomic, strong) UIColor *lineColor
Discussion
The line color of the shape. Defaults to black.
Declared In
RMShape.h
Instance Methods
addCurveToCoordinate:controlCoordinate1:controlCoordinate2:
Draw a curve from the current pen location to a coordinate.
- (void)addCurveToCoordinate:(CLLocationCoordinate2D)coordinate controlCoordinate1:(CLLocationCoordinate2D)controlCoordinate1 controlCoordinate2:(CLLocationCoordinate2D)controlCoordinate2
Parameters
- coordinate
The coordinate to draw to.
- controlCoordinate1
The first control coordinate.
- controlCoordinate2
The second control coordinate.
Discussion
Draw a curve from the current pen location to a coordinate.
Declared In
RMShape.h
addCurveToProjectedPoint:controlProjectedPoint1:controlProjectedPoint2:
Draw a curve from the current pen location to a projected point.
- (void)addCurveToProjectedPoint:(RMProjectedPoint)projectedPoint controlProjectedPoint1:(RMProjectedPoint)controlProjectedPoint1 controlProjectedPoint2:(RMProjectedPoint)controlProjectedPoint2
Parameters
- projectedPoint
The projected point to draw to.
- controlProjectedPoint1
The first control projected point.
- controlProjectedPoint2
The second control projected point.
Discussion
Draw a curve from the current pen location to a projected point.
Declared In
RMShape.h
addLineToCoordinate:
Draw a line from the current pen location to a coordinate.
- (void)addLineToCoordinate:(CLLocationCoordinate2D)coordinate
Parameters
- coordinate
The coordinate to draw to.
Discussion
Draw a line from the current pen location to a coordinate.
Declared In
RMShape.h
addLineToProjectedPoint:
Draw a line from the current pen location to a projected point.
- (void)addLineToProjectedPoint:(RMProjectedPoint)projectedPoint
Parameters
- projectedPoint
The projected point to draw to.
Discussion
Draw a line from the current pen location to a projected point.
Declared In
RMShape.h
addLineToScreenPoint:
Draw a line from the current pen location to a screen point.
- (void)addLineToScreenPoint:(CGPoint)point
Parameters
- point
The screen point to draw to.
Discussion
Draw a line from the current pen location to a screen point.
Declared In
RMShape.h
addQuadCurveToCoordinate:controlCoordinate:
Draw a quad curve from the current pen location to a coordinate.
- (void)addQuadCurveToCoordinate:(CLLocationCoordinate2D)coordinate controlCoordinate:(CLLocationCoordinate2D)controlCoordinate
Parameters
- coordinate
The coordinate to draw to.
- controlCoordinate
The control coordinate.
Discussion
Draw a quad curve from the current pen location to a coordinate.
Declared In
RMShape.h
addQuadCurveToProjectedPoint:controlProjectedPoint:
Draw a quad curve from the current pen location to a projected point.
- (void)addQuadCurveToProjectedPoint:(RMProjectedPoint)projectedPoint controlProjectedPoint:(RMProjectedPoint)controlProjectedPoint
Parameters
- projectedPoint
The projected point to draw to.
- controlProjectedPoint
The control projected point.
Discussion
Draw a quad curve from the current pen location to a projected point.
Declared In
RMShape.h
closePath
Closes the path, connecting the last point to the first. After this action, no further points can be added to the path.
- (void)closePath
Discussion
Closes the path, connecting the last point to the first. After this action, no further points can be added to the path.
There is no requirement that a path be closed.
Declared In
RMShape.h
initWithView:
Initializes and returns a newly allocated shape object for the specified map view.
- (id)initWithView:(RMMapView *)aMapView
Parameters
- aMapView
The map view the shape should be drawn on.
Discussion
Initializes and returns a newly allocated shape object for the specified map view.
Declared In
RMShape.h
moveToCoordinate:
Move the drawing pen to a coordinate.
- (void)moveToCoordinate:(CLLocationCoordinate2D)coordinate
Parameters
- coordinate
The coordinate to move to.
Discussion
Move the drawing pen to a coordinate.
Declared In
RMShape.h
moveToProjectedPoint:
Move the drawing pen to a projected point.
- (void)moveToProjectedPoint:(RMProjectedPoint)projectedPoint
Parameters
- projectedPoint
The projected point to move to.
Discussion
Move the drawing pen to a projected point.
Declared In
RMShape.h
moveToScreenPoint:
Move the drawing pen to a screen point.
- (void)moveToScreenPoint:(CGPoint)point
Parameters
- point
The screen point to move to.
Discussion
Move the drawing pen to a screen point.
Declared In
RMShape.h
performBatchOperations:
Alter the path without rerecalculating the geometry. Recommended for many operations in order to increase performance.
- (void)performBatchOperations:(void ( ^ ) ( RMShape *aShape ))block
Parameters
- block
A block containing the operations to perform.
Discussion
Alter the path without rerecalculating the geometry. Recommended for many operations in order to increase performance.
Declared In
RMShape.h