Commit b657a210 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 3312d301
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#import "ZJBaseCareViewController.h" #import "ZJBaseCareViewController.h"
#import "ZJMemberPayViewController.h" #import "ZJMemberPayViewController.h"
#import "ZJLocationRemindSelectController.h"
@interface ZJBaseCareViewController() <CLLocationManagerDelegate>{ @interface ZJBaseCareViewController() <CLLocationManagerDelegate>{
ZJFriendSettingView * friend; ZJFriendSettingView * friend;
...@@ -302,20 +304,29 @@ ...@@ -302,20 +304,29 @@
//消息按钮点击 //消息按钮点击
- (void)xiaoXiButtonClick{ - (void)xiaoXiButtonClick{
NSLog(@"消息按钮"); NSLog(@"消息按钮");
if (![ZJUserInfoManager shared].isLogin) { // if (![ZJUserInfoManager shared].isLogin) {
// [MBProgressHUD showMessage:@"请先进行登录"]; //// [MBProgressHUD showMessage:@"请先进行登录"];
ZJOauthLoginConfig * config = [[ZJOauthLoginConfig alloc] initWithCurrentVC:self]; // ZJOauthLoginConfig * config = [[ZJOauthLoginConfig alloc] initWithCurrentVC:self];
[config loginVerify:^(id _Nonnull model) { // [config loginVerify:^(id _Nonnull model) {
if ([model isKindOfClass:[ZJMineUserInfoModel class]] ) { // if ([model isKindOfClass:[ZJMineUserInfoModel class]] ) {
NSLog(@"success"); // NSLog(@"success");
[self getHasNewMsg]; // [self getHasNewMsg];
[self getFriendList]; // [self getFriendList];
} // }
}]; // }];
return; // return;
} // }
ZJXiaoXiViewController *vc = [[ZJXiaoXiViewController alloc] init]; // ZJXiaoXiViewController *vc = [[ZJXiaoXiViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES]; // [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];
} }
//紧急按钮点击 //紧急按钮点击
......
...@@ -17,11 +17,14 @@ ...@@ -17,11 +17,14 @@
#import <CoreLocation/CoreLocation.h> #import <CoreLocation/CoreLocation.h>
#import "ZJUserInfoManager.h" #import "ZJUserInfoManager.h"
@interface ZJLocationRemindSelectController ()<MAMapViewDelegate, SJSliderDelegate, AMapSearchDelegate>{ #import <MapKit/MapKit.h>
#import "ZJCustomAnnotation.h"
@interface ZJLocationRemindSelectController ()<MAMapViewDelegate, SJSliderDelegate, AMapSearchDelegate, MKMapViewDelegate>{
BOOL sliderDrag; BOOL sliderDrag;
} }
@property (nonatomic, strong) MAMapView *mapView; @property (nonatomic, strong) MKMapView *mapView;
@property (weak, nonatomic) IBOutlet UIView *sliderContainerView; @property (weak, nonatomic) IBOutlet UIView *sliderContainerView;
@property (weak, nonatomic) IBOutlet UILabel *addressMainTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *addressMainTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressSubTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *addressSubTitleLabel;
...@@ -77,12 +80,12 @@ ...@@ -77,12 +80,12 @@
- (void)setupMapViewAndUI { - (void)setupMapViewAndUI {
///初始化地图 ///初始化地图
self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds]; self.mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
if ([ZJUserInfoManager CNLanguage]) { // if ([ZJUserInfoManager CNLanguage]) {
self.mapView.mapLanguage = @0; // self.mapView.mapLanguage = @0;
}else{ // }else{
self.mapView.mapLanguage = @1; // self.mapView.mapLanguage = @1;
} // }
_mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
///把地图添加至view ///把地图添加至view
[self.view addSubview: _mapView]; [self.view addSubview: _mapView];
...@@ -93,8 +96,8 @@ ...@@ -93,8 +96,8 @@
_mapView.showsScale = false; _mapView.showsScale = false;
_mapView.showsCompass = false; _mapView.showsCompass = false;
_mapView.zoomLevel = 15.5; // _mapView.zoomLevel = 15.5;
_mapView.customizeUserLocationAccuracyCircleRepresentation = true; // _mapView.customizeUserLocationAccuracyCircleRepresentation = true;
self.circle = [MACircle circleWithCenterCoordinate:self.mapView.centerCoordinate radius:500]; self.circle = [MACircle circleWithCenterCoordinate:self.mapView.centerCoordinate radius:500];
[self.mapView addOverlay:self.circle]; [self.mapView addOverlay:self.circle];
...@@ -119,7 +122,7 @@ ...@@ -119,7 +122,7 @@
[slider mas_makeConstraints:^(MASConstraintMaker *make) { [slider mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.sliderContainerView); 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) { if (_editModel) {
self.distanceTipLabel.text = [NSString stringWithFormat:@"%0dm", _editModel.radius]; self.distanceTipLabel.text = [NSString stringWithFormat:@"%0dm", _editModel.radius];
} }
...@@ -127,6 +130,30 @@ ...@@ -127,6 +130,30 @@
self.addressMainTitleLabel.text = _editModel.address; self.addressMainTitleLabel.text = _editModel.address;
self.addressSubTitleLabel.text = _editModel.addressName; 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 @@ ...@@ -193,7 +220,7 @@
ZJFriendLocationRemindModel *model = [[ZJFriendLocationRemindModel alloc] init]; ZJFriendLocationRemindModel *model = [[ZJFriendLocationRemindModel alloc] init];
model.address = self.addressMainTitleLabel.text; model.address = self.addressMainTitleLabel.text;
model.addressName = self.addressSubTitleLabel.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.lat = [self.location coordinate].latitude;
model.lon = [self.location coordinate].longitude; model.lon = [self.location coordinate].longitude;
model.remark = self.remarkString; model.remark = self.remarkString;
...@@ -311,23 +338,58 @@ ...@@ -311,23 +338,58 @@
self.distanceTipLabel.text = [NSString stringWithFormat:@"%0.fm", ss]; self.distanceTipLabel.text = [NSString stringWithFormat:@"%0.fm", ss];
} }
/// 设置的样式 ///// 设置的样式
- (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay //- (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay
{ //{
if([overlay isKindOfClass:[MACircle class]]) { // if([overlay isKindOfClass:[MACircle class]]) {
//
MACircleRenderer *circleRenderer = [[MACircleRenderer alloc] initWithCircle:(MACircle *)overlay]; // 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.lineWidth = 2.f;
circleRenderer.strokeColor= [UIColor colorWithHex:0x4299f9]; circleRenderer.strokeColor= [UIColor colorWithHex:0x4299f9];
circleRenderer.fillColor = [[UIColor colorWithHex:0x4299f9] colorWithAlphaComponent: 0.3]; circleRenderer.fillColor = [[UIColor colorWithHex:0x4299f9] colorWithAlphaComponent: 0.3];
return circleRenderer; return circleRenderer;
} }
return nil; 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 @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment