Commit 9a7bf36e authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 3a69aa84
......@@ -19,7 +19,7 @@
@property (nonatomic, strong) ZJFriendModel *selectFriendModel;
@property (nonatomic, assign) ZJMapType mapType;
@property (nonatomic, assign) BOOL friendTrack;
/********************/
@property (nonatomic, strong) MAMapView * GDMapView;
///全轨迹overlay
......@@ -45,7 +45,7 @@
self.friendDataSource = [NSMutableArray array];
[self setupUI];
[self getFriendList];
// [self getFriendList];
}
- (void)viewDidAppear:(BOOL)animated {
......@@ -62,6 +62,12 @@
}
self.mapType = mapType;
if (!self.friendTrack){
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude);
self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
[self setPoint:coord target:1];
}
}];
}
......@@ -71,7 +77,7 @@
}
- (void)setMapType:(ZJMapType)mapType{
_mapType = ZJ_GMSMapType;
_mapType = mapType;
if (_mapType == ZJ_GMSMapType) {
_GGMapView.hidden = NO;
_GDMapView.hidden = YES;
......@@ -104,8 +110,7 @@
[self setPoint:camera.target target:1];
self.GDMapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
// self.GDMapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
_GDMapView.delegate = self;
_GDMapView.zoomLevel = 14;
_GDMapView.showsScale = false;
......@@ -122,7 +127,7 @@
_GDMapView.mapLanguage = @1;
[_GDMapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
}
[self.view addSubview: _GDMapView];
// [self.view addSubview: _GDMapView];
_GDMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_GDMapView.hidden = YES;
......@@ -233,7 +238,7 @@
if (self.mapType == ZJ_GMSMapType){
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake([[[self.data Read] objectForKey:@"latitude"] doubleValue], [[[self.data Read] objectForKey:@"longitude"] doubleValue]);
[self setPoint:coord target:2];
[self setPoint:coord target:1];
}else{
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
self.GDMapView.showsUserLocation = YES;
......@@ -262,6 +267,7 @@
#pragma mark 获取最后一次位置
- (void)getLastLocation:(ZJFriendModel *)model{
self.friendTrack = NO;
if (![ZJUserInfoManager shared].isMember) {
return;
}
......@@ -284,10 +290,11 @@
double lat = [response[@"result"][@"data"][@"lat"] doubleValue];
double lon = [response[@"result"][@"data"][@"lon"] doubleValue];
self.friendTrack = YES;
if (self.mapType == ZJ_GMSMapType){
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(lat, lon);
self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
[self setPoint:coord target:1];
[self setPoint:coord target:2];
[_self.GGMapView animateToLocation:coord];
}else{
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
......
......@@ -31,7 +31,6 @@
@property (nonatomic, strong) ZJAlertView *alertView;
@property (nonatomic, assign) BOOL refershMyself;
@property (nonatomic, assign) ZJMapType mapType;
/********************/
......@@ -97,7 +96,6 @@
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
self.refershMyself = YES;
[[ZJLocationManager shared] initWithLocationUpdateInfo:^(ZJLocationModel * model, CLLocation * location, ZJMapType mapType) {
if(!model){
......@@ -105,15 +103,12 @@
}
self.mapType = mapType;
//
// CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(model.latitude, model.longitude);
//
// if (self.refershMyself) {
// self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
// self.refershMyself = NO;
// }
//
// [self setPoint:coord target:1];
if (self.isMyTrack){
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(location.coordinate.latitude, location.coordinate.longitude);
self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
[self setPoint:coord target:1];
}
}];
}
......@@ -171,7 +166,7 @@
}
- (void)setMapType:(ZJMapType)mapType{
_mapType = ZJ_GMSMapType;
_mapType = mapType;
if (_mapType == ZJ_GMSMapType) {
_GGMapView.hidden = NO;
_GDMapView.hidden = YES;
......@@ -194,7 +189,7 @@
_GGMapView.hidden = YES;
self.GDMapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
// self.GDMapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
_GDMapView.delegate = self;
_GDMapView.zoomLevel = 14;
_GDMapView.showsScale = false;
......@@ -211,7 +206,7 @@
_GDMapView.mapLanguage = @1;
[_GDMapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
}
[self.view addSubview: _GDMapView];
// [self.view addSubview: _GDMapView];
_GDMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_GDMapView.hidden = YES;
......@@ -402,10 +397,7 @@
if (self.mapType == ZJ_GMSMapType){
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(lat, lon);
if (self.refershMyself) {
self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
self.refershMyself = NO;
}
self.GGMapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
[self setPoint:coord target:1];
}else{
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
......
......@@ -169,8 +169,8 @@ static ZJLocationManager * manager;
BOOL isChina = NO;
isChina = [placemark.ISOcountryCode isEqualToString:@"CN"];
_mapType = isChina ? ZJ_MAMapType : ZJ_GMSMapType;
// _mapType = isChina ? ZJ_MAMapType : ZJ_GMSMapType;
_mapType = ZJ_GMSMapType;
[self.data WirteDic:@(_mapType) Key:@"mapType"];
[self.data WirteDic:@(coord.latitude) Key:@"latitude"];
[self.data WirteDic:@(coord.longitude) Key:@"longitude"];
......
......@@ -100,7 +100,7 @@ static ZJUserInfoManager * manager;
- (BOOL)isLogin{
NSString * userInfoStr = [[self.data Read] objectForKey:@"userInfoDic"];
NSDictionary * userInfo = [self convertJsonStringToNSDictionary:userInfoStr];
return userInfo?YES:NO;
return userInfo ? YES : NO;
}
- (BOOL)isTourist{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment