如何使地球在特定坐标处旋转?我想将地球旋转到 URL 中的特定坐标。我设法做到了,但只有在应用程序关闭时。当它在后台时,它只是移动到南极附近的某个位置,无论我给它的坐标是什么。
这是代码:
- (void)moveToLocation
{
WhirlyGlobe::GeoCoord startCoord;
// If the app wasn started from URL
if ([[GlobalValues sharedGlobalValues] enteredFromURL])
{
float lat = [[GlobalValues sharedGlobalValues] sharedLat];
float lon = [[GlobalValues sharedGlobalValues] sharedLon];
// Set the shared location
startCoord = WhirlyGlobe::GeoCoord::CoordFromDegrees(lon, lat);
// Calculate the rotation and make it
Eigen::Quaternionf startLoc = [self.theView makeRotationToGeoCoord:startCoord keepNorthUp:YES];
self.theView.delegate = [[[AnimateViewRotation alloc] initWithView:self.theView rot:startLoc howLong:5.0] autorelease];
}
}
另外,我怎样才能使它缩放?当应用程序从 url 启动时,它会旋转 + 缩放,但当它在后台时,它不会缩放。