iPhone ARKit 中的位置在一个位置重叠



我正在使用ARKit来开发我的一个增强现实应用程序。但我面临的问题是相机中的位置相互重叠。

当我尝试使用硬编码数据时,我能够在不同的位置显示数据。现在我正在从服务器获取数据并将其显示在 ARKit 上。这将显示彼此重叠的所有位置。

这是我的代码:

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];

这显示所有液滴重叠。我需要有关如何解决此问题或我在这里做错了什么的解决方案,这些位置一个接一个地显示位置。请注意,我的情况中的所有下降都有不同的纬度和经度。我已经测试过了。

我的代码中没有问题,问题出在服务器中,它为我提供了同一地理位置的所有数据。一旦我开始获取具有不同地理位置的数据,我的问题就解决了。

相关内容

最新更新