summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleLayer.h
blob: 763854f44cde7b836d21488c9691d8dfd06c0463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#import <Foundation/Foundation.h>

#import "MGLBaseStyleLayer.h"

NS_ASSUME_NONNULL_BEGIN

@class MGLSource;

/**
 `MGLForegroundStyleLayer` is an abstract superclass for style layers whose
 content is defined by an `MGLSource` object.
 
 Do not create instances of this class directly, and do not create your own
 subclasses of this class. Instead, create instances of `MGLRasterStyleLayer`
 and the concrete subclasses of `MGLVectorStyleLayer`.
 */
@interface MGLForegroundStyleLayer : MGLStyleLayer

#pragma mark Initializing a Style Layer

/**
 Returns a foreground style layer initialized with an identifier and source.
 
 After initializing and configuring the style layer, add it to a map view’s
 style using the `-[MGLStyle addLayer:]` or
 `-[MGLStyle insertLayer:belowLayer:]` method.
 
 @param identifier A string that uniquely identifies the source in the style to
    which it is added.
 @param source The source from which to obtain the data to style. If the source
    has not yet been added to the current style, the behavior is undefined.
 @return An initialized foreground style layer.
 */
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source NS_DESIGNATED_INITIALIZER;

#pragma mark Specifying a Style Layer’s Content

/**
 Identifier of the source from which the receiver obtains the data to style.
 */
@property (nonatomic, readonly, nullable) NSString *sourceIdentifier;

@end

/**
 `MGLVectorStyleLayer` is an abstract superclass for style layers whose content
 is defined by an `MGLGeoJSONSource` or `MGLVectorSource` object.
 
 Do not create instances of this class directly, and do not create your own
 subclasses of this class. Instead, create instances of the following concrete
 subclasses: `MGLCircleStyleLayer`, `MGLFillStyleLayer`, `MGLLineStyleLayer`,
 and `MGLSymbolStyleLayer`.
 */
@interface MGLVectorStyleLayer : MGLForegroundStyleLayer

#pragma mark Refining a Style Layer’s Content

/**
 Identifier of the layer within the source identified by the `sourceIdentifier`
 property from which the receiver obtains the data to style.
 */
@property (nonatomic, nullable) NSString *sourceLayerIdentifier;

/**
 A predicate that corresponds to the layer's <a href='https://www.mapbox.com/mapbox-gl-style-spec/#types-filter'>filter</a>.
 
 The predicate's left expression must be a string that identifies a feature
 property, or one of the special keys.
 */
@property (nonatomic, nullable) NSPredicate *predicate;

@end

NS_ASSUME_NONNULL_END