Commit 93d0f77a authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

track animation

parent f79d917b
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
allowLocationSimulation = "NO"> allowLocationSimulation = "YES">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
@property (nonatomic, strong) GMSCircle * selfCircle; @property (nonatomic, strong) GMSCircle * selfCircle;
@property (nonatomic, strong) GMSMarker * selfMarker; @property (nonatomic, strong) GMSMarker * selfMarker;
@property (nonatomic, assign) float __block zoom; @property (nonatomic, assign) float __block zoom;
@property (nonatomic, assign) float __block animationZoom;
@property (nonatomic, assign) NSTimer * ttt; @property (nonatomic, assign) NSTimer * ttt;
@property (nonatomic, assign) NSInteger tttCount; @property (nonatomic, assign) NSInteger tttCount;
...@@ -172,7 +173,7 @@ ...@@ -172,7 +173,7 @@
} }
- (void)setMapType:(ZJMapType)mapType{ - (void)setMapType:(ZJMapType)mapType{
_mapType = mapType; _mapType = ZJ_GMSMapType;
if (_mapType == ZJ_GMSMapType) { if (_mapType == ZJ_GMSMapType) {
_GGMapView.hidden = NO; _GGMapView.hidden = NO;
_GDMapView.hidden = YES; _GDMapView.hidden = YES;
...@@ -669,6 +670,7 @@ ...@@ -669,6 +670,7 @@
[self.trackTimeView.trackButton setSelected:true]; [self.trackTimeView.trackButton setSelected:true];
[self.trackTimeView.trackButton setEnabled:false]; [self.trackTimeView.trackButton setEnabled:false];
//路径动画1
// dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); // dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
// dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 0.15 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); // dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 0.15 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
// dispatch_source_set_event_handler(timer, ^{ // dispatch_source_set_event_handler(timer, ^{
...@@ -706,8 +708,15 @@ ...@@ -706,8 +708,15 @@
// }); // });
// dispatch_resume(timer); // dispatch_resume(timer);
//路径动画2
//定位路径区域
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithPath:_initiallinepath];
GMSCameraPosition *position = [_GGMapView cameraForBounds:bounds insets:UIEdgeInsetsZero];
_animationZoom = position.zoom;
[self.GGMapView animateToZoom:_animationZoom];
self.tttCount = 0; self.tttCount = 0;
_ttt = [NSTimer scheduledTimerWithTimeInterval:0.15 target:self selector:@selector(animate) userInfo:nil repeats:YES]; _ttt = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(animate) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_ttt forMode:NSRunLoopCommonModes]; [[NSRunLoop currentRunLoop] addTimer:_ttt forMode:NSRunLoopCommonModes];
} }
...@@ -723,7 +732,7 @@ ...@@ -723,7 +732,7 @@
self.actionPolyline.strokeColor = [UIColor greenColor]; self.actionPolyline.strokeColor = [UIColor greenColor];
self.actionPolyline.strokeWidth = 2; self.actionPolyline.strokeWidth = 2;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:coordinate.latitude longitude:coordinate.longitude zoom:20]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:coordinate.latitude longitude:coordinate.longitude zoom:self.animationZoom];
self.actionMarker.position = coordinate; self.actionMarker.position = coordinate;
// self.actionMarker.rotation = location.course // self.actionMarker.rotation = location.course
...@@ -742,8 +751,8 @@ ...@@ -742,8 +751,8 @@
// self.actionMarker.map = nil; // self.actionMarker.map = nil;
// self.actionlinepath = [[GMSMutablePath alloc] init]; // self.actionlinepath = [[GMSMutablePath alloc] init];
[self.trackTimeView.trackButton setSelected:true]; [self.trackTimeView.trackButton setEnabled:true];
[self.trackTimeView.trackButton setEnabled:false]; [self.trackTimeView.trackButton setSelected:false];
[self.ttt invalidate]; [self.ttt invalidate];
self.ttt = nil; self.ttt = nil;
......
...@@ -134,13 +134,13 @@ static ZJLocationManager * manager; ...@@ -134,13 +134,13 @@ static ZJLocationManager * manager;
}else if (error == nil && [placemarks count] == 0) { }else if (error == nil && [placemarks count] == 0) {
NSLog(@"No results were returned."); NSLog(@"No results were returned.");
[self.data WirteDic:@(ZJ_GMSMapType) Key:@"mapType"]; // [self.data WirteDic:@(ZJ_GMSMapType) Key:@"mapType"];
if (self.callBack) { if (self.callBack) {
self.callBack(nil, nil, ZJ_GMSMapType); self.callBack(nil, nil, ZJ_GMSMapType);
} }
} else if (error != nil){ } else if (error != nil){
NSLog(@"An error occurred = %@", error); NSLog(@"An error occurred = %@", error);
[self.data WirteDic:@(ZJ_GMSMapType) Key:@"mapType"]; // [self.data WirteDic:@(ZJ_GMSMapType) Key:@"mapType"];
if (self.callBack) { if (self.callBack) {
self.callBack(nil, nil, ZJ_GMSMapType); self.callBack(nil, nil, ZJ_GMSMapType);
} }
......
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