Tag: 位置

捕获用户位置:澄清

我有一个应用程序捕获用户的位置,并将这个信息发送到我的服务器。 我已经开始使用LocationManager服务: – (CLLocationManager *)locationManager { if (_locationManager == nil) { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; isUpdatingLocation = NO; } return _locationManager; } -(void) startLookingForLocation{ [self locationManager].desiredAccuracy = kCLLocationAccuracyBest; [self locationManager].distanceFilter = 250; if([[self locationManager]respondsToSelector:@selector(setPausesLocationUpdatesAutomatically:)]) [[self locationManager] setPausesLocationUpdatesAutomatically:YES]; if([[self locationManager]respondsToSelector:@selector(setActivityType:) ]) [[self locationManager] setActivityType:CLActivityTypeFitness]; [[self locationManager] startUpdatingLocation]; [[self locationManager] startUpdatingHeading]; isUpdatingLocation = […]

如何张贴iOS的图像到Facebook的位置?

我正试图与Facebook分享位置。 我已成功共享图片,但无法共享位置。 下面是我的共享图像的代码。 UIImage *facebookImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imagesURL,str]]]]; NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; [params setObject:@"New Happening created on the HappenShare mobile app." forKey:@"message"]; [params setObject:facebookImage forKey:@"picture"]; [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection,id result,NSError *error) { if (error) { NSLog(@"error : %@",error); } else { NSLog(@"Result : %@",result); } }]; 现在分享位置我应该在上面的代码中添加什么参数。 我附加一个图像也更好地了解如何共享位置将看起来像。低于图像显示如何带有文本的图像将指示到地图的位置。 […]

Google Maps API:获取当前位置iOS的坐标

我目前正在使用我的项目中的Google Maps API。 我正在设置默认的摄像头/缩放到用户的位置。 我这样做: @implementation ViewController{ GMSMapView *mapView_; } @synthesize currentLatitude,currentLongitude; – (void)viewDidLoad { [super viewDidLoad]; mapView_.settings.myLocationButton = YES; mapView_.myLocationEnabled = YES; } – (void)loadView{ CLLocation *myLocation = mapView_.myLocation; GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = CLLocationCoordinate2DMake(myLocation.coordinate.latitude, myLocation.coordinate.longitude); marker.title = @"Current Location"; marker.map = mapView_; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:myLocation.coordinate.latitude longitude:myLocation.coordinate.longitude zoom:6]; mapView_ […]

不断跟踪iOS上的用户位置

当他接近一些有趣的事情时,我需要不断监视用户的位置以通知他。 哪个是实现这个的正确方法? 我还没有能够保持计时器在后台运行(定期更新用户在服务器上的位置),我也看到订阅重大的位置更改可以让我接收位置更新,即使应用程序不运行,但我无法实现。 我在正确的道路上? 还有其他的select吗? 编辑 – 有一个必要条件,我应该已经暴露,这可能使我放松对真正的问题的重点: 有趣的“东西”用户没有一个固定的位置,所以在发送推动之前,我必须确保用户目前在该位置(当然,我可以假设它为n分钟)。

是否可以使用MKLocalSearch查找所有附近的商家?

为了避免foursquare或其他本地search提供者的API限制,我想使用iOS 6.1中的MKLocalSearch。 以下代码: MKLocalSearchRequest *localSearchRequest = [[MKLocalSearchRequest alloc] init]; MKCoordinateRegion localSearchRegion = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2DMake([theLocationChange.latitude floatValue], [theLocationChange.longitude floatValue]), 500.0f, 500.0f); localSearchRequest.naturalLanguageQuery = @"restaurants"; localSearchRequest.region = localSearchRegion; MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:localSearchRequest]; [localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) { if (error) { NSLog([error localizedDescription]); } for (MKMapItem* mapItem in response.mapItems) { NSLog(@"mapitem name is: %@",mapItem.name); } }]; 将在指定位置附近正确提取并显示餐馆。 […]

iPhone如何在使用它们进行位置估算时学习新的WiFi位置

我知道iPhone可以并确实使用WiFi接近度来获得大概的位置。 这显然只有在天空中的某个数据库知道该WiFi热点的大概位置时才会发生。 我的问题是热点如何进入该数据库? 当iPhone具有相当准确的GPS位置并检测到WiFi或者是否存在某些手动或程序化的添加热点的方式时,它是否会自动添加?

使用SWIFTsearch地址

在我的应用程序中,我需要用户input他的家庭地址,但我不能以任何方式显示地址只显示在用户区域,并且是完整的地址,如225e 57th st, NY, New York 。 我想给用户在tableview上列出的所有选项,并在用户input他的地址时过滤它们。

函数“didUpdateToLocation”被调用而没有改变

我这样初始化locationManager: if (!self.locManager) { self.locManager = [[CLLocationManager alloc] init]; self.locManager.delegate = self; [locManager startMonitoringSignificantLocationChanges]; } 我的设备不动,仍然每次都调用“didUpdateToLocation”。 什么可能是一个问题? 谢谢

如何在Mapkit中增加userLocation注解的半径

我的应用程序需要用户权限并将地图移动到该位置。 并在该位置默认情况下MapKit添加一个蓝色的图标,这是产生一些脉冲。 我search了一下,但是我发现如何在userLocation周围添加一个1000米的圆。 我不要那个。 你可以说我正在寻找自定义userLocation默认annotation 。 它产生的蓝色脉冲我想增加这个radius 。 当这个蓝色的脉冲击中一个自定义annotation ,应该有一个触发的方法。 那么如何实现呢?

尽pipe基于位置的应用程序使用快速应用程序切换器杀死,但状态栏中显示灰色GPS箭头

我正在为iOS 5编写一个基于位置的应用程序。应用程序正在使用CLLocationManager来接收位置更新。 当应用程序启动时,我正在创buildLocationManager,调用[self.locationManager startUpdatingLocation]; 灰色的位置箭头出现在状态栏中。 当应用程序进入后台我打电话 [self.locationManager stopUpdatingLocation]; [self.locationManager startMonitoringSignificantLocationChanges]; 因为我只想在应用程序处于后台时收到重要的位置更改。 灰色的位置箭头仍然显示。 我在我的应用程序中也有一个退出button [self.locationManager stopUpdatingLocation]; exit(0); 当用户按下“退出”button时,应用程序结束,灰色位置button从状态栏中消失。 一切都很好,直到现在。 当用户使用快速应用程序切换器完成应用程序时,会出现问题,因为之后灰色位置箭头仍显示在状态栏中,尽pipe应用程序未运行。 当用户从他的iPhone中删除应用程序时,灰色位置箭头首先消失。 所以问题是: 当用户使用快速应用程序切换器完成应用程序并且灰色箭头仍显示在状态栏中,这是否意味着,位置更新仍然执行或这是否意味着应用程序在过去24小时内使用位置服务? 我想答案是第一个,位置更新仍然执行! 应用程序需要在后台执行,所以当应用程序进入后台时,无法停止LocationManager。 applicationWillTerminate:当用户使用快速应用程序切换器杀死应用程序时从未被调用。 有什么办法可以收到一个事件,当应用程序被终止使用快速应用程序切换器或终止的操作系统? 我已经看到一些其他的应用程序,当应用程序被快速应用程序切换器杀死时,状态栏中的灰色箭头消失。 这些应用程序如何实现?