-
Notifications
You must be signed in to change notification settings - Fork 732
Open
Description
Summary
When I use the LocationAnnotationNode(location:view:) constructor, the view.image extension does not capture subviews such as labels when converting to UIImage.
For some reason (and I am not entirely sure why), this problem goes away when I call view.addSubview(cardView), but this also adds a new view to the window.
Code
func addARAsset(poi: AliasablePOI) {
let coordinate = CLLocationCoordinate2D(latitude: poi.latitude, longitude: poi.longitude)
let location = CLLocation(coordinate: coordinate, altitude: Constants.AR.altitudeInMeters)
let cardView = ARCardView(poi: poi)
//view.addSubview(cardView) <-- required
let annotationNode = LocationAnnotationNode(location: location, view: cardView)
annotationNode.scaleRelativeToDistance = false
sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationNode)
}Without addSubview
After addSubview
Metadata
Metadata
Assignees
Labels
No labels