Google マップ内のビューを閉じた後、GPS をシャットダウンしたいと考えています。でも矢は消えない!
BlockMapView と呼ばれる私のビューからのコードは次のとおりです。
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:g_lat
longitude:g_lng
zoom:15];
self.mapView = [GMSMapView mapWithFrame:self.bounds camera:camera];
self.mapView.delegate = self;
self.mapView.trafficEnabled = YES;
self.mapView.myLocationEnabled = YES;
self.mapView.settings.myLocationButton = YES;
self.mapView.settings.compassButton = YES;
[self addSubview:self.mapView];
そして、BlockMapView の ViewController で、次のように GPS をシャットダウンします。
- (void)viewWillDisappear:(BOOL)animated{
self.blockMapView.mapView.myLocationEnabled = NO;
しかし、GPS はまだ動作しており、20 分間待っていました.....