Tag: 目标,

使用Google Maps iOS SDK 1.4设置mapView.delegate

我刚刚从谷歌地图iOS SDK 1.3.1更新到1.4,现在我的应用程序崩溃,当我设置委托像mapView_.delegate = self 。 如果我删除这一行,我的委托方法不会被调用。 我如何在1.4版本中设置代理? 谢谢

Google SignIn SFSafariViewController / WebView在接受权限后redirect到Google.com

我试图实现我使用Cocoapods安装的新的Google SignIn库。 部署目标是8.4和Im在9.0.2设备中testing。 1-我有适当的plist文件与clientID和reverseID 我有设置的urltypes 3-我有AppDelegate作为GIDSignIn的代理[GIDSignIn sharedInstance].delegate = self; – (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error 我有- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[GIDSignIn sharedInstance] handleURL:url sourceApplication:sourceApplication annotation:annotation]; } – (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[GIDSignIn sharedInstance] handleURL:url sourceApplication:sourceApplication annotation:annotation]; } 5 – 我使用自动GIDSignInButton类和放置在UIViewController的子类,所以我不需要实现GIDSignIn uiDelegate方法。 但是我仍然有[[GIDSignIn sharedInstance] setUiDelegate:self]; […]

Google地图标记不会移除iOS

我正在运行一个线程来每10秒获取驱动程序的位置,并希望从地图中删除添加的标记,但它不工作.. 我的代码: -(void)APiResponse:(id)returnJson { [googleMapsDriverPin setMap:nil]; googleMapsDriverPin = nil; NSMutableArray *driverPins = [[NSMutableArray alloc]init]; for (int x = 0; x < [[returnJson valueForKey:@"drivers"] count]; x++) { CLLocation *driverLocations = [[CLLocation alloc]initWithLatitude:[[[[returnJson valueForKey:@"drivers"] objectAtIndex:x] valueForKey:@"driver_latitude"] doubleValue] longitude:[[[[detail valueForKey:@"drivers"] objectAtIndex:x] valueForKey:@"driver_longitude"] doubleValue]]; [driverPins addObject:driverLocations]; } for (CLLocation *newLocation in driverPins) { googleMapsDriverPin = [[GMSMarker alloc] init]; [googleMapsDriverPin […]

Google Maps iOS SDK将“我的位置”button移动到左下angular

使用Google Maps for iOS SDK,“我的位置”button默认放置在右下angular: 我想把它放在左下angular(是的,我意识到我需要小心不要模糊那里的“Google”标志)。 我不相信SDK有这样做的“官方”方式,但基于这个答案,我已经想出了如何获得我的位置button子视图,以便我可以定位它。 有我困惑的部分是我应该给我的位置视图的框架和/或界限,以获得我想要它的值。 对于初学者来说,我现在所处的“我的位置”button有frame.origin.x = -74和frame.origin.y = -54 。 这是我第一次看到frame.origin.x或frame.origin.y负坐标,我甚至不知道iOS如何处理负坐标。 我的第一个想法是,例如frame.origin.x = -74相当于[view superview].frame.size.width – 74 ,即负值从[view superview].frame.size.width – 74的宽度或高度减去。 但后来我看了超级视图的宽度和高度,他们都是0.0 。 这里是我的代码输出关于地图和我的位置button框架和边界的一些信息: – (void)loadView { GMSCameraPosition *cam = [GMSCameraPosition cameraWithLatitude:jcuTownsvilleCenterCampusLat longitude:jcuTownsvilleCenterCampusLon zoom:17]; self.campusMap = [GMSMapView mapWithFrame:CGRectZero camera:cam]; self.campusMap.myLocationEnabled = YES; self.campusMap.settings.myLocationButton = YES; self.view = self.campusMap; for (UIView *view […]

将图像转换成黑白问题CGContext – iPhone Dev

我正在使用一种方法将用相机拍摄的图像转换为黑白图像。 我遇到的问题是,如果图片是以肖像模式拍摄的,它将在下一个视图中旋转和延伸。 但是,如果在风景拍摄,它只是find。 当我将图像转换为黑白色时,我只能复制这个错误。 这是我正在使用的方法。 林不是100%,这个错误是从转换,但它只发生在转换。 哦是的。 这是iOS 4。 /// – (UIImage *)convertImageToGrayScale:(UIImage *)image { // Create image rectangle with current image width/height CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height); // Grayscale color space CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); // Create bitmap content with current image size and grayscale colorspace CGContextRef context = CGBitmapContextCreate(nil, image.size.width, image.size.height, […]

Google Maps iOS SDK,获取用户的当前位置

对于我的iOS应用程序(在iOS7中iOS7 ),我需要在应用程序加载时显示用户的当前位置。我正在使用Google Maps iOS SDK 。 我正在关注这个谷歌地图,但我无法弄清楚。 请帮助,如果你通过path。