Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZhiJi-Overseas
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
ZhiJi-Overseas
Commits
f79d917b
Commit
f79d917b
authored
Jul 24, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
df107d97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
27 deletions
+72
-27
.DS_Store
.DS_Store
+0
-0
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+72
-27
No files found.
.DS_Store
View file @
f79d917b
No preview for this file type
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
f79d917b
...
...
@@ -50,10 +50,11 @@
@property
(
nonatomic
,
strong
)
GMSCircle
*
selfCircle
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
selfMarker
;
@property
(
nonatomic
,
assign
)
float
__block
zoom
;
@property
(
nonatomic
,
assign
)
NSTimer
*
ttt
;
@property
(
nonatomic
,
assign
)
NSInteger
tttCount
;
@property
(
nonatomic
,
strong
)
GMSPolyline
*
initialPolyline
;
@property
(
nonatomic
,
strong
)
GMSPolyline
*
actionPolyline
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
arrayPolylineGreen
;
@property
(
nonatomic
,
strong
)
GMSMutablePath
*
initiallinepath
;
@property
(
nonatomic
,
strong
)
GMSMutablePath
*
actionlinepath
;
...
...
@@ -668,42 +669,86 @@
[
self
.
trackTimeView
.
trackButton
setSelected
:
true
];
[
self
.
trackTimeView
.
trackButton
setEnabled
:
false
];
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_event_handler
(
timer
,
^
{
// 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_event_handler(timer, ^{
//
// if (count < self.initiallinepath.count) {
//
// CLLocationCoordinate2D coordinate = [self.initiallinepath coordinateAtIndex:count];
// [self.actionlinepath addCoordinate:coordinate];
//
// GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:coordinate.latitude longitude:coordinate.longitude zoom:20];
//
// self.actionPolyline = [GMSPolyline polylineWithPath:self.actionlinepath];
// self.actionPolyline.strokeColor = [UIColor greenColor];
// self.actionPolyline.strokeWidth = 2;
//
// [CATransaction begin];
// [CATransaction setAnimationDuration:0.14];
//
// self.actionMarker.position = coordinate;
//// self.actionMarker.rotation = location.course
// [self.GGMapView animateToCameraPosition:camera];
// self.actionPolyline.map = self.GGMapView;
// [CATransaction commit];
// count++;
// }else{
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// dispatch_async(dispatch_get_main_queue(), ^{
//
// [self.trackTimeView.trackButton setEnabled:true];
// [self.trackTimeView.trackButton setSelected:false];
// });
// });
// dispatch_source_cancel(timer);
// }
// });
// dispatch_resume(timer);
if
(
count
<
self
.
initiallinepath
.
count
)
{
self
.
tttCount
=
0
;
_ttt
=
[
NSTimer
scheduledTimerWithTimeInterval
:
0
.
15
target
:
self
selector
:
@selector
(
animate
)
userInfo
:
nil
repeats
:
YES
];
[[
NSRunLoop
currentRunLoop
]
addTimer
:
_ttt
forMode
:
NSRunLoopCommonModes
];
}
CLLocationCoordinate2D
coordinate
=
[
self
.
initiallinepath
coordinateAtIndex
:
count
];
[
self
.
actionlinepath
addCoordinate
:
coordinate
];
-
(
void
)
animate
{
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:
coordinate
.
latitude
longitude
:
coordinate
.
longitude
zoom
:
20
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
.
tttCount
<
self
.
initiallinepath
.
count
)
{
CLLocationCoordinate2D
coordinate
=
[
self
.
initiallinepath
coordinateAtIndex
:
self
.
tttCount
];
[
self
.
actionlinepath
addCoordinate
:
coordinate
];
self
.
actionPolyline
=
[
GMSPolyline
polylineWithPath
:
self
.
actionlinepath
];
self
.
actionPolyline
.
strokeColor
=
[
UIColor
greenColor
];
self
.
actionPolyline
.
strokeWidth
=
2
;
[
CATransaction
begin
];
[
CATransaction
setAnimationDuration
:
0
.
14
];
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:
coordinate
.
latitude
longitude
:
coordinate
.
longitude
zoom
:
20
];
self
.
actionMarker
.
position
=
coordinate
;
// self.actionMarker.rotation = location.course
// self.actionMarker.rotation = location.course
[
self
.
GGMapView
animateToCameraPosition
:
camera
];
self
.
actionPolyline
.
map
=
self
.
GGMapView
;
[
CATransaction
commit
];
count
++
;
}
else
{
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
trackTimeView
.
trackButton
setEnabled
:
true
];
[
self
.
trackTimeView
.
trackButton
setSelected
:
false
];
});
});
dispatch_source_cancel
(
timer
);
self
.
tttCount
++
;
// self.actionMarker.map = nil;
// self.actionMarker = [GMSMarker markerWithPosition:[path coordinateAtIndex:self.count]];
// self.actionMarker.icon = [UIImage imageNamed:@"map_track_move_icon"];
// self.actionMarker.title = @"move";
// self.actionMarker.map = self.mapView;
}
else
{
self
.
tttCount
=
0
;
// self.actionMarker.map = nil;
// self.actionlinepath = [[GMSMutablePath alloc] init];
[
self
.
trackTimeView
.
trackButton
setSelected
:
true
];
[
self
.
trackTimeView
.
trackButton
setEnabled
:
false
];
[
self
.
ttt
invalidate
];
self
.
ttt
=
nil
;
}
});
dispatch_resume
(
timer
);
}
#pragma mark - GMSMap Delegate google
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment