51 lines
972 B
Plaintext
51 lines
972 B
Plaintext
#import "MGLStyleLayer_Private.h"
|
|
#import "MGLMapView_Private.h"
|
|
|
|
#include <mbgl/style/layer.hpp>
|
|
|
|
@implementation MGLStyleLayer
|
|
|
|
- (instancetype)initWithIdentifier:(NSString *)identifier
|
|
{
|
|
if (self = [super init]) {
|
|
_identifier = identifier;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)setVisible:(BOOL)visible
|
|
{
|
|
mbgl::style::VisibilityType v = visible
|
|
? mbgl::style::VisibilityType::Visible
|
|
: mbgl::style::VisibilityType::None;
|
|
self.layer->setVisibility(v);
|
|
}
|
|
|
|
- (BOOL)isVisible
|
|
{
|
|
mbgl::style::VisibilityType v = self.layer->getVisibility();
|
|
return (v == mbgl::style::VisibilityType::Visible);
|
|
}
|
|
|
|
- (void)setMaximumZoomLevel:(float)maximumZoomLevel
|
|
{
|
|
self.layer->setMaxZoom(maximumZoomLevel);
|
|
}
|
|
|
|
- (float)maximumZoomLevel
|
|
{
|
|
return self.layer->getMaxZoom();
|
|
}
|
|
|
|
- (void)setMinimumZoomLevel:(float)minimumZoomLevel
|
|
{
|
|
self.layer->setMinZoom(minimumZoomLevel);
|
|
}
|
|
|
|
- (float)minimumZoomLevel
|
|
{
|
|
return self.layer->getMinZoom();
|
|
}
|
|
|
|
@end
|