Please forgive me if this question is not that great. I've hit a bit of a road block on Apple's documentation of ARGeoAnchor.
Currently ARGeoAnchor just shows a blue dot in the AR Scene View. I'm trying to show any 3d rendereing or object instead.
My code:
let coordinate = CLLocationCoordinate2D(latitude: lat, longitude: lng)
let geoAnchor = ARGeoAnchor(name: "Point 1", coordinate: coordinate)
let boxGeometry = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0)
let cube = SCNNode(geometry: boxGeometry)
geoAnchor.scene.rootNode.addChildNode(cube)
self.addGeoAnchor(geoAnchor)
The error i'm getting: Value of type 'ARGeoAnchor' has no member 'scene'
I have multiple ARGeoAnchors, they are all currently showing blue dots. How do I get them to show custom 3d objects instead?
Thanks for taking a look!
At first you have to check if
ARGeoTrackingConfigurationis supported on your device.Requirements: You need a device with A12+ chip and cellular (GPS) support.
...then check whether Geo Tracking is available at your location:
After that supply
Info.plistwith camera and location permission. Here's a comprehensive information on Authorization Request for Location Services what includes:Only several cities in US, UK, Australia, Canada, Japan and Singapore are supported at the moment...
A list of cities that support ARGeoTrackingConfiguration.
Then you must run Geo Configuration:
Then add parametrised anchor to the session:
And after that you can add a model with the help of ARGeoAnchor:
P.S.
If you're interested in how a similar feature works in ARCore, read my post about Geospatial API.