diff --git a/MapboxARKit/Annotation.swift b/MapboxARKit/Annotation.swift index ae02faf..7fdb2b8 100644 --- a/MapboxARKit/Annotation.swift +++ b/MapboxARKit/Annotation.swift @@ -5,10 +5,11 @@ public class Annotation: NSObject { public var location: CLLocation public var calloutImage: UIImage? public var anchor: MBARAnchor? - - public init(location: CLLocation, calloutImage: UIImage?) { + public var identifier: String + public init(location: CLLocation, calloutImage: UIImage?, identifier: String) { self.location = location self.calloutImage = calloutImage + self.identifier = identifier } } diff --git a/MapboxARKit/AnnotationManager.swift b/MapboxARKit/AnnotationManager.swift index 93e2a5b..264213e 100644 --- a/MapboxARKit/AnnotationManager.swift +++ b/MapboxARKit/AnnotationManager.swift @@ -102,6 +102,7 @@ extension AnnotationManager: ARSCNViewDelegate { if let calloutImage = annotation.calloutImage { let calloutNode = createCalloutNode(with: calloutImage, node: newNode) + calloutNode.name = annotation.identifier newNode.addChildNode(calloutNode) }