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
b5aee91b
Commit
b5aee91b
authored
Jul 12, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
99dad828
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
388 additions
and
100 deletions
+388
-100
.DS_Store
.DS_Store
+0
-0
ZhiJi.xcscheme
ZhiJi.xcodeproj/xcshareddata/xcschemes/ZhiJi.xcscheme
+6
-2
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+45
-7
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+337
-91
No files found.
.DS_Store
View file @
b5aee91b
No preview for this file type
ZhiJi.xcodeproj/xcshareddata/xcschemes/ZhiJi.xcscheme
View file @
b5aee91b
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1150"
version =
"1.
3
"
>
version =
"1.
7
"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
...
...
@@ -39,7 +39,7 @@
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"
YES
"
>
allowLocationSimulation =
"
NO
"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
...
...
@@ -50,6 +50,10 @@
ReferencedContainer =
"container:ZhiJi.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<LocationScenarioReference
identifier =
"com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType =
"1"
>
</LocationScenarioReference>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
...
...
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
b5aee91b
...
...
@@ -8,6 +8,7 @@
#import "ZJBaseMapViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import "ZJLocationManager.h"
@interface
ZJBaseMapViewController
()
<
MAMapViewDelegate
,
XMPopupListViewDelegate
,
GMSMapViewDelegate
>
...
...
@@ -20,7 +21,11 @@
@property
(
nonatomic
,
strong
)
ZJMapCardFriendSelectView
*
selectView
;
@property
(
nonatomic
,
strong
)
ZJFriendModel
*
selectFriendModel
;
@property
(
nonatomic
,
strong
)
GMSMapView
*
mapView
;
@property
(
nonatomic
,
strong
)
GMSMapView
*
mapView
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
selfMarker
;
@property
(
nonatomic
,
assign
)
float
zoom
;
@property
(
nonatomic
,
assign
)
BOOL
refershMyself
;
@end
...
...
@@ -43,6 +48,19 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
// [self getFriendList];
});
self
.
refershMyself
=
YES
;
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
)
{
CLLocationCoordinate2D
coord
=
CLLocationCoordinate2DMake
(
model
.
latitude
,
model
.
longitude
);
if
(
self
.
refershMyself
)
{
self
.
mapView
.
camera
=
[
GMSCameraPosition
cameraWithTarget
:
coord
zoom
:
self
.
zoom
];
self
.
refershMyself
=
NO
;
}
[
self
setPoint
:
coord
target
:
1
];
}];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
...
@@ -54,6 +72,8 @@
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:
-
33
.
868
longitude
:
151
.
2086
zoom
:
12
];
_zoom
=
14
;
///初始化地图
// self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
self
.
mapView
=
[
GMSMapView
mapWithFrame
:
self
.
view
.
bounds
camera
:
camera
];
...
...
@@ -72,7 +92,7 @@
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
// }
//
_mapView.delegate = self;
_mapView
.
delegate
=
self
;
// _mapView.zoomLevel = 14;
// _mapView.showsScale = false;
// _mapView.showsCompass = false;
...
...
@@ -132,11 +152,29 @@
};
}
-
(
void
)
setPoint
:
(
CLLocationCoordinate2D
)
point
{
CLLocationCoordinate2D
position
=
point
;
GMSMarker
*
marker
=
[
GMSMarker
markerWithPosition
:
position
];
marker
.
title
=
@"Hello World"
;
marker
.
map
=
_mapView
;
-
(
void
)
setPoint
:
(
CLLocationCoordinate2D
)
point
target
:
(
NSInteger
)
target
{
if
(
target
==
1
)
{
CLLocationCoordinate2D
position
=
point
;
_selfMarker
.
map
=
nil
;
_selfMarker
=
[
GMSMarker
markerWithPosition
:
position
];
// _selfMarker.appearAnimation = kGMSMarkerAnimationPop;
// _selfMarker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]];
_selfMarker
.
icon
=
[
UIImage
imageNamed
:
@"map_track_srart_end_icon"
];
_selfMarker
.
tracksInfoWindowChanges
=
YES
;
_selfMarker
.
title
=
@"Me"
;
_selfMarker
.
snippet
=
@"WTF"
;
_selfMarker
.
infoWindowAnchor
=
CGPointMake
(
0
.
5
,
0
.
25
);
_selfMarker
.
map
=
_mapView
;
}
else
{
CLLocationCoordinate2D
position
=
point
;
GMSMarker
*
marker
=
[
GMSMarker
markerWithPosition
:
position
];
marker
.
title
=
@"Hello World"
;
marker
.
map
=
_mapView
;
}
}
-
(
void
)
mapView
:
(
GMSMapView
*
)
mapView
idleAtCameraPosition
:
(
GMSCameraPosition
*
)
position
{
_zoom
=
position
.
zoom
;
}
-
(
void
)
mapView
:
(
UIView
*
)
mapView
regionDidChangeAnimated
:
(
BOOL
)
animated
{
...
...
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
b5aee91b
This diff is collapsed.
Click to expand it.
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