Commit 767b56f0 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 0831a24c
...@@ -58,9 +58,6 @@ ...@@ -58,9 +58,6 @@
@property (nonatomic, strong) GMSMarker * endMarker; @property (nonatomic, strong) GMSMarker * endMarker;
@property (nonatomic, strong) GMSMarker * actionMarker; @property (nonatomic, strong) GMSMarker * actionMarker;
@property (nonatomic, assign) NSInteger count;
@property(nonatomic, retain) NSTimer * timer;
@end @end
@implementation ZJFriendTrackMapViewController @implementation ZJFriendTrackMapViewController
...@@ -255,7 +252,7 @@ ...@@ -255,7 +252,7 @@
CLLocationCoordinate2D position = point; CLLocationCoordinate2D position = point;
GMSMarker *marker = [GMSMarker markerWithPosition:position]; GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.title = @"Hello World"; marker.title = @"Hello World";
marker.map = _mapView; marker.map = _GGMapView;
} }
} }
...@@ -296,45 +293,42 @@ ...@@ -296,45 +293,42 @@
} }
} }
_initialPolyline.path = _initiallinepath; _initialPolyline.path = _initiallinepath;
_initialPolyline.map = _mapView; _initialPolyline.map = _GGMapView;
_startMarker.map = nil; _startMarker.map = nil;
_startMarker = [GMSMarker markerWithPosition:startCoordinate]; _startMarker = [GMSMarker markerWithPosition:startCoordinate];
_startMarker.appearAnimation = kGMSMarkerAnimationPop; _startMarker.appearAnimation = kGMSMarkerAnimationPop;
_startMarker.icon = [UIImage imageNamed:@"map_track_start_icon"]; _startMarker.icon = [UIImage imageNamed:@"map_track_start_icon"];
_startMarker.title = @"start"; _startMarker.title = @"start";
_startMarker.map = _mapView; _startMarker.map = _GGMapView;
_endMarker.map = nil; _endMarker.map = nil;
_endMarker = [GMSMarker markerWithPosition:endCoordinate]; _endMarker = [GMSMarker markerWithPosition:endCoordinate];
_endMarker.appearAnimation = kGMSMarkerAnimationPop; _endMarker.appearAnimation = kGMSMarkerAnimationPop;
_endMarker.icon = [UIImage imageNamed:@"map_track_end_icon"]; _endMarker.icon = [UIImage imageNamed:@"map_track_end_icon"];
_endMarker.title = @"end"; _endMarker.title = @"end";
_endMarker.map = _mapView; _endMarker.map = _GGMapView;
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:(startCoordinate.latitude+endCoordinate.latitude)/2 longitude:(startCoordinate.longitude+endCoordinate.longitude)/2 zoom:_zoom]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:(startCoordinate.latitude+endCoordinate.latitude)/2 longitude:(startCoordinate.longitude+endCoordinate.longitude)/2 zoom:_zoom];
_mapView.camera = camera; _GGMapView.camera = camera;
for(int idx = 0; idx < self.initiallinepath.count; idx++){
}
self.actionMarker.map = nil; self.actionMarker.map = nil;
self.actionMarker = [GMSMarker markerWithPosition:startCoordinate]; self.actionMarker = [GMSMarker markerWithPosition:startCoordinate];
self.actionMarker.icon = [UIImage imageNamed:@"map_track_move_icon"]; self.actionMarker.icon = [UIImage imageNamed:@"map_track_move_icon"];
self.actionMarker.title = @"move"; self.actionMarker.title = @"move";
self.actionMarker.map = self.mapView; self.actionMarker.map = self.GGMapView;
_actionlinepath = [GMSMutablePath path]; _actionlinepath = [GMSMutablePath path];
_count = 0; __block NSInteger count = 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_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.16 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 0.16 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{ dispatch_source_set_event_handler(timer, ^{
if (self.count < self.initiallinepath.count) { if (count < self.initiallinepath.count) {
CLLocationCoordinate2D coordinate = [self.initiallinepath coordinateAtIndex:self.count]; CLLocationCoordinate2D coordinate = [self.initiallinepath coordinateAtIndex:count];
[self.actionlinepath addCoordinate:coordinate]; [self.actionlinepath addCoordinate:coordinate];
self.actionPolyline = [GMSPolyline polylineWithPath:self.actionlinepath]; self.actionPolyline = [GMSPolyline polylineWithPath:self.actionlinepath];
...@@ -348,10 +342,10 @@ ...@@ -348,10 +342,10 @@
[CATransaction setAnimationDuration:0.15]; [CATransaction setAnimationDuration:0.15];
self.actionMarker.position = coordinate; self.actionMarker.position = coordinate;
// self.actionMarker.rotation = location.course // self.actionMarker.rotation = location.course
[self.mapView animateToCameraPosition:camera]; [self.GGMapView animateToCameraPosition:camera];
self.actionPolyline.map = self.mapView; self.actionPolyline.map = self.GGMapView;
[CATransaction commit]; [CATransaction commit];
self.count++; count++;
}else{ }else{
dispatch_source_cancel(timer); dispatch_source_cancel(timer);
} }
......
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