Skip to content

Commit

Permalink
[MAPSIOS-1405] Remove position from layers and annotations in DSL (#2122
Browse files Browse the repository at this point in the history
)
  • Loading branch information
aleksproger committed Apr 23, 2024
1 parent c1894d7 commit e50fa7b
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 338 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ import os.log
struct MountedAnnotationGroup<M: MapContentAnnotationManager>: MapContentMountedComponent {
private let annotations: [(AnyHashable, M.AnnotationType)]
private let layerId: String
private let customLayerPosition: LayerPosition?
private let clusterOptions: ClusterOptions?
private let updateProperties: (M) -> Void

init(
layerId: String,
customLayerPosition: LayerPosition?,
clusterOptions: ClusterOptions?,
annotations: [(AnyHashable, M.AnnotationType)],
updateProperties: @escaping (M) -> Void
) {
self.layerId = layerId
self.customLayerPosition = customLayerPosition
self.clusterOptions = clusterOptions
self.annotations = annotations
self.updateProperties = updateProperties
Expand All @@ -29,10 +26,9 @@ struct MountedAnnotationGroup<M: MapContentAnnotationManager>: MapContentMounted

os_log(.debug, log: .contentDSL, "Annotation add %s", layerId)

let layerPosition = customLayerPosition ?? context.resolveLayerPosition()
let manager = M.make(
layerId: layerId,
layerPosition: layerPosition,
layerPosition: context.resolveLayerPosition(),
clusterOptions: clusterOptions,
using: orchestrator
)
Expand Down Expand Up @@ -61,15 +57,13 @@ struct MountedAnnotationGroup<M: MapContentAnnotationManager>: MapContentMounted

manager.isSwiftUI = true
updateProperties(manager)
manager.layerPosition = customLayerPosition ?? context.resolveLayerPosition()
manager.layerPosition = context.resolveLayerPosition()
manager.set(newAnnotations: annotations)

return true
}

func updateMetadata(with context: MapContentNodeContext) {
if customLayerPosition == nil {
context.lastLayerId = layerId
}
context.lastLayerId = layerId
}
}
239 changes: 0 additions & 239 deletions Sources/MapboxMaps/Style/Generated/LayerWrapper.swift

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Sources/MapboxMaps/Style/Generated/Layers/CircleLayer.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Sources/MapboxMaps/Style/Generated/Layers/FillLayer.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Sources/MapboxMaps/Style/Generated/Layers/HeatmapLayer.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e50fa7b

Please sign in to comment.