AWFLegendMetadata
Objective-C
@interface AWFLegendMetadata : NSObject
Swift
class AWFLegendMetadata : NSObject
An AWFLegendMetadata
object is responsible for requesting legend metadata from the Aeris API and setting up and maintaining the necessary legend
configuration instances for the legends currently supported.
-
The cached legend configurations keyed by identifier. The identifier will be a
AWFLegendCode
string value.Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) NSDictionary<NSString *, AWFLegendConfig *> *config;
Swift
var config: [String : AWFLegendConfig]? { get }
-
A Boolean value indicating whether the required legend metadata has been loaded and configuration objects instantiated.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL hasLoaded;
Swift
var hasLoaded: Bool { get }
-
Tells the object to request the legend metadata from the Aeris API and setup the legend configuration instances.
Declaration
Objective-C
- (void)getWithCompletion:(nonnull void (^)(void))completionBlock;
Swift
func getWithCompletion(_ completionBlock: @escaping () -> Void)
Parameters
completionBlock
The block to execute once all legend configuration instances have been setup.
-
Returns the legend configuration instance associated with the specified key.
Declaration
Objective-C
- (nullable AWFLegendConfig *)configForKey:(nonnull NSString *)key;
Swift
func config(forKey key: String) -> AWFLegendConfig?
Parameters
key
The key to return the configuration for.
-
Returns the legend configuration instance associated with the specified layer type.
Declaration
Objective-C
- (nullable AWFLegendConfig *)configForLayerType:(nonnull AWFMapLayer)code;
Swift
func config(forLayerType code: AWFMapLayer) -> AWFLegendConfig?
Parameters
code
The layer type to return the configuration for.
-
Returns the default legend style associated with the specified layer type.
Declaration
Objective-C
- (nullable AWFLegendStyle *)styleForLayerType:(nonnull AWFMapLayer)code;
Swift
func style(forLayerType code: AWFMapLayer) -> AWFLegendStyle?
Parameters
code
The layer type to return the style for.
-
Returns the title for the legend associated with the specified legend key.
Declaration
Objective-C
- (nullable NSString *)titleForKey:(nonnull NSString *)key;
Swift
func title(forKey key: String) -> String?
Parameters
key
The legend key to return a title for.
-
The singleton instance.
Declaration
Objective-C
+ (nonnull instancetype)sharedInstance;
Swift
class func sharedInstance() -> Self