简体   繁体   English

适用于iOS的Google Maps SDK? CoreLocationDelegate

[英]Google Maps SDK for iOS? CoreLocationDelegate

I am working on an iOS 7 app that needs ultimate accuracy in showing user location, I need to use google maps as well. 我正在开发一个iOS 7应用程序,该应用程序在显示用户位置时需要极高的准确性,我也需要使用Google地图。 This app will continually show walking directions for the user from one location to another. 这个应用程式会持续显示使用者从一个地点到另一个地点的步行路线。

I started with the corelocation framework and delegate, and configured my CLLocationManager like this 我从corelocation框架和委托开始,并像这样配置我的CLLocationManager

_locationManager = [[CLLocationManager alloc] init];
[_locationManager setDelegate:self];
self.locationManager.headingOrientation = CLDeviceOrientationFaceUp;
[self.locationManager setDistanceFilter:kCLDistanceFilterNone];
[self.locationManager setDesiredAccuracy:kCLLocationAccuracyBestForNavigation];
[self.locationManager startUpdatingLocation];
self.locationManager.activityType = CLActivityTypeFitness;

Now I went on to integrate the google maps SDK using cocoapods, and downloaded the googleSDK Samples, But I notice that in their own samples Google does not use a CLLocationManager, but rather it seems that the SDK picks up the location by itself. 现在,我继续使用cocoapods集成了google maps SDK,并下载了googleSDK样本。但是我注意到,在他们自己的样本中,Google并未使用CLLocationManager,而是看起来该SDK本身是在拾取位置。

My question is : Is this optimal? 我的问题是:这是最佳选择吗? can I configure the accuracy of the geolocation service in the Google SDK? 如何在Google SDK中配置地理位置服务的准确性? has anyone used that and had any issues? 有没有人使用过并且有任何问题?

I just don't wanna invest in Google SDK and throw away the native apple provided CLLocationManager. 我只是不想投资Google SDK并扔掉CLLocationManager提供的本地苹果。

You can use both, same like you would use Core Location and Apple's MKMapKit. 您可以同时使用两者,就像使用Core Location和Apple的MKMapKit一样。 Each framework is used for something else and if you do need mapping as well as some information only available in Core Location, you can subscribe to both. 每个框架都用于其他用途,如果您确实需要映射以及某些仅在Core Location中可用的信息,则可以同时订阅两者。

If you do need google's mapping and it will provide you with location data you need, then you can skip Core Location. 如果您确实需要Google的地图,并且它将为您提供所需的位置数据,则可以跳过核心位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM