MPLocationDisplayRule
@interface MPLocationDisplayRule
This class serves as a display rule for locations.
-
Name/identifier of the rule. Also used as the rule condition for the location categories.
Declaration
Objective-C
@property (assign, readwrite, atomic) NSString *name;
Swift
var name: String! { get set }
-
The map zoom level above which the location marker should be visible.
Declaration
Objective-C
@property (assign, readwrite, atomic) NSNumber *zOn;
Swift
var zOn: NSNumber! { get set }
-
The map zoom level beneath which the location marker should be visible.
Declaration
Objective-C
@property (assign, readwrite, atomic) NSNumber *zOff;
Swift
var zOff: NSNumber! { get set }
-
Relative path of the marker icon to use, without extension. Format is png.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSString *iconPath;
Swift
var iconPath: String! { get set }
-
Label template for the resulting location marker - e.g.
{{name}}
,{{roomId}}
,Room #{{roomId}}
etc..Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSString *label;
Swift
var label: String! { get set }
-
The marker icon to use on markers that apply to the display rule.
Declaration
Objective-C
@property (assign, readwrite, atomic) UIImage *icon;
Swift
var icon: UIImage! { get set }
-
Whether or not to show a text label instead of the icon.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL showLabel;
Swift
var showLabel: Bool { get set }
-
Whether or not to show the icon.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL visible;
Swift
var visible: Bool { get set }
-
Processes the rule conditions at the given map zoom level. - parameter: zLevel The current map zoom level. - returns: Whether or not to show the location.
Declaration
Objective-C
- (BOOL)show:(CGFloat)zLevel;
Swift
func show(_ zLevel: CGFloat) -> Bool
Parameters
zLevel
The current map zoom level.
Return Value
Whether or not to show the location.
-
Get the icon from the display rule, regardless of conditions. - returns: An instance of UIImage.
Declaration
Objective-C
- (UIImage *)getIcon;
Swift
func getIcon() -> UIImage!
Return Value
An instance of UIImage.
-
Get the label from the display rule, based on the location input. - returns: An string.
Declaration
Objective-C
- (NSString *)getLabelContent:(MPLocation *)location;
Swift
func getLabelContent(_ location: MPLocation!) -> String!
Return Value
An string.
-
Retrieve the icon from the ressources and store in memory.
Declaration
Objective-C
- (void)fetchIcon:(NSString *)basePathOrBundle;
Swift
func fetchIcon(_ basePathOrBundle: String!)
-
Instantiate a display rule with parameters. - parameter: name The name and identifier of the rule. - parameter: zOn The map zoom level above which the location marker should display. - parameter: doShowLabel Whether or not to show a text label instead of the icon.
Declaration
Objective-C
- (id)initWithName:(NSString *)name AndZoomLevelOn:(CGFloat)zOn AndShowLabel:(BOOL)doShowLabel;
Swift
init!(name: String!, andZoomLevelOn zOn: CGFloat, andShowLabel doShowLabel: Bool)
Parameters
name
The name and identifier of the rule.
zOn
The map zoom level above which the location marker should display.
doShowLabel
Whether or not to show a text label instead of the icon.
-
Instantiate a display rule with parameters. - parameter: name The name and identifier of the rule. - parameter: icon The icon used to display locations that qualify conditions of this rule. - parameter: zOn The map zoom level above which the location marker should display.
Declaration
Objective-C
- (id)initWithName:(NSString *)name AndIcon:(UIImage *)icon AndZoomLevelOn:(CGFloat)zOn;
Swift
init!(name: String!, andIcon icon: UIImage!, andZoomLevelOn zOn: CGFloat)
Parameters
name
The name and identifier of the rule.
icon
The icon used to display locations that qualify conditions of this rule.
zOn
The map zoom level above which the location marker should display.
-
Instantiate a display rule with parameters. - parameter: name The name and identifier of the rule. - parameter: icon The icon used to display locations that qualify conditions of this rule. - parameter: zOn The map zoom level above which the location marker should display. - parameter: doShowLabel Whether or not to show a text label instead of the icon.
Declaration
Objective-C
- (id)initWithName:(NSString *)name AndIcon:(UIImage *)icon AndZoomLevelOn:(CGFloat)zOn AndShowLabel:(BOOL)doShowLabel;
Swift
init!(name: String!, andIcon icon: UIImage!, andZoomLevelOn zOn: CGFloat, andShowLabel doShowLabel: Bool)
Parameters
name
The name and identifier of the rule.
icon
The icon used to display locations that qualify conditions of this rule.
zOn
The map zoom level above which the location marker should display.
doShowLabel
Whether or not to show a text label instead of the icon.
-
Defered instantiate a display rule with parameters. - parameter: name The name and identifier of the rule. - parameter: URL The icon URL used to display locations that qualify conditions of this rule. - parameter: zOn The map zoom level above which the location marker should display. - parameter: doShowLabel Whether or not to show a text label instead of the icon.
Declaration
Objective-C
- (id)initWithName:(NSString *)name AndIconURL:(NSString *)iconURL AndZoomLevelOn:(CGFloat)zOn AndShowLabel:(BOOL)doShowLabel;
Swift
init!(name: String!, andIconURL iconURL: String!, andZoomLevelOn zOn: CGFloat, andShowLabel doShowLabel: Bool)
Parameters
name
The name and identifier of the rule.
URL
The icon URL used to display locations that qualify conditions of this rule.
zOn
The map zoom level above which the location marker should display.
doShowLabel
Whether or not to show a text label instead of the icon.