I am using ARKit for one of my Augmented Reality app. But problem I am facing is that Locations in camera is overlapping each other.
When I tried it using hardcoded data, I was able to show data at different locations. Now I am fetching data from a server and displaying them on ARKit. This shows all the locations overlapped on each other.
Here is my code:
for (NSDictionary *drop in drops)
{
CLLocation *tempLocation = [[CLLocation alloc] initWithLatitude:[[[drop objectForKey:@"latitude"] objectForKey:@"text"] floatValue] longitude:[[[drop objectForKey:@"longitude"] objectForKey:@"text"] floatValue]];
tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.inclination = M_PI/30;
tempCoordinate.title = [[drop objectForKey:@"DropText"] objectForKey:@"text"];
tempCoordinate.subtitle = [[drop objectForKey:@"DropPlace"] objectForKey:@"text"];
tempCoordinate.type=[[[drop objectForKey:@"DropType"] objectForKey:@"text"] intValue];
[tempLocationArray addObject:tempCoordinate];
[tempLocation release];
}
[viewController addCoordinates:tempLocationArray];
[viewController startListening];
This shows all the drops overlapped. I need solution on how to fix this issue or what I am doing wrong here that showing locations one over another. Please note that all the drops in my case has different latitude and longitude. I have tested that.
There were no issue in my code, the issue was in server and it was giving me all the data for same geo location. Once I started getting data with different geo locations, my problem was solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With