Skip to content

Commit

Permalink
Generic annotations implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
persidskiy committed Aug 14, 2024
1 parent c7fdd5e commit cb1ed93
Show file tree
Hide file tree
Showing 44 changed files with 2,262 additions and 8,726 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ disabled_rules:
- todo
- trailing_comma
- type_name
- type_body_length
custom_rules:
trojan_source:
regex: "[\u202A\u202B\u202D\u202E\u2066\u2067\u2068\u202C\u2069]"
Expand Down
18 changes: 18 additions & 0 deletions Sources/MapboxMaps/Annotations/Annotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ public protocol Annotation {
var userInfo: [String: Any]? { get set }
}

protocol AnnotationInternal {
associatedtype GeometryType: GeometryConvertible

var id: String { get set }
var layerProperties: [String: Any] { get }
var feature: Feature { get }
var isSelected: Bool { get set }
var isDraggable: Bool { get set }
var _geometry: GeometryType { get set }

var tapHandler: ((MapContentGestureContext) -> Bool)? { get set }
var longPressHandler: ((MapContentGestureContext) -> Bool)? { get set }

var dragBeginHandler: ((inout Self, MapContentGestureContext) -> Bool)? { get set }
var dragChangeHandler: ((inout Self, MapContentGestureContext) -> Void)? { get set }
var dragEndHandler: ((inout Self, MapContentGestureContext) -> Void)? { get set }
}

extension Array where Element: Annotation {
/// Deduplicates annotations.
mutating func removeDuplicates() {
Expand Down
99 changes: 0 additions & 99 deletions Sources/MapboxMaps/Annotations/AnnotationManagerFactory.swift

This file was deleted.

Loading

0 comments on commit cb1ed93

Please sign in to comment.