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
dd17385f
Commit
dd17385f
authored
Jul 31, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
62d37206
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
526 additions
and
270 deletions
+526
-270
.DS_Store
.DS_Store
+0
-0
project.pbxproj
ZhiJi.xcodeproj/project.pbxproj
+6
-0
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+36
-64
ZJCustomAnnotation.h
ZhiJi/Classes/Map/Controller/ZJCustomAnnotation.h
+22
-0
ZJCustomAnnotation.m
ZhiJi/Classes/Map/Controller/ZJCustomAnnotation.m
+13
-0
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+373
-192
ZJMapPinchGestureRecognizer.h
ZhiJi/Classes/Map/Controller/ZJMapPinchGestureRecognizer.h
+20
-0
ZJMapPinchGestureRecognizer.m
ZhiJi/Classes/Map/Controller/ZJMapPinchGestureRecognizer.m
+48
-0
ZJUserTrackTimeView.m
ZhiJi/Classes/Map/View/ZJUserTrackTimeView.m
+8
-14
No files found.
.DS_Store
View file @
dd17385f
No preview for this file type
ZhiJi.xcodeproj/project.pbxproj
View file @
dd17385f
...
...
@@ -54,6 +54,7 @@
A948C4DA24977B3700C22D69
/* ZJFriendLocationRemindModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A948C4D924977B3700C22D69
/* ZJFriendLocationRemindModel.m */
;
};
A948C4DF249A27FE00C22D69
/* ZJOauthLoginConfig.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A948C4DE249A27FE00C22D69
/* ZJOauthLoginConfig.m */
;
};
A948C504249B887B00C22D69
/* ZJGoodsModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A948C503249B887B00C22D69
/* ZJGoodsModel.m */
;
};
A94EE53324D401EB0046038D
/* ZJCustomAnnotation.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A94EE53124D401EB0046038D
/* ZJCustomAnnotation.m */
;
};
A95590932490AE3C00F3BB41
/* QJGIFView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A955908D2490AE3C00F3BB41
/* QJGIFView.m */
;
};
A95590942490AE3C00F3BB41
/* MBProgressHUD+MJ.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A955908E2490AE3C00F3BB41
/* MBProgressHUD+MJ.m */
;
};
A95590952490AE3C00F3BB41
/* MBProgressHUD.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A95590902490AE3C00F3BB41
/* MBProgressHUD.bundle */
;
};
...
...
@@ -281,6 +282,8 @@
A948C4DE249A27FE00C22D69
/* ZJOauthLoginConfig.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZJOauthLoginConfig.m
;
sourceTree
=
"<group>"
;
};
A948C502249B887B00C22D69
/* ZJGoodsModel.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ZJGoodsModel.h
;
sourceTree
=
"<group>"
;
};
A948C503249B887B00C22D69
/* ZJGoodsModel.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZJGoodsModel.m
;
sourceTree
=
"<group>"
;
};
A94EE53124D401EB0046038D
/* ZJCustomAnnotation.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZJCustomAnnotation.m
;
sourceTree
=
"<group>"
;
};
A94EE53224D401EB0046038D
/* ZJCustomAnnotation.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ZJCustomAnnotation.h
;
sourceTree
=
"<group>"
;
};
A955908B2490AE3C00F3BB41
/* MBProgressHUD+MJ.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"MBProgressHUD+MJ.h"
;
sourceTree
=
"<group>"
;
};
A955908D2490AE3C00F3BB41
/* QJGIFView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QJGIFView.m
;
sourceTree
=
"<group>"
;
};
A955908E2490AE3C00F3BB41
/* MBProgressHUD+MJ.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"MBProgressHUD+MJ.m"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1081,6 +1084,8 @@
A9619E7F24AAE2A8009A2012
/* ZJMapStyle2ViewController.m */
,
64F52440248F34DB0032BCA2
/* ZJFriendTrackMapViewController.h */
,
64F52441248F34DB0032BCA2
/* ZJFriendTrackMapViewController.m */
,
A94EE53224D401EB0046038D
/* ZJCustomAnnotation.h */
,
A94EE53124D401EB0046038D
/* ZJCustomAnnotation.m */
,
);
path
=
Controller
;
sourceTree
=
"<group>"
;
...
...
@@ -1552,6 +1557,7 @@
A95F5C62248DDE81001DB97E
/* UILabel+HExtension.m in Sources */
,
A95F5C61248DDE81001DB97E
/* UIView+HExtension.m in Sources */
,
A948C4782493578A00C22D69
/* ZJFriendModel.m in Sources */
,
A94EE53324D401EB0046038D
/* ZJCustomAnnotation.m in Sources */
,
A9619E8224AAE2A8009A2012
/* ZJBaseMapViewController.m in Sources */
,
D5271ED324907E6100F8B107
/* ZJLocationAttentionFooter.swift in Sources */
,
A95F5C98248DDE81001DB97E
/* ZJPhoneLoginViewController.m in Sources */
,
...
...
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
dd17385f
...
...
@@ -7,11 +7,12 @@
//
#import "ZJBaseMapViewController.h"
#import <MapKit/MapKit.h>
#import "ZJCustomAnnotation.h"
@interface
ZJBaseMapViewController
()
<
MAMapViewDelegate
,
XMPopupList
ViewDelegate
>
@interface
ZJBaseMapViewController
()
<
XMPopupListViewDelegate
,
MKMap
ViewDelegate
>
@property
(
nonatomic
,
strong
)
MAMapView
*
mapView
;
@property
(
nonatomic
,
strong
)
UIButton
*
gpsButton
;
@property
(
nonatomic
,
strong
)
MKMapView
*
mapView
;
@property
(
nonatomic
,
strong
)
ZJMapViewPersonCardView
*
cardView
;
...
...
@@ -25,12 +26,10 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
setupUI
];
self
.
friendDataSource
=
[
NSMutableArray
array
];
[
self
setupUI
];
[
self
getFriendList
];
}
...
...
@@ -49,26 +48,15 @@
-
(
void
)
setupUI
{
///初始化地图
self
.
mapView
=
[[
MAMapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
_mapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
///把地图添加至view
[
self
.
view
addSubview
:
_mapView
];
self
.
mapView
.
mapType
=
0
;
_mapView
.
showsWorldMap
=
@YES
;
[
self
.
mapView
performSelector
:
@selector
(
setShowsWorldMap
:)
withObject
:
@
(
YES
)];
if
([
ZJUserInfoManager
CNLanguage
])
{
self
.
mapView
.
mapLanguage
=
@0
;
[
self
.
mapView
performSelector
:
NSSelectorFromString
(
@"setMapLanguage:"
)
withObject
:
@
(
0
)];
}
else
{
self
.
mapView
.
mapLanguage
=
@1
;
[
self
.
mapView
performSelector
:
NSSelectorFromString
(
@"setMapLanguage:"
)
withObject
:
@
(
1
)];
}
self
.
mapView
=
[[
MKMapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
_mapView
.
showsUserLocation
=
YES
;
_mapView
.
userTrackingMode
=
MKUserTrackingModeFollow
;
_mapView
.
delegate
=
self
;
_mapView
.
zoomLevel
=
14
;
_mapView
.
showsScale
=
false
;
_mapView
.
showsCompass
=
false
;
_mapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
///把地图添加至view
[
self
.
view
addSubview
:
_mapView
];
// 添加 card view
self
.
cardView
=
[[[
NSBundle
mainBundle
]
loadNibNamed
:
@"ZJMapViewPersonCardView"
owner
:
self
options
:
nil
]
lastObject
];
...
...
@@ -120,30 +108,6 @@
};
}
-
(
void
)
mapView
:
(
UIView
*
)
mapView
regionDidChangeAnimated
:
(
BOOL
)
animated
{
// if(mapView.isHidden) {
// return;
// }
//
// if(self.isSwitching) {
// self.isSwitching = NO;
// return;
// }
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(0)];
if
([
mapView
isKindOfClass
:[
MAMapView
class
]])
{
if
(
!
AMapDataAvailableForCoordinate
(
self
.
mapView
.
centerCoordinate
))
{
}
}
else
{
if
(
AMapDataAvailableForCoordinate
(
self
.
mapView
.
centerCoordinate
))
{
}
}
}
#pragma mark 好友列表
-
(
void
)
getFriendList
{
...
...
@@ -151,7 +115,7 @@
//未登录
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
_mapView
.
showsUserLocation
=
YES
;
_mapView
.
userTrackingMode
=
M
A
UserTrackingModeFollow
;
_mapView
.
userTrackingMode
=
M
K
UserTrackingModeFollow
;
return
;
}
[
self
.
friendDataSource
removeAllObjects
];
...
...
@@ -172,7 +136,7 @@
[
weakSelf
.
style2BgImV
setHidden
:
false
];
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
weakSelf
.
mapView
.
showsUserLocation
=
YES
;
weakSelf
.
mapView
.
userTrackingMode
=
M
A
UserTrackingModeFollow
;
weakSelf
.
mapView
.
userTrackingMode
=
M
K
UserTrackingModeFollow
;
}
else
{
[
weakSelf
.
cardView
setHidden
:
false
];
[
weakSelf
.
addCareButton
setHidden
:
true
];
...
...
@@ -198,7 +162,7 @@
}
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
weakSelf
.
mapView
.
showsUserLocation
=
YES
;
weakSelf
.
mapView
.
userTrackingMode
=
M
A
UserTrackingModeFollow
;
weakSelf
.
mapView
.
userTrackingMode
=
M
K
UserTrackingModeFollow
;
// [MBProgressHUD showError:[NSString stringWithFormat:@"获取好友列表失败\n%@", [response objectForKey:@"msg"]] toView:self.view];
}
...
...
@@ -206,13 +170,6 @@
// [MBProgressHUD showError:[NSString stringWithFormat:@"获取好友列表失败\n%@", error.description] toView:self.view];
}];
}
#pragma mark - Action Handlers
-
(
void
)
returnAction
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
/**
选中cell后回调
@param indexPath 返回选中的indexPath
...
...
@@ -249,13 +206,15 @@
double
lat
=
[
response
[
@"result"
][
@"data"
][
@"lat"
]
doubleValue
];
double
lon
=
[
response
[
@"result"
][
@"data"
][
@"lon"
]
doubleValue
];
MAPointAnnotation
*
pointAnnotation
=
[[
MAPointAnnotation
alloc
]
init
];
ZJCustomAnnotation
*
pointAnnotation
=
[[
ZJCustomAnnotation
alloc
]
init
];
pointAnnotation
.
coordinate
=
CLLocationCoordinate2DMake
(
lat
,
lon
);
pointAnnotation
.
title
=
@"latestLocation"
;
[
_self
.
mapView
addAnnotation
:
pointAnnotation
];
[
_self
.
mapView
setCenterCoordinate
:
pointAnnotation
.
coordinate
animated
:
false
];
}
else
if
([[
response
objectForKey
:
@"status"
]
integerValue
]
==
105
)
{
}
else
{
[
MBProgressHUD
showError
:[
response
objectForKey
:
@"msg"
]
toView
:
self
.
view
];
}
...
...
@@ -266,13 +225,26 @@
}
#pragma mark - Map Delegate
-
(
MAAnnotationView
*
)
mapView
:
(
MAMapView
*
)
mapView
viewForAnnotation
:
(
id
<
MAAnnotation
>
)
annotation
{
-
(
nullable
MKAnnotationView
*
)
mapView
:
(
MKMapView
*
)
mapView
viewForAnnotation
:
(
id
<
MKAnnotation
>
)
annotation
{
if
([
annotation
isKindOfClass
:[
ZJCustomAnnotation
class
]])
{
NSString
*
pointReuseIndetifier
=
@"pointReuseIndetifier3"
;
MKAnnotationView
*
annotationView
=
[
mapView
dequeueReusableAnnotationViewWithIdentifier
:
pointReuseIndetifier
];
if
(
annotationView
==
nil
)
{
annotationView
=
[[
MKAnnotationView
alloc
]
initWithAnnotation
:
annotation
reuseIdentifier
:
pointReuseIndetifier
];
annotationView
.
canShowCallout
=
YES
;
}
annotationView
.
image
=
[
UIImage
imageNamed
:
@"userPosition"
];
annotationView
.
enabled
=
NO
;
return
annotationView
;
}
else
if
([
annotation
isKindOfClass
:[
MKUserLocation
class
]]){
if
([
annotation
isKindOfClass
:[
MAPointAnnotation
class
]])
{
NSString
*
pointReuseIndetifier
=
@"pointReuseIndetifier3"
;
M
AAnnotationView
*
annotationView
=
(
MAAnnotationView
*
)
[
mapView
dequeueReusableAnnotationViewWithIdentifier
:
pointReuseIndetifier
];
M
KAnnotationView
*
annotationView
=
[
mapView
dequeueReusableAnnotationViewWithIdentifier
:
pointReuseIndetifier
];
if
(
annotationView
==
nil
)
{
annotationView
=
[[
M
AAnnotationView
alloc
]
initWithAnnotation
:
annotation
reuseIdentifier
:
pointReuseIndetifier
];
annotationView
=
[[
M
KAnnotationView
alloc
]
initWithAnnotation
:(
id
<
MKAnnotation
>
)
annotation
reuseIdentifier
:
pointReuseIndetifier
];
annotationView
.
canShowCallout
=
YES
;
}
...
...
ZhiJi/Classes/Map/Controller/ZJCustomAnnotation.h
0 → 100644
View file @
dd17385f
//
// ZJCustomAnnotation.h
// ZhiJi
//
// Created by 明津李 on 2020/7/27.
// Copyright © 2020 Company. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
ZJCustomAnnotation
:
NSObject
<
MKAnnotation
>
@property
(
nonatomic
)
CLLocationCoordinate2D
coordinate
;
@property
(
nonatomic
,
copy
)
NSString
*
title
;
@property
(
nonatomic
,
copy
)
NSString
*
subtitle
;
@end
NS_ASSUME_NONNULL_END
ZhiJi/Classes/Map/Controller/ZJCustomAnnotation.m
0 → 100644
View file @
dd17385f
//
// ZJCustomAnnotation.m
// ZhiJi
//
// Created by 明津李 on 2020/7/27.
// Copyright © 2020 Company. All rights reserved.
//
#import "ZJCustomAnnotation.h"
@implementation
ZJCustomAnnotation
@end
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
dd17385f
This diff is collapsed.
Click to expand it.
ZhiJi/Classes/Map/Controller/ZJMapPinchGestureRecognizer.h
0 → 100644
View file @
dd17385f
//
// ZJMapPinchGestureRecognizer.h
// ZhiJi
//
// Created by 明津李 on 2020/7/28.
// Copyright © 2020 Company. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
ZJMapPinchGestureRecognizer
:
UIPinchGestureRecognizer
-
(
id
)
initWithMapView
:(
MKMapView
*
)
mapView
;
@end
NS_ASSUME_NONNULL_END
ZhiJi/Classes/Map/Controller/ZJMapPinchGestureRecognizer.m
0 → 100644
View file @
dd17385f
//
// ZJMapPinchGestureRecognizer.m
// ZhiJi
//
// Created by 明津李 on 2020/7/28.
// Copyright © 2020 Company. All rights reserved.
//
#import "ZJMapPinchGestureRecognizer.h"
@interface
ZJMapPinchGestureRecognizer
()
-
(
void
)
handlePinchGesture
;
@property
(
nonatomic
,
assign
)
MKMapView
*
mapView
;
@end
@implementation
ZJMapPinchGestureRecognizer
-
(
id
)
initWithMapView
:(
MKMapView
*
)
mapView
{
if
(
mapView
==
nil
)
{
[
NSException
raise
:
NSInvalidArgumentException
format
:
@"mapView cannot be nil."
];
}
if
((
self
=
[
super
initWithTarget
:
self
action
:
@selector
(
handlePinchGesture
)]))
{
self
.
mapView
=
mapView
;
}
return
self
;
}
-
(
BOOL
)
canBePreventedByGestureRecognizer
:(
UIGestureRecognizer
*
)
gestureRecognizer
{
return
NO
;
}
-
(
BOOL
)
canPreventGestureRecognizer
:(
UIGestureRecognizer
*
)
gestureRecognizer
{
return
NO
;
}
-
(
void
)
handlePinchGesture
{
CLLocation
*
location
=
self
.
mapView
.
userLocation
.
location
;
if
(
location
!=
nil
)
{
[
self
.
mapView
setCenterCoordinate
:
location
.
coordinate
];
}
}
@end
ZhiJi/Classes/Map/View/ZJUserTrackTimeView.m
View file @
dd17385f
...
...
@@ -38,12 +38,6 @@
}
-
(
IBAction
)
drawTrackAction
:
(
UIButton
*
)
sender
{
if
([
self
.
stratDate
compare
:
self
.
endDate
]
==
NSOrderedDescending
)
{
[
MBProgressHUD
showError
:
kLocalizedString
(
@"track_start_time_less_end"
)];
return
;
}
if
(
_drawTrackHandle
)
{
_drawTrackHandle
();
}
...
...
@@ -57,10 +51,10 @@
__weak
typeof
(
self
)
weakSelf
=
self
;
datePciker
.
commitTrackDateClosre
=
^
(
NSDate
*
date
)
{
NSLog
(
@"%@"
,
date
);
//
if ([date compare:weakSelf.endDate] == NSOrderedDescending) {
//
[MBProgressHUD showError:kLocalizedString(@"track_start_time_less_end")];
//
return;
//
}
if
([
date
compare
:
weakSelf
.
endDate
]
==
NSOrderedDescending
)
{
[
MBProgressHUD
showError
:
kLocalizedString
(
@"track_start_time_less_end"
)];
return
;
}
[
weakSelf
.
beginTimeButton
setTitle
:
[
weakSelf
getDateStringFromDate
:
date
]
forState
:
UIControlStateNormal
];
weakSelf
.
stratDate
=
date
;
if
(
weakSelf
.
dateSelectFinishedHandle
)
{
...
...
@@ -79,10 +73,10 @@
datePciker
.
commitTrackDateClosre
=
^
(
NSDate
*
date
)
{
NSLog
(
@"endTime %@"
,
date
);
//
if ([date compare:weakSelf.stratDate] == NSOrderedAscending) {
//
[MBProgressHUD showError:kLocalizedString(@"track_end_time_great_start")];
//
return;
//
}
if
([
date
compare
:
weakSelf
.
stratDate
]
==
NSOrderedAscending
)
{
[
MBProgressHUD
showError
:
kLocalizedString
(
@"track_end_time_great_start"
)];
return
;
}
weakSelf
.
endDate
=
date
;
[
weakSelf
.
endTimeButton
setTitle
:
[
weakSelf
getDateStringFromDate
:
date
]
forState
:
UIControlStateNormal
];
...
...
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