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
b657a210
Commit
b657a210
authored
Jul 28, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
3312d301
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
36 deletions
+109
-36
ZJBaseCareViewController.m
ZhiJi/Classes/Care/Controller/ZJBaseCareViewController.m
+25
-14
ZJLocationRemindSelectController.m
...sses/LocationAttention/ZJLocationRemindSelectController.m
+84
-22
No files found.
ZhiJi/Classes/Care/Controller/ZJBaseCareViewController.m
View file @
b657a210
...
...
@@ -9,6 +9,8 @@
#import "ZJBaseCareViewController.h"
#import "ZJMemberPayViewController.h"
#import "ZJLocationRemindSelectController.h"
@interface
ZJBaseCareViewController
()
<
CLLocationManagerDelegate
>
{
ZJFriendSettingView
*
friend
;
...
...
@@ -302,20 +304,29 @@
//消息按钮点击
-
(
void
)
xiaoXiButtonClick
{
NSLog
(
@"消息按钮"
);
if
(
!
[
ZJUserInfoManager
shared
].
isLogin
)
{
// [MBProgressHUD showMessage:@"请先进行登录"];
ZJOauthLoginConfig
*
config
=
[[
ZJOauthLoginConfig
alloc
]
initWithCurrentVC
:
self
];
[
config
loginVerify
:
^
(
id
_Nonnull
model
)
{
if
([
model
isKindOfClass
:[
ZJMineUserInfoModel
class
]]
)
{
NSLog
(
@"success"
);
[
self
getHasNewMsg
];
[
self
getFriendList
];
}
}];
return
;
}
ZJXiaoXiViewController
*
vc
=
[[
ZJXiaoXiViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
YES
];
// if (![ZJUserInfoManager shared].isLogin) {
//// [MBProgressHUD showMessage:@"请先进行登录"];
// ZJOauthLoginConfig * config = [[ZJOauthLoginConfig alloc] initWithCurrentVC:self];
// [config loginVerify:^(id _Nonnull model) {
// if ([model isKindOfClass:[ZJMineUserInfoModel class]] ) {
// NSLog(@"success");
// [self getHasNewMsg];
// [self getFriendList];
// }
// }];
// return;
// }
// ZJXiaoXiViewController *vc = [[ZJXiaoXiViewController alloc] init];
// [self.navigationController pushViewController:vc animated:YES];
ZJLocationRemindSelectController
*
location
=
[[
UIStoryboard
storyboardWithName
:
@"Location"
bundle
:
nil
]
instantiateViewControllerWithIdentifier
:
@"ZJLocationRemindSelectController"
];
location
.
title
=
@"选择地点"
;
location
.
commitAddressClosure
=
^
(
ZJFriendLocationRemindModel
*
_Nonnull
model
)
{
};
[
self
.
navigationController
pushViewController
:
location
animated
:
YES
];
}
//紧急按钮点击
...
...
ZhiJi/Classes/LocationAttention/ZJLocationRemindSelectController.m
View file @
b657a210
...
...
@@ -17,11 +17,14 @@
#import <CoreLocation/CoreLocation.h>
#import "ZJUserInfoManager.h"
@interface
ZJLocationRemindSelectController
()
<
MAMapViewDelegate
,
SJSliderDelegate
,
AMapSearchDelegate
>
{
#import <MapKit/MapKit.h>
#import "ZJCustomAnnotation.h"
@interface
ZJLocationRemindSelectController
()
<
MAMapViewDelegate
,
SJSliderDelegate
,
AMapSearchDelegate
,
MKMapViewDelegate
>
{
BOOL
sliderDrag
;
}
@property
(
nonatomic
,
strong
)
M
A
MapView
*
mapView
;
@property
(
nonatomic
,
strong
)
M
K
MapView
*
mapView
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
sliderContainerView
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
addressMainTitleLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
addressSubTitleLabel
;
...
...
@@ -77,12 +80,12 @@
-
(
void
)
setupMapViewAndUI
{
///初始化地图
self
.
mapView
=
[[
M
A
MapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
if
([
ZJUserInfoManager
CNLanguage
])
{
self
.
mapView
.
mapLanguage
=
@0
;
}
else
{
self
.
mapView
.
mapLanguage
=
@1
;
}
self
.
mapView
=
[[
M
K
MapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
//
if ([ZJUserInfoManager CNLanguage]) {
//
self.mapView.mapLanguage = @0;
//
}else{
//
self.mapView.mapLanguage = @1;
//
}
_mapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
///把地图添加至view
[
self
.
view
addSubview
:
_mapView
];
...
...
@@ -93,8 +96,8 @@
_mapView
.
showsScale
=
false
;
_mapView
.
showsCompass
=
false
;
_mapView
.
zoomLevel
=
15
.
5
;
_mapView
.
customizeUserLocationAccuracyCircleRepresentation
=
true
;
//
_mapView.zoomLevel = 15.5;
//
_mapView.customizeUserLocationAccuracyCircleRepresentation = true;
self
.
circle
=
[
MACircle
circleWithCenterCoordinate
:
self
.
mapView
.
centerCoordinate
radius
:
500
];
[
self
.
mapView
addOverlay
:
self
.
circle
];
...
...
@@ -119,7 +122,7 @@
[
slider
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
sliderContainerView
);
}];
self
.
distanceTipLabel
.
text
=
[
NSString
stringWithFormat
:
@"%0.fm"
,
self
.
mapView
.
metersPerPointForCurrentZoom
*
20
+
200
.
0
];
//
self.distanceTipLabel.text = [NSString stringWithFormat:@"%0.fm", self.mapView.metersPerPointForCurrentZoom * 20 + 200.0];
if
(
_editModel
)
{
self
.
distanceTipLabel
.
text
=
[
NSString
stringWithFormat
:
@"%0dm"
,
_editModel
.
radius
];
}
...
...
@@ -127,6 +130,30 @@
self
.
addressMainTitleLabel
.
text
=
_editModel
.
address
;
self
.
addressSubTitleLabel
.
text
=
_editModel
.
addressName
;
// ZJCustomAnnotation *annotation = [[ZJCustomAnnotation alloc] init];
// annotation.coordinate = self.mapView.centerCoordinate;
// annotation.title = @"北京";
// annotation.subtitle = @"默认显示的为首都北京";
// [self.mapView addAnnotation:annotation];
}
-
(
void
)
mapView
:
(
MKMapView
*
)
mapView
regionWillChangeAnimated
:
(
BOOL
)
animated
{
[
mapView
removeAnnotations
:
self
.
mapView
.
annotations
];
ZJCustomAnnotation
*
annotation
=
[[
ZJCustomAnnotation
alloc
]
init
];
annotation
.
coordinate
=
self
.
mapView
.
centerCoordinate
;
annotation
.
title
=
@"北京"
;
annotation
.
subtitle
=
@"默认显示的为首都北京"
;
[
self
.
mapView
addAnnotation
:
annotation
];
}
-
(
void
)
mapView
:
(
MKMapView
*
)
mapView
regionDidChangeAnimated
:
(
BOOL
)
animated
{
ZJCustomAnnotation
*
annotation
=
[[
ZJCustomAnnotation
alloc
]
init
];
annotation
.
coordinate
=
self
.
mapView
.
centerCoordinate
;
annotation
.
title
=
@"北京"
;
annotation
.
subtitle
=
@"默认显示的为首都北京"
;
[
self
.
mapView
addAnnotation
:
annotation
];
}
//添加固定
...
...
@@ -193,7 +220,7 @@
ZJFriendLocationRemindModel
*
model
=
[[
ZJFriendLocationRemindModel
alloc
]
init
];
model
.
address
=
self
.
addressMainTitleLabel
.
text
;
model
.
addressName
=
self
.
addressSubTitleLabel
.
text
;
model
.
radius
=
self
.
mapView
.
metersPerPointForCurrentZoom
*
20
+
200
.
0
;
//
model.radius = self.mapView.metersPerPointForCurrentZoom * 20 + 200.0;
model
.
lat
=
[
self
.
location
coordinate
].
latitude
;
model
.
lon
=
[
self
.
location
coordinate
].
longitude
;
model
.
remark
=
self
.
remarkString
;
...
...
@@ -311,23 +338,58 @@
self
.
distanceTipLabel
.
text
=
[
NSString
stringWithFormat
:
@"%0.fm"
,
ss
];
}
/// 设置的样式
-
(
MAOverlayRenderer
*
)
mapView
:
(
MAMapView
*
)
mapView
rendererForOverlay
:
(
id
<
MAOverlay
>
)
overlay
{
if
([
overlay
isKindOfClass
:[
MACircle
class
]])
{
MACircleRenderer
*
circleRenderer
=
[[
MACircleRenderer
alloc
]
initWithCircle
:(
MACircle
*
)
overlay
];
///// 设置的样式
//- (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay
//{
// if([overlay isKindOfClass:[MACircle class]]) {
//
// MACircleRenderer *circleRenderer = [[MACircleRenderer alloc] initWithCircle:(MACircle *)overlay];
//
// circleRenderer.lineWidth = 2.f;
//
// circleRenderer.strokeColor= [UIColor colorWithHex:0x4299f9];
//
// circleRenderer.fillColor = [[UIColor colorWithHex:0x4299f9] colorWithAlphaComponent: 0.3];
//
// return circleRenderer;
// }
// return nil;
//}
-
(
MKOverlayRenderer
*
)
mapView
:
(
MKMapView
*
)
mapView
rendererForOverlay
:
(
id
<
MKOverlay
>
)
overlay
{
if
([
overlay
isKindOfClass
:[
MKPolyline
class
]]){
MKPolylineRenderer
*
circleRenderer
=
[[
MKPolylineRenderer
alloc
]
initWithOverlay
:
overlay
];
circleRenderer
.
lineWidth
=
2
.
f
;
circleRenderer
.
strokeColor
=
[
UIColor
colorWithHex
:
0x4299f9
];
circleRenderer
.
fillColor
=
[[
UIColor
colorWithHex
:
0x4299f9
]
colorWithAlphaComponent
:
0
.
3
];
return
circleRenderer
;
}
return
nil
;
}
//创建大头针时调用
-
(
MKAnnotationView
*
)
mapView
:
(
MKMapView
*
)
mapView
viewForAnnotation
:
(
id
<
MKAnnotation
>
)
annotation
{
//如果返回空,代表大头针样式交由系统去管理
if
([
annotation
isKindOfClass
:[
MKUserLocation
class
]])
{
return
nil
;
}
static
NSString
*
ID
=
@"annotation"
;
// MKAnnotationView 默认没有界面 可以显示图片
// MKPinAnnotationView有界面 默认不能显示图片
MKPinAnnotationView
*
annotationView
=
(
MKPinAnnotationView
*
)[
mapView
dequeueReusableAnnotationViewWithIdentifier
:
ID
];
if
(
annotationView
==
nil
)
{
annotationView
=
[[
MKPinAnnotationView
alloc
]
initWithAnnotation
:
annotation
reuseIdentifier
:
ID
];
//设置大头针颜色
annotationView
.
pinTintColor
=
[
UIColor
redColor
];
//设置为动画掉落的效果
// annotationView.animatesDrop = YES;
//显示详情
annotationView
.
canShowCallout
=
YES
;
}
return
annotationView
;
}
@end
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