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
0e962746
Commit
0e962746
authored
Jul 23, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
767b56f0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
351 additions
and
328 deletions
+351
-328
ZJBaseCareViewController.m
ZhiJi/Classes/Care/Controller/ZJBaseCareViewController.m
+5
-2
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+5
-1
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+320
-322
ZJLocationManager.h
ZhiJi/Classes/Tools/UserInfoManager/ZJLocationManager.h
+8
-1
ZJLocationManager.m
ZhiJi/Classes/Tools/UserInfoManager/ZJLocationManager.m
+13
-2
No files found.
ZhiJi/Classes/Care/Controller/ZJBaseCareViewController.m
View file @
0e962746
...
...
@@ -56,11 +56,14 @@
// if ([CLLocationManager locationServicesEnabled]) {
// [self.locationManager startUpdatingLocation];
// }
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
)
{
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
,
ZJMapType
mapType
)
{
if
(
!
model
){
return
;
}
[
self
updateMySelf
:
model
];
// [self uploadSelfLocation:location placemark:model];
// [self uploadSelfLocation:location placemark:model];
}];
}
...
...
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
0e962746
...
...
@@ -50,7 +50,11 @@
});
self
.
refershMyself
=
YES
;
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
)
{
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
,
ZJMapType
mapType
)
{
if
(
!
model
){
return
;
}
CLLocationCoordinate2D
coord
=
CLLocationCoordinate2DMake
(
model
.
latitude
,
model
.
longitude
);
...
...
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
0e962746
This diff is collapsed.
Click to expand it.
ZhiJi/Classes/Tools/UserInfoManager/ZJLocationManager.h
View file @
0e962746
...
...
@@ -11,7 +11,12 @@
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
locationUpdateInfoCallBack
)(
ZJLocationModel
*
,
CLLocation
*
);
typedef
enum
:
NSUInteger
{
ZJ_GMSMapType
,
ZJ_MAMapType
}
ZJMapType
;
typedef
void
(
^
locationUpdateInfoCallBack
)(
ZJLocationModel
*
_Nullable
,
CLLocation
*
_Nullable
,
ZJMapType
);
@interface
ZJLocationManager
:
NSObject
...
...
@@ -19,6 +24,8 @@ typedef void(^locationUpdateInfoCallBack)(ZJLocationModel *, CLLocation *);
@property
(
nonatomic
,
strong
,
readonly
)
CLLocation
*
currentLocation
;
@property
(
nonatomic
,
assign
,
readonly
)
ZJMapType
mapType
;
+
(
instancetype
)
shared
;
-
(
void
)
initWithLocationUpdateInfo
:(
locationUpdateInfoCallBack
)
callBack
;
...
...
ZhiJi/Classes/Tools/UserInfoManager/ZJLocationManager.m
View file @
0e962746
...
...
@@ -109,6 +109,7 @@ static ZJLocationManager * manager;
[
geocoder
reverseGeocodeLocation
:
loctaion
completionHandler
:
^
(
NSArray
<
CLPlacemark
*>
*
_Nullable
placemarks
,
NSError
*
_Nullable
error
)
{
if
(
placemarks
.
count
>
0
)
{
CLPlacemark
*
placemark
=
[
placemarks
firstObject
];
//获取城市
NSString
*
city
=
placemark
.
locality
;
...
...
@@ -133,8 +134,14 @@ static ZJLocationManager * manager;
}
else
if
(
error
==
nil
&&
[
placemarks
count
]
==
0
)
{
NSLog
(
@"No results were returned."
);
if
(
self
.
callBack
)
{
self
.
callBack
(
nil
,
nil
,
ZJ_GMSMapType
);
}
}
else
if
(
error
!=
nil
){
NSLog
(
@"An error occurred = %@"
,
error
);
if
(
self
.
callBack
)
{
self
.
callBack
(
nil
,
nil
,
ZJ_GMSMapType
);
}
}
}];
...
...
@@ -158,8 +165,12 @@ static ZJLocationManager * manager;
[
self
uploadSelfLocation
:
location
placemark
:
model
];
BOOL
isChina
=
NO
;
isChina
=
[
placemark
.
ISOcountryCode
isEqualToString
:
@"CN"
];
_mapType
=
isChina
?
ZJ_MAMapType
:
ZJ_GMSMapType
;
if
(
_callBack
)
{
_callBack
(
model
,
location
);
_callBack
(
model
,
location
,
_mapType
);
}
}
...
...
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