diff options
3 files changed, 2 insertions, 22 deletions
diff --git a/platform/darwin/docs/guides/Migrating to Expressions.md.ejs b/platform/darwin/docs/guides/Migrating to Expressions.md.ejs index 144035a367..dd925c6495 100644 --- a/platform/darwin/docs/guides/Migrating to Expressions.md.ejs +++ b/platform/darwin/docs/guides/Migrating to Expressions.md.ejs @@ -77,8 +77,6 @@ There are three main types of events in the USGS dataset: earthquakes, explosion If your use case does not require a default value, you can either apply a predicate to your layer prior to styling it, or use the format string `"valueForKeyPath:"``. -<%- guideExample(guide, 'CategoricalValue', os) %> - ![categorical mode](img/data-driven-styling/categorical1.png) ![categorical mode](img/data-driven-styling/categorical2.png) ### Identity diff --git a/platform/ios/docs/guides/Migrating to Expressions.md b/platform/ios/docs/guides/Migrating to Expressions.md index 58d5a963f5..dcc19113ec 100644 --- a/platform/ios/docs/guides/Migrating to Expressions.md +++ b/platform/ios/docs/guides/Migrating to Expressions.md @@ -44,7 +44,7 @@ The stops dictionary below, for example, shows colors that continuously shift fr ```swift let url = URL(string: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson")! let symbolSource = MGLSource(identifier: "source") -let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: source) +let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) let source = MGLShapeSource(identifier: "earthquakes", url: url, options: nil) mapView.style?.addSource(source) @@ -123,15 +123,6 @@ layer.circleColor = NSExpression(format: "MGL_MATCH(type, 'earthquake', %@, 'exp If your use case does not require a default value, you can either apply a predicate to your layer prior to styling it, or use the format string `"valueForKeyPath:"``. -```swift -let stops : [String : UIColor] = ["earthquake" : UIColor.orange, - "explosion" : UIColor.red, - "quarry blast" : UIColor.yellow] -layer.circleColor = NSExpression( -format: "FUNCTION(%@, 'valueForKeyPath:', type)", -stops) -``` - ![categorical mode](img/data-driven-styling/categorical1.png) ![categorical mode](img/data-driven-styling/categorical2.png) ### Identity diff --git a/platform/macos/docs/guides/Migrating to Expressions.md b/platform/macos/docs/guides/Migrating to Expressions.md index be48acbfaf..6eaa1d2075 100644 --- a/platform/macos/docs/guides/Migrating to Expressions.md +++ b/platform/macos/docs/guides/Migrating to Expressions.md @@ -44,7 +44,7 @@ The stops dictionary below, for example, shows colors that continuously shift fr ```swift let url = URL(string: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson")! let symbolSource = MGLSource(identifier: "source") -let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: source) +let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) let source = MGLShapeSource(identifier: "earthquakes", url: url, options: nil) mapView.style?.addSource(source) @@ -124,15 +124,6 @@ format: "MGL_MATCH(type, 'earthquake', %@, 'explosion', %@, 'quarry blast', %@, If your use case does not require a default value, you can either apply a predicate to your layer prior to styling it, or use the format string `"valueForKeyPath:"``. -```swift -let stops : [String : NSColor] = ["earthquake" : NSColor.orange, - "explosion" : NSColor.red, - "quarry blast" : NSColor.yellow] -layer.circleColor = NSExpression( -format: "FUNCTION(%@, 'valueForKeyPath:', type)", -stops) -``` - ![categorical mode](img/data-driven-styling/categorical1.png) ![categorical mode](img/data-driven-styling/categorical2.png) ### Identity |