2012-09-22 45 views
5

我正在使用ARKit作爲我的增強現實應用程序之一。但是我面臨的問題是相機中的位置彼此重疊。iPhone中的位置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]; 

這說明所有的滴重疊。我需要解決如何解決這個問題,或者我在這裏做錯了什麼,顯示位置在另一個之上。請注意,在我的情況下所有的滴都有不同的經度和緯度。我已經測試過了。

+0

Hi @Dipak你有沒有得到任何解決方案?我面臨同樣的問題。 –

回答

1

我的代碼沒有問題,問題出在服務器上,它給我所有相同地理位置的數據。一旦我開始獲取具有不同地理位置的數據,我的問題就解決了。