Files
MapLibreParticleLab/platform/darwin/src/MLNVectorStyleLayer.h
mwilsnd 20d9e1028c Platform flattening overhaul (#1393)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-07-26 17:50:34 +02:00

59 lines
2.0 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#import <Foundation/Foundation.h>
#import "MLNFoundation.h"
#import "MLNForegroundStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
/**
`MLNVectorStyleLayer` is an abstract superclass for style layers whose content
is defined by an `MLNShapeSource` or `MLNVectorTileSource` object.
Create instances of `MLNCircleStyleLayer`, `MLNFillStyleLayer`,
`MLNFillExtrusionStyleLayer`, `MLNHeatmapStyleLayer`, `MLNLineStyleLayer`, and
`MLNSymbolStyleLayer` in order to use `MLNVectorStyleLayer`'s properties and
methods. Do not create instances of `MLNVectorStyleLayer` directly, and do not
create your own subclasses of this class.
*/
MLN_EXPORT
@interface MLNVectorStyleLayer : MLNForegroundStyleLayer
// 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;
/**
The style layer’s predicate.
Use the style layer’s predicate to include only the features in the source
layer that satisfy a condition that you define. If the style layer initially
comes from the style, its predicate corresponds to the
<a href="https://maplibre.org/maplibre-style-spec/#layer-filter">`filter`</a>
property in the style JSON.
See the “<a href="../predicates-and-expressions.html">Predicates and Expressions</a>”
guide for details about the predicate syntax supported by this class.
### Example
To filter the layer to include only the features whose `index` attribute is 5
or 10 and whose `ele` attribute is at least 1,500, you could create an
`NSCompoundPredicate` along these lines:
```swift
let layer = MLNLineStyleLayer(identifier: "contour", source: terrain)
layer.sourceLayerIdentifier = "contours"
layer.predicate = NSPredicate(format: "(index == 5 || index == 10) && CAST(ele, 'NSNumber') >= 1500.0")
mapView.style?.addLayer(layer)
```
*/
@property (nonatomic, nullable) NSPredicate *predicate;
@end
NS_ASSUME_NONNULL_END