Skip to content

Commit

Permalink
removing comment, swifty names
Browse files Browse the repository at this point in the history
  • Loading branch information
hactar committed Jan 28, 2024
1 parent 0fc365a commit 72ab59e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions Sources/MapLibreSwiftDSL/Style Layers/Circle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import InternalUtils
import MapLibre
import MapLibreSwiftMacros

@MLNStyleProperty<Double>("circleRadius", supportsInterpolation: true)
@MLNStyleProperty<UIColor>("circleColor", supportsInterpolation: false)
@MLNStyleProperty<Double>("circleStrokeWidth", supportsInterpolation: true)
@MLNStyleProperty<UIColor>("circleStrokeColor", supportsInterpolation: true)
@MLNStyleProperty<Double>("radius", supportsInterpolation: true)
@MLNStyleProperty<UIColor>("color", supportsInterpolation: false)
@MLNStyleProperty<Double>("strokeWidth", supportsInterpolation: true)
@MLNStyleProperty<UIColor>("strokeColor", supportsInterpolation: false)
public struct CircleStyleLayer: SourceBoundStyleLayerDefinition {
public let identifier: String
public var insertionPosition: LayerInsertionPosition = .aboveOthers
Expand All @@ -29,7 +29,6 @@ public struct CircleStyleLayer: SourceBoundStyleLayerDefinition {
public func makeStyleLayer(style: MLNStyle) -> StyleLayer {
let styleSource = addSource(to: style)

// Register the images with the map style
return CircleStyleLayerInternal(definition: self, mglSource: styleSource)
}

Expand Down Expand Up @@ -68,12 +67,12 @@ private struct CircleStyleLayerInternal: StyleLayer {
public func makeMLNStyleLayer() -> MLNStyleLayer {
let result = MLNCircleStyleLayer(identifier: identifier, source: mglSource)

result.circleRadius = definition.circleRadius
result.circleRadius = definition.radius
result.circleColor = definition.color

result.circleStrokeColor = definition.circleStrokeColor
result.circleStrokeWidth = definition.circleStrokeWidth
result.circleStrokeWidth = definition.strokeWidth
result.circleStrokeColor = definition.strokeColor

result.circleColor = definition.circleColor

return result
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/MapLibreSwiftUI/Examples/Layers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ struct Layer_Previews: PreviewProvider {
MapView(styleURL: demoTilesURL) {
// Simple symbol layer demonstration with an icon
CircleStyleLayer(identifier: "simple-circles", source: pointSource)
.circleRadius(constant: 16)
.circleColor(constant: .systemRed)
.circleStrokeWidth(constant: 2)
.circleStrokeColor(constant: .white)
.radius(constant: 16)
.color(constant: .systemRed)
.strokeWidth(constant: 2)
.strokeColor(constant: .white)

SymbolStyleLayer(identifier: "simple-symbols", source: pointSource)
.iconImage(constant: UIImage(systemName: "mappin")!.withRenderingMode(.alwaysTemplate))
Expand Down

0 comments on commit 72ab59e

Please sign in to comment.