objective-c高德地图时时定位
2016-01-07 11:42
441 查看
这篇随笔是对上一遍servlet接口的实现。
一、项目集成高德地图
应为我这个项目使用了cocopods这个第三方库管理工具,所以只需要很简单的步骤,就能将高德地图集成到项目中,如果你没使用过这工具,那就直接下载对应的sdk导入即可,因为这个工具的安装还是比较麻烦的,需要FQ。 既然我用的这种方式,下面我就贴相关的使用接图。
View Code
最后服务人员将这些获取的参数提交到servlet处理。
一、项目集成高德地图
应为我这个项目使用了cocopods这个第三方库管理工具,所以只需要很简单的步骤,就能将高德地图集成到项目中,如果你没使用过这工具,那就直接下载对应的sdk导入即可,因为这个工具的安装还是比较麻烦的,需要FQ。 既然我用的这种方式,下面我就贴相关的使用接图。
- (void)mapViewDidStopLocatingUser:(MAMapView *)mapView { _longitude=[NSString stringWithFormat:@"%f",mapView.userLocation.location.coordinate.longitude];//@"106.546128";// _latitude= [NSString stringWithFormat:@"%f",mapView.userLocation.location.coordinate.latitude]; //@"29.559153"; [WDUser currentUser].longitude=_longitude; [WDUser currentUser].latitude=_latitude; [[WDUser currentUser] saveUserInfo]; _search = [[AMapSearchAPI alloc] initWithSearchKey:@"?" Delegate:self]; AMapReGeocodeSearchRequest *regeoRequest = [[AMapReGeocodeSearchRequest alloc] init]; regeoRequest.searchType = AMapSearchType_ReGeocode; regeoRequest.location =[AMapGeoPoint locationWithLatitude:[_latitude floatValue] longitude:[_longitude floatValue]]; regeoRequest.radius = 10000; regeoRequest.requireExtension = YES; //发起逆地理编码 [_search AMapReGoecodeSearch: regeoRequest]; } //逆编码查询代理 - (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response { if(response.regeocode != nil) { _compantAddress=response.regeocode.addressComponent; _currentCityName=_compantAddress.province; _currentCityName= [_currentCityName stringByReplacingOccurrencesOfString:@"市" withString:@""]; _currentCityName= [_currentCityName stringByReplacingOccurrencesOfString:@"省" withString:@""]; [ WDUser currentUser].currentCity=_currentCityName; [[WDUser currentUser] saveUserInfo]; [SVProgressHUD dismiss]; } else{ showMessage(@"请检查网是否畅通!"); } } - (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation { mapView.showsUserLocation = NO; }//联系客户
View Code
最后服务人员将这些获取的参数提交到servlet处理。
相关文章推荐
- SetValue:forKey和SetObject:forKey的区别
- Object-C 切换到 Swift 全程直播
- Objective-C中的SEL、IMP和Class类型
- Objective C类方法load和initialize的区别
- C++11的future和promise及active object并发模式
- Objective-C中的实例方法、类方法、Category、Protocol
- URL-encoded form data is not valid ,Operation is not valid due to the current state of the object
- 多线程学习笔记
- Ruby基础语法(1): Object
- Guava学习笔记(3):复写的Object常用方法
- 【Objective-C学习记录】第三十六天
- Objective-C的继承与组合
- Objective-C的继承与组合
- 2016 - 我的读书计划
- ObjectStateManager 中已存在具有同一键的对象。ObjectStateManager 无法跟踪具有相同键的多个对象
- QT 读 QObject类
- 自定义View时,用到Paint Canvas的一些温故,PropertyAnimation中的ObjectAnimator(动画三,“大大姐”的旋转跳跃)
- 自定义View时,用到Paint Canvas的一些温故,PropertyAnimation中的ObjectAnimator(动画三,“大大姐”的旋转跳跃)
- swfobject.js 详细解说
- Photos(PHObjectChangeDetails)