diff options
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 21 | ||||
-rw-r--r-- | platform/darwin/src/MGLBackgroundStyleLayer.mm | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLBaseStyleLayer.h | 5 | ||||
-rw-r--r-- | platform/darwin/src/MGLBaseStyleLayer.mm | 6 | ||||
-rw-r--r-- | platform/darwin/src/MGLBaseStyleLayer_Private.hpp | 7 | ||||
-rw-r--r-- | platform/darwin/src/MGLCircleStyleLayer.mm | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLFillStyleLayer.mm | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLLineStyleLayer.mm | 15 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterStyleLayer.mm | 8 | ||||
-rw-r--r-- | platform/darwin/src/MGLStyleLayer.mm.ejs | 1 | ||||
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.mm | 49 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 2 |
12 files changed, 120 insertions, 14 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index fd1cf2f66d..e28b4c0d11 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -100,22 +100,31 @@ global.initLayer = function (layerType) { } global.setterImplementation = function(property, layerType) { + var implementation = ''; switch (property.type) { case 'boolean': - return `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_boolPropertyValue);`; + implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_boolPropertyValue);`; + break; case 'number': - return `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_floatPropertyValue);`; + implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_floatPropertyValue);`; + break; case 'string': - return `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_stringPropertyValue);`; + implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_stringPropertyValue);`; + break; case 'enum': var objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`; - return `MGLSetEnumProperty(${objCName(property)}, ${camelize(property.name)}, ${mbglType(property)}, ${objCType});`; + implementation = `MGLSetEnumProperty(${objCName(property)}, ${camelize(property.name)}, ${mbglType(property)}, ${objCType});`; + break; case 'color': - return `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_colorPropertyValue);`; + implementation = `self.layer->set${camelize(property.name)}(${objCName(property)}.mbgl_colorPropertyValue);`; + break; case 'array': - return arraySetterImplementation(property); + implementation = arraySetterImplementation(property); + break; default: throw new Error(`unknown type for ${property.name}`) } + implementation += "\n [self update];" + return implementation; } global.mbglType = function(property) { diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm index 66e308bb1f..80f803815c 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLBackgroundStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setBackgroundColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundColor { self.layer->setBackgroundColor(backgroundColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)backgroundColor { @@ -40,6 +42,7 @@ - (void)setBackgroundPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundPattern { self.layer->setBackgroundPattern(backgroundPattern.mbgl_stringPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)backgroundPattern { @@ -48,6 +51,7 @@ - (void)setBackgroundOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundOpacity { self.layer->setBackgroundOpacity(backgroundOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)backgroundOpacity { diff --git a/platform/darwin/src/MGLBaseStyleLayer.h b/platform/darwin/src/MGLBaseStyleLayer.h index 597b67cdc2..d7d4e70a51 100644 --- a/platform/darwin/src/MGLBaseStyleLayer.h +++ b/platform/darwin/src/MGLBaseStyleLayer.h @@ -14,9 +14,4 @@ */ @property (nonatomic, assign) float minimumZoomLevel; -/** - Updates the layer’s layout and paint properties. - */ -- (void)update; - @end diff --git a/platform/darwin/src/MGLBaseStyleLayer.mm b/platform/darwin/src/MGLBaseStyleLayer.mm index c567ce33d8..6e13bd29fd 100644 --- a/platform/darwin/src/MGLBaseStyleLayer.mm +++ b/platform/darwin/src/MGLBaseStyleLayer.mm @@ -1,5 +1,6 @@ #import "MGLBaseStyleLayer.h" +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLMapView_Private.hpp" @@ -16,7 +17,10 @@ - (void)update { - self.mapView.mbglMap->update(mbgl::Update::RecalculateStyle | mbgl::Update::Classes); + // A style layer's map view can be nil when first created at runtime + // before being added to a map style. In these cases, just no-op since + // the addition of the layer will trigger a visual refresh. + if (self.mapView) self.mapView.mbglMap->update(mbgl::Update::RecalculateStyle | mbgl::Update::Classes); } - (void)setVisible:(BOOL)visible diff --git a/platform/darwin/src/MGLBaseStyleLayer_Private.hpp b/platform/darwin/src/MGLBaseStyleLayer_Private.hpp new file mode 100644 index 0000000000..e3d43906a4 --- /dev/null +++ b/platform/darwin/src/MGLBaseStyleLayer_Private.hpp @@ -0,0 +1,7 @@ +#import "MGLBaseStyleLayer.h" + +@interface MGLBaseStyleLayer (MGLBaseStyleLayer_Private) + +- (void)update; + +@end diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm index 44d6e39e79..783b80e77f 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/darwin/src/MGLCircleStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLCircleStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setCircleRadius:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleRadius { self.layer->setCircleRadius(circleRadius.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)circleRadius { @@ -40,6 +42,7 @@ - (void)setCircleColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleColor { self.layer->setCircleColor(circleColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)circleColor { @@ -48,6 +51,7 @@ - (void)setCircleBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleBlur { self.layer->setCircleBlur(circleBlur.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)circleBlur { @@ -56,6 +60,7 @@ - (void)setCircleOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleOpacity { self.layer->setCircleOpacity(circleOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)circleOpacity { @@ -64,6 +69,7 @@ - (void)setCircleTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleTranslate { self.layer->setCircleTranslate(circleTranslate.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)circleTranslate { @@ -72,6 +78,7 @@ - (void)setCircleTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circleTranslateAnchor { MGLSetEnumProperty(circleTranslateAnchor, CircleTranslateAnchor, TranslateAnchorType, MGLCircleStyleLayerCircleTranslateAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)circleTranslateAnchor { @@ -80,6 +87,7 @@ - (void)setCirclePitchScale:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)circlePitchScale { MGLSetEnumProperty(circlePitchScale, CirclePitchScale, CirclePitchScaleType, MGLCircleStyleLayerCirclePitchScale); + [self update]; } - (id <MGLStyleAttributeValue>)circlePitchScale { diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm index 95e82a2e52..7127c3a5de 100644 --- a/platform/darwin/src/MGLFillStyleLayer.mm +++ b/platform/darwin/src/MGLFillStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLFillStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setFillAntialias:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillAntialias { self.layer->setFillAntialias(fillAntialias.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillAntialias { @@ -40,6 +42,7 @@ - (void)setFillOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOpacity { self.layer->setFillOpacity(fillOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillOpacity { @@ -48,6 +51,7 @@ - (void)setFillColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillColor { self.layer->setFillColor(fillColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillColor { @@ -56,6 +60,7 @@ - (void)setFillOutlineColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillOutlineColor { self.layer->setFillOutlineColor(fillOutlineColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillOutlineColor { @@ -64,6 +69,7 @@ - (void)setFillTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslate { self.layer->setFillTranslate(fillTranslate.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillTranslate { @@ -72,6 +78,7 @@ - (void)setFillTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillTranslateAnchor { MGLSetEnumProperty(fillTranslateAnchor, FillTranslateAnchor, TranslateAnchorType, MGLFillStyleLayerFillTranslateAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)fillTranslateAnchor { @@ -80,6 +87,7 @@ - (void)setFillPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)fillPattern { self.layer->setFillPattern(fillPattern.mbgl_stringPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)fillPattern { diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm index 8c6ee1e6d2..de802a490b 100644 --- a/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/darwin/src/MGLLineStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLLineStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setLineCap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineCap { MGLSetEnumProperty(lineCap, LineCap, LineCapType, MGLLineStyleLayerLineCap); + [self update]; } - (id <MGLStyleAttributeValue>)lineCap { @@ -40,6 +42,7 @@ - (void)setLineJoin:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineJoin { MGLSetEnumProperty(lineJoin, LineJoin, LineJoinType, MGLLineStyleLayerLineJoin); + [self update]; } - (id <MGLStyleAttributeValue>)lineJoin { @@ -48,6 +51,7 @@ - (void)setLineMiterLimit:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineMiterLimit { self.layer->setLineMiterLimit(lineMiterLimit.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineMiterLimit { @@ -56,6 +60,7 @@ - (void)setLineRoundLimit:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineRoundLimit { self.layer->setLineRoundLimit(lineRoundLimit.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineRoundLimit { @@ -66,6 +71,7 @@ - (void)setLineOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineOpacity { self.layer->setLineOpacity(lineOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineOpacity { @@ -74,6 +80,7 @@ - (void)setLineColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineColor { self.layer->setLineColor(lineColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineColor { @@ -82,6 +89,7 @@ - (void)setLineTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineTranslate { self.layer->setLineTranslate(lineTranslate.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineTranslate { @@ -90,6 +98,7 @@ - (void)setLineTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineTranslateAnchor { MGLSetEnumProperty(lineTranslateAnchor, LineTranslateAnchor, TranslateAnchorType, MGLLineStyleLayerLineTranslateAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)lineTranslateAnchor { @@ -98,6 +107,7 @@ - (void)setLineWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineWidth { self.layer->setLineWidth(lineWidth.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineWidth { @@ -106,6 +116,7 @@ - (void)setLineGapWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineGapWidth { self.layer->setLineGapWidth(lineGapWidth.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineGapWidth { @@ -114,6 +125,7 @@ - (void)setLineOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineOffset { self.layer->setLineOffset(lineOffset.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineOffset { @@ -122,6 +134,7 @@ - (void)setLineBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineBlur { self.layer->setLineBlur(lineBlur.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineBlur { @@ -130,6 +143,7 @@ - (void)setLineDasharray:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)lineDasharray { self.layer->setLineDasharray(lineDasharray.mbgl_numberArrayPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)lineDasharray { @@ -138,6 +152,7 @@ - (void)setLinePattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)linePattern { self.layer->setLinePattern(linePattern.mbgl_stringPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)linePattern { diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index f976f3ddaf..fc2a407054 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLRasterStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setRasterOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterOpacity { self.layer->setRasterOpacity(rasterOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterOpacity { @@ -40,6 +42,7 @@ - (void)setRasterHueRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterHueRotate { self.layer->setRasterHueRotate(rasterHueRotate.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterHueRotate { @@ -48,6 +51,7 @@ - (void)setRasterBrightnessMin:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterBrightnessMin { self.layer->setRasterBrightnessMin(rasterBrightnessMin.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterBrightnessMin { @@ -56,6 +60,7 @@ - (void)setRasterBrightnessMax:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterBrightnessMax { self.layer->setRasterBrightnessMax(rasterBrightnessMax.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterBrightnessMax { @@ -64,6 +69,7 @@ - (void)setRasterSaturation:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterSaturation { self.layer->setRasterSaturation(rasterSaturation.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterSaturation { @@ -72,6 +78,7 @@ - (void)setRasterContrast:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterContrast { self.layer->setRasterContrast(rasterContrast.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterContrast { @@ -80,6 +87,7 @@ - (void)setRasterFadeDuration:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)rasterFadeDuration { self.layer->setRasterFadeDuration(rasterFadeDuration.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)rasterFadeDuration { diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs index c360898098..cf0cbc6e1a 100644 --- a/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -6,6 +6,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGL<%- camelize(type) %>StyleLayer.h" diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 335d0bfc6c..030ed81e44 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -1,6 +1,7 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. +#import "MGLBaseStyleLayer_Private.hpp" #import "MGLStyleLayer_Private.hpp" #import "MGLStyleAttributeValue.h" #import "MGLSymbolStyleLayer.h" @@ -32,6 +33,7 @@ - (void)setSymbolPlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolPlacement { MGLSetEnumProperty(symbolPlacement, SymbolPlacement, SymbolPlacementType, MGLSymbolStyleLayerSymbolPlacement); + [self update]; } - (id <MGLStyleAttributeValue>)symbolPlacement { @@ -40,6 +42,7 @@ - (void)setSymbolSpacing:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolSpacing { self.layer->setSymbolSpacing(symbolSpacing.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)symbolSpacing { @@ -48,6 +51,7 @@ - (void)setSymbolAvoidEdges:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)symbolAvoidEdges { self.layer->setSymbolAvoidEdges(symbolAvoidEdges.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)symbolAvoidEdges { @@ -56,6 +60,7 @@ - (void)setIconAllowOverlap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconAllowOverlap { self.layer->setIconAllowOverlap(iconAllowOverlap.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconAllowOverlap { @@ -64,6 +69,7 @@ - (void)setIconIgnorePlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconIgnorePlacement { self.layer->setIconIgnorePlacement(iconIgnorePlacement.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconIgnorePlacement { @@ -72,6 +78,7 @@ - (void)setIconOptional:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOptional { self.layer->setIconOptional(iconOptional.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconOptional { @@ -80,6 +87,7 @@ - (void)setIconRotationAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconRotationAlignment { MGLSetEnumProperty(iconRotationAlignment, IconRotationAlignment, AlignmentType, MGLSymbolStyleLayerIconRotationAlignment); + [self update]; } - (id <MGLStyleAttributeValue>)iconRotationAlignment { @@ -88,6 +96,7 @@ - (void)setIconSize:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconSize { self.layer->setIconSize(iconSize.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconSize { @@ -96,6 +105,7 @@ - (void)setIconTextFit:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTextFit { MGLSetEnumProperty(iconTextFit, IconTextFit, IconTextFitType, MGLSymbolStyleLayerIconTextFit); + [self update]; } - (id <MGLStyleAttributeValue>)iconTextFit { @@ -104,6 +114,7 @@ - (void)setIconTextFitPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTextFitPadding { self.layer->setIconTextFitPadding(iconTextFitPadding.mbgl_paddingPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconTextFitPadding { @@ -112,6 +123,7 @@ - (void)setIconImage:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconImage { self.layer->setIconImage(iconImage.mbgl_stringPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconImage { @@ -120,6 +132,7 @@ - (void)setIconRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconRotate { self.layer->setIconRotate(iconRotate.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconRotate { @@ -128,6 +141,7 @@ - (void)setIconPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconPadding { self.layer->setIconPadding(iconPadding.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconPadding { @@ -136,6 +150,7 @@ - (void)setIconKeepUpright:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconKeepUpright { self.layer->setIconKeepUpright(iconKeepUpright.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconKeepUpright { @@ -144,6 +159,7 @@ - (void)setIconOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOffset { self.layer->setIconOffset(iconOffset.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconOffset { @@ -152,6 +168,7 @@ - (void)setTextPitchAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textPitchAlignment { MGLSetEnumProperty(textPitchAlignment, TextPitchAlignment, AlignmentType, MGLSymbolStyleLayerTextPitchAlignment); + [self update]; } - (id <MGLStyleAttributeValue>)textPitchAlignment { @@ -160,6 +177,7 @@ - (void)setTextRotationAlignment:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textRotationAlignment { MGLSetEnumProperty(textRotationAlignment, TextRotationAlignment, AlignmentType, MGLSymbolStyleLayerTextRotationAlignment); + [self update]; } - (id <MGLStyleAttributeValue>)textRotationAlignment { @@ -168,6 +186,7 @@ - (void)setTextField:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textField { self.layer->setTextField(textField.mbgl_stringPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textField { @@ -176,6 +195,7 @@ - (void)setTextFont:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textFont { self.layer->setTextFont(textFont.mbgl_stringArrayPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textFont { @@ -184,6 +204,7 @@ - (void)setTextSize:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textSize { self.layer->setTextSize(textSize.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textSize { @@ -192,6 +213,7 @@ - (void)setTextMaxWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textMaxWidth { self.layer->setTextMaxWidth(textMaxWidth.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textMaxWidth { @@ -200,6 +222,7 @@ - (void)setTextLineHeight:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textLineHeight { self.layer->setTextLineHeight(textLineHeight.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textLineHeight { @@ -208,6 +231,7 @@ - (void)setTextLetterSpacing:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textLetterSpacing { self.layer->setTextLetterSpacing(textLetterSpacing.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textLetterSpacing { @@ -216,6 +240,7 @@ - (void)setTextJustify:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textJustify { MGLSetEnumProperty(textJustify, TextJustify, TextJustifyType, MGLSymbolStyleLayerTextJustify); + [self update]; } - (id <MGLStyleAttributeValue>)textJustify { @@ -224,6 +249,7 @@ - (void)setTextAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textAnchor { MGLSetEnumProperty(textAnchor, TextAnchor, TextAnchorType, MGLSymbolStyleLayerTextAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)textAnchor { @@ -232,6 +258,7 @@ - (void)setTextMaxAngle:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textMaxAngle { self.layer->setTextMaxAngle(textMaxAngle.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textMaxAngle { @@ -240,6 +267,7 @@ - (void)setTextRotate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textRotate { self.layer->setTextRotate(textRotate.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textRotate { @@ -248,6 +276,7 @@ - (void)setTextPadding:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textPadding { self.layer->setTextPadding(textPadding.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textPadding { @@ -256,6 +285,7 @@ - (void)setTextKeepUpright:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textKeepUpright { self.layer->setTextKeepUpright(textKeepUpright.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textKeepUpright { @@ -264,6 +294,7 @@ - (void)setTextTransform:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTransform { MGLSetEnumProperty(textTransform, TextTransform, TextTransformType, MGLSymbolStyleLayerTextTransform); + [self update]; } - (id <MGLStyleAttributeValue>)textTransform { @@ -272,6 +303,7 @@ - (void)setTextOffset:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOffset { self.layer->setTextOffset(textOffset.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textOffset { @@ -280,6 +312,7 @@ - (void)setTextAllowOverlap:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textAllowOverlap { self.layer->setTextAllowOverlap(textAllowOverlap.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textAllowOverlap { @@ -288,6 +321,7 @@ - (void)setTextIgnorePlacement:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textIgnorePlacement { self.layer->setTextIgnorePlacement(textIgnorePlacement.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textIgnorePlacement { @@ -296,6 +330,7 @@ - (void)setTextOptional:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOptional { self.layer->setTextOptional(textOptional.mbgl_boolPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textOptional { @@ -306,6 +341,7 @@ - (void)setIconOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconOpacity { self.layer->setIconOpacity(iconOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconOpacity { @@ -314,6 +350,7 @@ - (void)setIconColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconColor { self.layer->setIconColor(iconColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconColor { @@ -322,6 +359,7 @@ - (void)setIconHaloColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloColor { self.layer->setIconHaloColor(iconHaloColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconHaloColor { @@ -330,6 +368,7 @@ - (void)setIconHaloWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloWidth { self.layer->setIconHaloWidth(iconHaloWidth.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconHaloWidth { @@ -338,6 +377,7 @@ - (void)setIconHaloBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconHaloBlur { self.layer->setIconHaloBlur(iconHaloBlur.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconHaloBlur { @@ -346,6 +386,7 @@ - (void)setIconTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTranslate { self.layer->setIconTranslate(iconTranslate.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)iconTranslate { @@ -354,6 +395,7 @@ - (void)setIconTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)iconTranslateAnchor { MGLSetEnumProperty(iconTranslateAnchor, IconTranslateAnchor, TranslateAnchorType, MGLSymbolStyleLayerIconTranslateAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)iconTranslateAnchor { @@ -362,6 +404,7 @@ - (void)setTextOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textOpacity { self.layer->setTextOpacity(textOpacity.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textOpacity { @@ -370,6 +413,7 @@ - (void)setTextColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textColor { self.layer->setTextColor(textColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textColor { @@ -378,6 +422,7 @@ - (void)setTextHaloColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloColor { self.layer->setTextHaloColor(textHaloColor.mbgl_colorPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textHaloColor { @@ -386,6 +431,7 @@ - (void)setTextHaloWidth:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloWidth { self.layer->setTextHaloWidth(textHaloWidth.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textHaloWidth { @@ -394,6 +440,7 @@ - (void)setTextHaloBlur:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textHaloBlur { self.layer->setTextHaloBlur(textHaloBlur.mbgl_floatPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textHaloBlur { @@ -402,6 +449,7 @@ - (void)setTextTranslate:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTranslate { self.layer->setTextTranslate(textTranslate.mbgl_offsetPropertyValue); + [self update]; } - (id <MGLStyleAttributeValue>)textTranslate { @@ -410,6 +458,7 @@ - (void)setTextTranslateAnchor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)textTranslateAnchor { MGLSetEnumProperty(textTranslateAnchor, TextTranslateAnchor, TranslateAnchorType, MGLSymbolStyleLayerTextTranslateAnchor); + [self update]; } - (id <MGLStyleAttributeValue>)textTranslateAnchor { diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index df1c446c21..f1eed9625b 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -509,8 +509,6 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie @14: @NO, @15: @YES}; waterLayer.fillAntialias = fillAntialias; - - [waterLayer update]; } - (void)styleRoadLayer |