Implement MGLForegroundStyleLayer.sourceIdentifier (#7570)
* [ios, macos] sourceIdentifier accessor methods * [ios, macos] generate style code
This commit is contained in:
@@ -54,6 +54,13 @@ namespace mbgl {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
- (NSString *)sourceLayerIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -49,6 +49,13 @@ namespace mbgl {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
- (NSString *)sourceLayerIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -61,6 +61,13 @@ namespace mbgl {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
- (NSString *)sourceLayerIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -41,6 +41,13 @@
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
|
||||
- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer
|
||||
|
||||
@@ -89,7 +89,15 @@ namespace mbgl {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
<% if (type !== 'background' && type !== 'raster') { -%>
|
||||
<% if (type !== 'background') { -%>
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
<% if (type !== 'raster') { -%>
|
||||
- (NSString *)sourceLayerIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -119,7 +127,7 @@ 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
|
||||
|
||||
@@ -108,6 +108,13 @@ namespace mbgl {
|
||||
super.rawLayer = rawLayer;
|
||||
}
|
||||
|
||||
- (NSString *)sourceIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
- (NSString *)sourceLayerIdentifier
|
||||
{
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
Reference in New Issue
Block a user