自2018年10月18日起,高德开发者论坛除车机板块外,其他板块将停止发帖与维护,如您有使用问题请 提交工单 联系我们,感谢您的理解。
请问大神怎样才能手机号码基站定位? |
楼主, 问题解决了吗., 我的一次定位, 第一次定位成功, 后来的同样的代码都没有成功 |
定位结束以后 断点试一下self.mapView.showsUserLocation = NO;有调用么? |
发帖都发不了 只能插楼了!!!! 关闭定位无效 v3.3.0 self.mapView.showsUserLocation = NO;没有作用 在两个界面都显示了地图 设置无效 至于sdk版本 我是直接pod安装的 没有写版本号,所以就是最新的版本 部分代码: @property (nonatomic,weak) MAMapView * mapView;//地图 -(MAMapView *)mapView{ if (!_mapView) { MAMapView * mapview = [[MAMapView alloc]initWithFrame:self.view.bounds]; mapview.delegate = self; mapview.showsScale = NO; _mapView.showsUserLocation = YES; _mapView.userTrackingMode = MAUserTrackingModeNone; _mapView = mapview; _mapView.zoomLevel = 19; _mapView.showsCompass = NO; } return _mapView; } 在定位中 关闭无效 -(void)mapViewMAMapView *)mapView didUpdateUserLocationMAUserLocation *)userLocation updatingLocationBOOL)updatingLocation { if(updatingLocation) { self.mapView.centerCoordinate = self.mapView.userLocation.location.coordinate; //取出当前位置的坐标 NSLog(@"当前位置:latitude : %f,longitude: %f",userLocation.coordinate.latitude,userLocation.coordinate.longitude); CLLocation * cll = [[CLLocation alloc] initWithLatitude:self.mapView.userLocation.location.coordinate.latitude longitude:self.mapView.userLocation.location.coordinate.longitude]; CLGeocoder *clGeoCoder = [[CLGeocoder alloc] init]; [clGeoCoder reverseGeocodeLocation:cll completionHandler: ^(NSArray *placemarks,NSError *error) { CLPlacemark *placeMark = [placemarks firstObject]; NSDictionary *addressDic=placeMark.addressDictionary; // NSString *state=[addressDic objectForKey"State"];//省 self.city =[addressDic objectForKey"City"];//市 // NSString *subLocality=[addressDic objectForKey"SubLocality"];//区 // NSString *street=[addressDic objectForKey"Street"];//街道 self.mapView.showsUserLocation = NO; }]; } } 望解决!!!没辙了 不然也不会这个点发!!!!! |
不要搞成局部局部变量,亲~ AMapLocationManager被释放的时候,自然会cancel掉~ |
也遇到同样的问题,单次定位提示error为取消,但在使用delegate多次定位,有写delegate,没有回调。 |
设置代理了吗? |
你设置代理了吗?没设置self,怎么可能走代理方法。 |