[darwin] Simplify MGLStyleLayer initialization and pointer management
Similarly to the previous commit, introduce `-[MGLStyleLayer initWithPendingLayer:]`, allowing the base class to track the owned `_pendingSource` pointer and implement `-addToMapView:` and `-removeFromMapView:` without any casts. Fixes an issue where `-[MGLStyle layerFromMBGLLayer:]` would wind up creating layers whose `_rawLayer` and `_pendingLayer` held different values.
This commit is contained in:
@@ -24,6 +24,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLBackgroundStyleLayer : MGLStyleLayer
|
||||
|
||||
/**
|
||||
Returns a background style layer initialized with an identifier.
|
||||
|
||||
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.
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
|
||||
@@ -2,35 +2,28 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLBackgroundStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/background_layer.hpp>
|
||||
|
||||
@interface MGLBackgroundStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::BackgroundLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::BackgroundLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLBackgroundStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::BackgroundLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier]) {
|
||||
auto layer = std::make_unique<mbgl::style::BackgroundLayer>(identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::BackgroundLayer>(identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer)];
|
||||
}
|
||||
|
||||
- (mbgl::style::BackgroundLayer *)rawLayer
|
||||
@@ -38,51 +31,6 @@
|
||||
return (mbgl::style::BackgroundLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::BackgroundLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::BackgroundLayer *layer = dynamic_cast<mbgl::style::BackgroundLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::BackgroundLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
|
||||
- (void)setBackgroundColor:(MGLStyleValue<MGLColor *> *)backgroundColor {
|
||||
|
||||
@@ -79,6 +79,21 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslationAnchor) {
|
||||
MGL_EXPORT
|
||||
@interface MGLCircleStyleLayer : MGLVectorStyleLayer
|
||||
|
||||
/**
|
||||
Returns a circle 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 - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLCircleStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/circle_layer.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -28,23 +28,16 @@ namespace mbgl {
|
||||
|
||||
@interface MGLCircleStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::CircleLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::CircleLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLCircleStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::CircleLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::CircleLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::CircleLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
- (mbgl::style::CircleLayer *)rawLayer
|
||||
@@ -52,11 +45,6 @@ namespace mbgl {
|
||||
return (mbgl::style::CircleLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::CircleLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -93,46 +81,6 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::CircleLayer *layer = dynamic_cast<mbgl::style::CircleLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::CircleLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
|
||||
- (void)setCircleBlur:(MGLStyleValue<NSNumber *> *)circleBlur {
|
||||
|
||||
@@ -52,6 +52,21 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) {
|
||||
MGL_EXPORT
|
||||
@interface MGLFillStyleLayer : MGLVectorStyleLayer
|
||||
|
||||
/**
|
||||
Returns a fill 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 - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLFillStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/fill_layer.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -23,23 +23,16 @@ namespace mbgl {
|
||||
|
||||
@interface MGLFillStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::FillLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::FillLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLFillStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::FillLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::FillLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::FillLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
- (mbgl::style::FillLayer *)rawLayer
|
||||
@@ -47,11 +40,6 @@ namespace mbgl {
|
||||
return (mbgl::style::FillLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::FillLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -88,46 +76,6 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::FillLayer *layer = dynamic_cast<mbgl::style::FillLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::FillLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
|
||||
- (void)setFillAntialiased:(MGLStyleValue<NSNumber *> *)fillAntialiased {
|
||||
|
||||
@@ -20,23 +20,7 @@ MGL_EXPORT
|
||||
|
||||
#pragma mark Initializing a Style Layer
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("Use -initWithIdentifier:source: instead.")));
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier __attribute__((unavailable("Use -initWithIdentifier:source: instead.")));
|
||||
|
||||
/**
|
||||
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;
|
||||
- (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead.")));
|
||||
|
||||
#pragma mark Specifying a Style Layer’s Content
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#import "MGLForegroundStyleLayer.h"
|
||||
#import "MGLSource.h"
|
||||
|
||||
@implementation MGLForegroundStyleLayer
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source {
|
||||
if (self = [super initWithIdentifier:identifier]) {
|
||||
_sourceIdentifier = source.identifier;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:
|
||||
@"<%@: %p; identifier = %@; sourceIdentifier = %@; visible = %@>",
|
||||
NSStringFromClass([self class]), (void *)self, self.identifier,
|
||||
self.sourceIdentifier, self.visible ? @"YES" : @"NO"];
|
||||
}
|
||||
|
||||
@end
|
||||
29
platform/darwin/src/MGLForegroundStyleLayer.mm
Normal file
29
platform/darwin/src/MGLForegroundStyleLayer.mm
Normal file
@@ -0,0 +1,29 @@
|
||||
#import "MGLForegroundStyleLayer.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLSource.h"
|
||||
|
||||
@implementation MGLForegroundStyleLayer
|
||||
|
||||
- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer source:(MGLSource *)source {
|
||||
if (self = [super initWithRawLayer:rawLayer]) {
|
||||
_sourceIdentifier = source.identifier;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer source:(MGLSource *)source {
|
||||
if (self = [super initWithPendingLayer:std::move(pendingLayer)]) {
|
||||
_sourceIdentifier = source.identifier;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:
|
||||
@"<%@: %p; identifier = %@; sourceIdentifier = %@; visible = %@>",
|
||||
NSStringFromClass([self class]), (void *)self, self.identifier,
|
||||
self.sourceIdentifier, self.visible ? @"YES" : @"NO"];
|
||||
}
|
||||
|
||||
@end
|
||||
20
platform/darwin/src/MGLForegroundStyleLayer_Private.h
Normal file
20
platform/darwin/src/MGLForegroundStyleLayer_Private.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#import "MGLForegroundStyleLayer.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
namespace mbgl {
|
||||
namespace style {
|
||||
class Layer;
|
||||
}
|
||||
}
|
||||
|
||||
@interface MGLForegroundStyleLayer (Private)
|
||||
|
||||
- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer source:(MGLSource *)source;
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer source:(MGLSource *)source;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -107,6 +107,21 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslationAnchor) {
|
||||
MGL_EXPORT
|
||||
@interface MGLLineStyleLayer : MGLVectorStyleLayer
|
||||
|
||||
/**
|
||||
Returns a line 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 - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLLineStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/line_layer.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -35,23 +35,16 @@ namespace mbgl {
|
||||
|
||||
@interface MGLLineStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::LineLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::LineLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLLineStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::LineLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::LineLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::LineLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
- (mbgl::style::LineLayer *)rawLayer
|
||||
@@ -59,11 +52,6 @@ namespace mbgl {
|
||||
return (mbgl::style::LineLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::LineLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -100,46 +88,6 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::LineLayer *layer = dynamic_cast<mbgl::style::LineLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::LineLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
|
||||
- (void)setLineCap:(MGLStyleValue<NSValue *> *)lineCap {
|
||||
|
||||
@@ -23,6 +23,8 @@ MGL_EXPORT
|
||||
|
||||
@property (nonatomic, weak, readonly) MGLMapView *mapView;
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
|
||||
- (void)didMoveToMapView:(MGLMapView *)mapView;
|
||||
|
||||
- (void)willMoveFromMapView:(MGLMapView *)mapView;
|
||||
|
||||
@@ -72,7 +72,7 @@ void MGLFinishCustomStyleLayer(void *context) {
|
||||
*/
|
||||
@interface MGLOpenGLStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::CustomLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::CustomLayer *rawLayer;
|
||||
|
||||
/**
|
||||
The map view whose style currently contains the layer.
|
||||
@@ -84,9 +84,7 @@ void MGLFinishCustomStyleLayer(void *context) {
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLOpenGLStyleLayer {
|
||||
std::unique_ptr<mbgl::style::CustomLayer> _pendingLayer;
|
||||
}
|
||||
@implementation MGLOpenGLStyleLayer
|
||||
|
||||
/**
|
||||
Returns an OpenGL style layer object initialized with the given identifier.
|
||||
@@ -100,26 +98,18 @@ void MGLFinishCustomStyleLayer(void *context) {
|
||||
@return An initialized OpenGL style layer.
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier {
|
||||
if (self = [super initWithIdentifier:identifier]) {
|
||||
auto layer = std::make_unique<mbgl::style::CustomLayer>(identifier.UTF8String,
|
||||
MGLPrepareCustomStyleLayer,
|
||||
MGLDrawCustomStyleLayer,
|
||||
MGLFinishCustomStyleLayer,
|
||||
(__bridge void *)self);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::CustomLayer>(identifier.UTF8String,
|
||||
MGLPrepareCustomStyleLayer,
|
||||
MGLDrawCustomStyleLayer,
|
||||
MGLFinishCustomStyleLayer,
|
||||
(__bridge void *)self);
|
||||
return self = [super initWithPendingLayer:std::move(layer)];
|
||||
}
|
||||
|
||||
- (mbgl::style::CustomLayer *)rawLayer {
|
||||
return (mbgl::style::CustomLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::CustomLayer *)rawLayer {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)setMapView:(MGLMapView *)mapView {
|
||||
@@ -134,22 +124,12 @@ void MGLFinishCustomStyleLayer(void *context) {
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer {
|
||||
self.mapView = mapView;
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{ otherLayer.identifier.UTF8String };
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
[super addToMapView:mapView belowLayer:otherLayer];
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView {
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
[super removeFromMapView:mapView];
|
||||
self.mapView = nil;
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
_pendingLayer = std::move(reinterpret_cast<std::unique_ptr<mbgl::style::CustomLayer> &>(removedLayer));
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,21 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLRasterStyleLayer : MGLForegroundStyleLayer
|
||||
|
||||
/**
|
||||
Returns a raster 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 - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,35 +2,28 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLRasterStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/raster_layer.hpp>
|
||||
|
||||
@interface MGLRasterStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::RasterLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::RasterLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLRasterStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::RasterLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::RasterLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::RasterLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
- (mbgl::style::RasterLayer *)rawLayer
|
||||
@@ -38,11 +31,6 @@
|
||||
return (mbgl::style::RasterLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::RasterLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -50,46 +38,6 @@
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::RasterLayer *layer = dynamic_cast<mbgl::style::RasterLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::RasterLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
|
||||
- (void)setMaximumRasterBrightness:(MGLStyleValue<NSNumber *> *)maximumRasterBrightness {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#import "MGLStyle_Private.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLSource_Private.h"
|
||||
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
@@ -323,39 +324,35 @@ static NSURL *MGLStyleURL_emerald;
|
||||
NSParameterAssert(mbglLayer);
|
||||
|
||||
NSString *identifier = @(mbglLayer->getID().c_str());
|
||||
MGLStyleLayer *styleLayer;
|
||||
|
||||
if (auto fillLayer = mbglLayer->as<mbgl::style::FillLayer>()) {
|
||||
MGLSource *source = [self sourceWithIdentifier:@(fillLayer->getSourceID().c_str())];
|
||||
styleLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:identifier source:source];
|
||||
return [[MGLFillStyleLayer alloc] initWithRawLayer:fillLayer source:source];
|
||||
} else if (auto lineLayer = mbglLayer->as<mbgl::style::LineLayer>()) {
|
||||
MGLSource *source = [self sourceWithIdentifier:@(lineLayer->getSourceID().c_str())];
|
||||
styleLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:identifier source:source];
|
||||
return [[MGLLineStyleLayer alloc] initWithRawLayer:lineLayer source:source];
|
||||
} else if (auto symbolLayer = mbglLayer->as<mbgl::style::SymbolLayer>()) {
|
||||
MGLSource *source = [self sourceWithIdentifier:@(symbolLayer->getSourceID().c_str())];
|
||||
styleLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:identifier source:source];
|
||||
return [[MGLSymbolStyleLayer alloc] initWithRawLayer:symbolLayer source:source];
|
||||
} else if (auto rasterLayer = mbglLayer->as<mbgl::style::RasterLayer>()) {
|
||||
MGLSource *source = [self sourceWithIdentifier:@(rasterLayer->getSourceID().c_str())];
|
||||
styleLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:identifier source:source];
|
||||
return [[MGLRasterStyleLayer alloc] initWithRawLayer:rasterLayer source:source];
|
||||
} else if (auto circleLayer = mbglLayer->as<mbgl::style::CircleLayer>()) {
|
||||
MGLSource *source = [self sourceWithIdentifier:@(circleLayer->getSourceID().c_str())];
|
||||
styleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:identifier source:source];
|
||||
} else if (mbglLayer->is<mbgl::style::BackgroundLayer>()) {
|
||||
styleLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:identifier];
|
||||
} else if (mbglLayer->is<mbgl::style::CustomLayer>()) {
|
||||
styleLayer = self.openGLLayers[identifier];
|
||||
return [[MGLCircleStyleLayer alloc] initWithRawLayer:circleLayer source:source];
|
||||
} else if (auto backgroundLayer = mbglLayer->as<mbgl::style::BackgroundLayer>()) {
|
||||
return [[MGLBackgroundStyleLayer alloc] initWithRawLayer:backgroundLayer];
|
||||
} else if (auto customLayer = mbglLayer->as<mbgl::style::CustomLayer>()) {
|
||||
MGLStyleLayer *styleLayer = self.openGLLayers[identifier];
|
||||
if (styleLayer) {
|
||||
NSAssert(styleLayer.rawLayer == mbglLayer->as<mbgl::style::CustomLayer>(), @"%@ wraps a CustomLayer that differs from the one associated with the underlying style.", styleLayer);
|
||||
NSAssert(styleLayer.rawLayer == customLayer, @"%@ wraps a CustomLayer that differs from the one associated with the underlying style.", styleLayer);
|
||||
return styleLayer;
|
||||
}
|
||||
styleLayer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:identifier];
|
||||
return [[MGLOpenGLStyleLayer alloc] initWithRawLayer:customLayer];
|
||||
} else {
|
||||
NSAssert(NO, @"Unrecognized layer type");
|
||||
return nil;
|
||||
}
|
||||
|
||||
styleLayer.rawLayer = mbglLayer;
|
||||
|
||||
return styleLayer;
|
||||
}
|
||||
|
||||
- (MGLStyleLayer *)layerWithIdentifier:(NSString *)identifier
|
||||
|
||||
@@ -27,25 +27,7 @@ MGL_EXPORT
|
||||
|
||||
#pragma mark Initializing a Style Layer
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("Use -initWithIdentifier: instead.")));
|
||||
|
||||
/**
|
||||
Returns a style layer object initialized with the given identifier.
|
||||
|
||||
The default implementation of this initializer in MGLStyleLayer creates an
|
||||
invalid style layer. Call this initializer on `MGLBackgroundStyleLayer` or one of
|
||||
the concrete subclasses of `MGLForegroundStyleLayer` to create a valid style
|
||||
layer.
|
||||
|
||||
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 layer in the style to
|
||||
which it is added.
|
||||
@return An initialized style layer.
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
- (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead.")));
|
||||
|
||||
#pragma mark Identifying a Style Layer
|
||||
|
||||
|
||||
@@ -84,7 +84,33 @@ MGL_EXPORT
|
||||
%>StyleLayer
|
||||
<% if (type === 'background') { -%>
|
||||
|
||||
/**
|
||||
Returns a <%- type %> style layer initialized with an identifier.
|
||||
|
||||
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.
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
|
||||
<% } else { -%>
|
||||
|
||||
/**
|
||||
Returns a <%- type %> 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;
|
||||
<% } -%>
|
||||
|
||||
<% if (layoutProperties.length) { -%>
|
||||
|
||||
@@ -1,24 +1,57 @@
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/layer.hpp>
|
||||
|
||||
@interface MGLStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::Layer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::Layer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLStyleLayer
|
||||
@implementation MGLStyleLayer {
|
||||
std::unique_ptr<mbgl::style::Layer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier
|
||||
{
|
||||
- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer {
|
||||
if (self = [super init]) {
|
||||
_identifier = identifier;
|
||||
_identifier = @(rawLayer->getID().c_str());
|
||||
_rawLayer = rawLayer;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer {
|
||||
if (self = [self initWithRawLayer:pendingLayer.get()]) {
|
||||
_pendingLayer = std::move(pendingLayer);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer == mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
_pendingLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setVisible:(BOOL)visible
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGL<%- camelize(type) %>StyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer.hpp>
|
||||
<% if (enumProperties) { -%>
|
||||
|
||||
@@ -50,35 +50,24 @@ namespace mbgl {
|
||||
|
||||
@interface MGL<%- camelize(type) %>StyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::<%- camelize(type) %>Layer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::<%- camelize(type) %>Layer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGL<%- camelize(type) %>StyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::<%- camelize(type) %>Layer> _pendingLayer;
|
||||
}
|
||||
|
||||
<% if (type == 'background') { -%>
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier]) {
|
||||
auto layer = std::make_unique<mbgl::style::<%- camelize(type) %>Layer>(identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::<%- camelize(type) %>Layer>(identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer)];
|
||||
}
|
||||
|
||||
<% } else { -%>
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::<%- camelize(type) %>Layer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::<%- camelize(type) %>Layer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
@@ -87,11 +76,6 @@ namespace mbgl {
|
||||
return (mbgl::style::<%- camelize(type) %>Layer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::<%- camelize(type) %>Layer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
<% if (type !== 'background') { -%>
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
@@ -131,46 +115,6 @@ namespace mbgl {
|
||||
}
|
||||
|
||||
<% }} -%>
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::<%- camelize(type) %>Layer *layer = dynamic_cast<mbgl::style::<%- camelize(type) %>Layer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::<%- camelize(type) %>Layer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
<% if (layoutProperties.length) { -%>
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
|
||||
|
||||
@@ -30,6 +30,18 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MGLStyleLayer (Private)
|
||||
|
||||
/**
|
||||
Initializes and returns a layer with a raw pointer to the backing store,
|
||||
associated with a style.
|
||||
*/
|
||||
- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer;
|
||||
|
||||
/**
|
||||
Initializes and returns a layer with an owning pointer to the backing store,
|
||||
unassociated from a style.
|
||||
*/
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer;
|
||||
|
||||
@property (nonatomic, readwrite, copy) NSString *identifier;
|
||||
|
||||
/**
|
||||
@@ -39,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
pointer value stays even after ownership of the object is transferred via
|
||||
`mbgl::Map addLayer`.
|
||||
*/
|
||||
@property (nonatomic) mbgl::style::Layer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::Layer *rawLayer;
|
||||
|
||||
/**
|
||||
Adds the mbgl style layer that this object represents to the mbgl map below the
|
||||
|
||||
@@ -280,6 +280,21 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslationAnchor) {
|
||||
MGL_EXPORT
|
||||
@interface MGLSymbolStyleLayer : MGLVectorStyleLayer
|
||||
|
||||
/**
|
||||
Returns a symbol 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 - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
|
||||
|
||||
#import "MGLSource.h"
|
||||
#import "MGLMapView_Private.h"
|
||||
#import "NSPredicate+MGLAdditions.h"
|
||||
#import "NSDate+MGLAdditions.h"
|
||||
#import "MGLStyleLayer_Private.h"
|
||||
#import "MGLForegroundStyleLayer_Private.h"
|
||||
#import "MGLStyleValue_Private.h"
|
||||
#import "MGLSymbolStyleLayer.h"
|
||||
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/style/transition_options.hpp>
|
||||
#include <mbgl/style/layers/symbol_layer.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -82,23 +82,16 @@ namespace mbgl {
|
||||
|
||||
@interface MGLSymbolStyleLayer ()
|
||||
|
||||
@property (nonatomic) mbgl::style::SymbolLayer *rawLayer;
|
||||
@property (nonatomic, readonly) mbgl::style::SymbolLayer *rawLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MGLSymbolStyleLayer
|
||||
{
|
||||
std::unique_ptr<mbgl::style::SymbolLayer> _pendingLayer;
|
||||
}
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source
|
||||
{
|
||||
if (self = [super initWithIdentifier:identifier source:source]) {
|
||||
auto layer = std::make_unique<mbgl::style::SymbolLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
_pendingLayer = std::move(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
return self;
|
||||
auto layer = std::make_unique<mbgl::style::SymbolLayer>(identifier.UTF8String, source.identifier.UTF8String);
|
||||
return self = [super initWithPendingLayer:std::move(layer) source:source];
|
||||
}
|
||||
|
||||
- (mbgl::style::SymbolLayer *)rawLayer
|
||||
@@ -106,11 +99,6 @@ namespace mbgl {
|
||||
return (mbgl::style::SymbolLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
- (void)setRawLayer:(mbgl::style::SymbolLayer *)rawLayer
|
||||
{
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -147,46 +135,6 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
{
|
||||
if (_pendingLayer == nullptr) {
|
||||
[NSException raise:@"MGLRedundantLayerException"
|
||||
format:@"This instance %@ was already added to %@. Adding the same layer instance " \
|
||||
"to the style more than once is invalid.", self, mapView.style];
|
||||
}
|
||||
|
||||
if (otherLayer) {
|
||||
const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String};
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId);
|
||||
} else {
|
||||
mapView.mbglMap->addLayer(std::move(_pendingLayer));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeFromMapView:(MGLMapView *)mapView
|
||||
{
|
||||
if (self.rawLayer != mapView.mbglMap->getLayer(self.identifier.UTF8String)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto removedLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String);
|
||||
if (!removedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::style::SymbolLayer *layer = dynamic_cast<mbgl::style::SymbolLayer *>(removedLayer.get());
|
||||
if (!layer) {
|
||||
return;
|
||||
}
|
||||
|
||||
removedLayer.release();
|
||||
|
||||
_pendingLayer = std::unique_ptr<mbgl::style::SymbolLayer>(layer);
|
||||
self.rawLayer = _pendingLayer.get();
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
|
||||
- (void)setIconAllowsOverlap:(MGLStyleValue<NSNumber *> *)iconAllowsOverlap {
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
35305D4A1D22AA6A0007D005 /* NSData+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35305D461D22AA450007D005 /* NSData+MGLAdditions.h */; };
|
||||
3538AA1D1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3538AA1E1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
3538AA1F1D542239008EC33D /* MGLForegroundStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */; };
|
||||
3538AA201D542239008EC33D /* MGLForegroundStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */; };
|
||||
3538AA1F1D542239008EC33D /* MGLForegroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.mm */; };
|
||||
3538AA201D542239008EC33D /* MGLForegroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.mm */; };
|
||||
353933F21D3FB753003F57D7 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
353933F31D3FB753003F57D7 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
353933F51D3FB785003F57D7 /* MGLBackgroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933F41D3FB785003F57D7 /* MGLBackgroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -168,6 +168,8 @@
|
||||
40F887701D7A1E58008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; };
|
||||
40F887711D7A1E59008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; };
|
||||
40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */; };
|
||||
522ADA011E955C2F00096484 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */; };
|
||||
522ADA021E955C3000096484 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */; };
|
||||
556660CA1E1BF3A900E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
556660D81E1D085500E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D71E1D085500E2C41B /* MGLVersionNumber.m */; };
|
||||
556660DB1E1D8E8D00E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -556,7 +558,7 @@
|
||||
35305D461D22AA450007D005 /* NSData+MGLAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+MGLAdditions.h"; sourceTree = "<group>"; };
|
||||
35305D471D22AA450007D005 /* NSData+MGLAdditions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSData+MGLAdditions.mm"; sourceTree = "<group>"; };
|
||||
3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer.h; sourceTree = "<group>"; };
|
||||
3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLForegroundStyleLayer.m; sourceTree = "<group>"; };
|
||||
3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLForegroundStyleLayer.mm; sourceTree = "<group>"; };
|
||||
353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer.h; sourceTree = "<group>"; };
|
||||
353933F41D3FB785003F57D7 /* MGLBackgroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLBackgroundStyleLayer.h; sourceTree = "<group>"; };
|
||||
353933F71D3FB79F003F57D7 /* MGLLineStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLineStyleLayer.h; sourceTree = "<group>"; };
|
||||
@@ -632,6 +634,7 @@
|
||||
40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource_Private.h; sourceTree = "<group>"; };
|
||||
40FDA7691CCAAA6800442548 /* MBXAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBXAnnotationView.h; sourceTree = "<group>"; };
|
||||
40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBXAnnotationView.m; sourceTree = "<group>"; };
|
||||
522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer_Private.h; sourceTree = "<group>"; };
|
||||
554180411D2E97DE00012372 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||
556660C91E1BF3A900E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = "<group>"; };
|
||||
556660D71E1D085500E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = "<group>"; };
|
||||
@@ -976,6 +979,7 @@
|
||||
353933F01D3FB6BA003F57D7 /* Layers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */,
|
||||
353933F41D3FB785003F57D7 /* MGLBackgroundStyleLayer.h */,
|
||||
35136D381D42271A00C20EFD /* MGLBackgroundStyleLayer.mm */,
|
||||
353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */,
|
||||
@@ -983,7 +987,7 @@
|
||||
35D13AC11D3D19DD00AFB4E0 /* MGLFillStyleLayer.h */,
|
||||
35D13AC21D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm */,
|
||||
3538AA1B1D542239008EC33D /* MGLForegroundStyleLayer.h */,
|
||||
3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.m */,
|
||||
3538AA1C1D542239008EC33D /* MGLForegroundStyleLayer.mm */,
|
||||
353933F71D3FB79F003F57D7 /* MGLLineStyleLayer.h */,
|
||||
35136D3E1D42273000C20EFD /* MGLLineStyleLayer.mm */,
|
||||
DA7262091DEEE3480043BB89 /* MGLOpenGLStyleLayer.h */,
|
||||
@@ -1572,6 +1576,7 @@
|
||||
35E1A4D81D74336F007AA97F /* MGLValueEvaluator.h in Headers */,
|
||||
DA88482C1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h in Headers */,
|
||||
357FE2DD1E02D2B20068B753 /* NSCoder+MGLAdditions.h in Headers */,
|
||||
522ADA011E955C2F00096484 /* MGLForegroundStyleLayer_Private.h in Headers */,
|
||||
7E016D7E1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.h in Headers */,
|
||||
35D13AB71D3D15E300AFB4E0 /* MGLStyleLayer.h in Headers */,
|
||||
DA88488E1CBB047F00AB86E3 /* reachability.h in Headers */,
|
||||
@@ -1712,6 +1717,7 @@
|
||||
353AFA151D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
|
||||
3510FFFA1D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */,
|
||||
DA72620C1DEEE3480043BB89 /* MGLOpenGLStyleLayer.h in Headers */,
|
||||
522ADA021E955C3000096484 /* MGLForegroundStyleLayer_Private.h in Headers */,
|
||||
35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
|
||||
DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */,
|
||||
404C26E81D89C55D000AA13D /* MGLTileSource_Private.h in Headers */,
|
||||
@@ -2141,7 +2147,7 @@
|
||||
3566C7681D4A77BA008152BC /* MGLShapeSource.mm in Sources */,
|
||||
400533021DB0862B0069F638 /* NSArray+MGLAdditions.mm in Sources */,
|
||||
35136D421D42274500C20EFD /* MGLRasterStyleLayer.mm in Sources */,
|
||||
3538AA1F1D542239008EC33D /* MGLForegroundStyleLayer.m in Sources */,
|
||||
3538AA1F1D542239008EC33D /* MGLForegroundStyleLayer.mm in Sources */,
|
||||
DA00FC901D5EEB0D009AABC8 /* MGLAttributionInfo.mm in Sources */,
|
||||
DA88482D1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m in Sources */,
|
||||
DA88485B1CBAFB9800AB86E3 /* MGLUserLocation.m in Sources */,
|
||||
@@ -2219,7 +2225,7 @@
|
||||
3566C7691D4A77BA008152BC /* MGLShapeSource.mm in Sources */,
|
||||
400533031DB086490069F638 /* NSArray+MGLAdditions.mm in Sources */,
|
||||
35136D431D42274500C20EFD /* MGLRasterStyleLayer.mm in Sources */,
|
||||
3538AA201D542239008EC33D /* MGLForegroundStyleLayer.m in Sources */,
|
||||
3538AA201D542239008EC33D /* MGLForegroundStyleLayer.mm in Sources */,
|
||||
DA00FC911D5EEB0D009AABC8 /* MGLAttributionInfo.mm in Sources */,
|
||||
DAA4E4201CBB730400178DFB /* MGLOfflinePack.mm in Sources */,
|
||||
DAA4E4331CBB730400178DFB /* MGLUserLocation.m in Sources */,
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
35602BFB1D3EA99F0050646F /* MGLFillStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */; };
|
||||
35602BFF1D3EA9B40050646F /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFC1D3EA9B40050646F /* MGLStyleLayer_Private.h */; };
|
||||
35602C001D3EA9B40050646F /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.m */; };
|
||||
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */; };
|
||||
35724FC41D630502002A4AB4 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */; };
|
||||
359819591E02F611008FC139 /* NSCoder+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 359819571E02F611008FC139 /* NSCoder+MGLAdditions.h */; };
|
||||
3598195A1E02F611008FC139 /* NSCoder+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 359819581E02F611008FC139 /* NSCoder+MGLAdditions.mm */; };
|
||||
@@ -62,6 +62,7 @@
|
||||
40B77E451DB11BC9003DA2FE /* NSArray+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */; };
|
||||
40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */; };
|
||||
40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; };
|
||||
5209CAB01E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */; };
|
||||
52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; };
|
||||
52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; };
|
||||
5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; };
|
||||
@@ -290,7 +291,7 @@
|
||||
35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillStyleLayer.mm; sourceTree = "<group>"; };
|
||||
35602BFC1D3EA9B40050646F /* MGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayer_Private.h; sourceTree = "<group>"; };
|
||||
35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer.h; sourceTree = "<group>"; };
|
||||
35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLForegroundStyleLayer.m; sourceTree = "<group>"; };
|
||||
35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLForegroundStyleLayer.mm; sourceTree = "<group>"; };
|
||||
358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = amsterdam.geojson; path = ../../darwin/test/amsterdam.geojson; sourceTree = "<group>"; };
|
||||
359819571E02F611008FC139 /* NSCoder+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCoder+MGLAdditions.h"; sourceTree = "<group>"; };
|
||||
359819581E02F611008FC139 /* NSCoder+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSCoder+MGLAdditions.mm"; sourceTree = "<group>"; };
|
||||
@@ -320,6 +321,7 @@
|
||||
40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = "<group>"; };
|
||||
40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerTests.h; sourceTree = "<group>"; };
|
||||
40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerTests.m; sourceTree = "<group>"; };
|
||||
5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer_Private.h; sourceTree = "<group>"; };
|
||||
52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; };
|
||||
556660C51E1BEA0100E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = "<group>"; };
|
||||
@@ -598,7 +600,8 @@
|
||||
35602BF81D3EA99F0050646F /* MGLFillStyleLayer.h */,
|
||||
35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */,
|
||||
35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */,
|
||||
35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.m */,
|
||||
5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */,
|
||||
35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */,
|
||||
DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */,
|
||||
DA8F258A1D51CA540010E6B5 /* MGLLineStyleLayer.mm */,
|
||||
DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */,
|
||||
@@ -1097,6 +1100,7 @@
|
||||
DAE6C3621CC31E0400DB3429 /* MGLOverlay.h in Headers */,
|
||||
DAE6C3651CC31E0400DB3429 /* MGLPolyline.h in Headers */,
|
||||
DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h in Headers */,
|
||||
5209CAB01E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h in Headers */,
|
||||
DA8F258B1D51CA540010E6B5 /* MGLLineStyleLayer.h in Headers */,
|
||||
35C6DF841E214C0400ACA483 /* MGLDistanceFormatter.h in Headers */,
|
||||
DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */,
|
||||
@@ -1362,7 +1366,7 @@
|
||||
DAE6C3941CC31E2A00DB3429 /* MGLStyle.mm in Sources */,
|
||||
DAE6C3871CC31E2A00DB3429 /* MGLGeometry.mm in Sources */,
|
||||
3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */,
|
||||
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.m in Sources */,
|
||||
35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.mm in Sources */,
|
||||
408AA86A1DAEEE5D00022900 /* NSDictionary+MGLAdditions.mm in Sources */,
|
||||
DA8F25881D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm in Sources */,
|
||||
DA551B841DB496AC0009AFAF /* MGLTileSource.mm in Sources */,
|
||||
|
||||
Reference in New Issue
Block a user