Commit 04611fd0 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 7fc9eee0
...@@ -51,20 +51,20 @@ ...@@ -51,20 +51,20 @@
- (void)setupUI{ - (void)setupUI{
///初始化地图 ///初始化地图
self.mapView = [[MKMapView alloc] initWithFrame:self.view.bounds]; // self.mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
self.mapView.mapType = 0; // self.mapView.mapType = 0;
// _mapView.showsWorldMap = @YES; //// _mapView.showsWorldMap = @YES;
// [self.mapView performSelector:@selector(setShowsWorldMap:) withObject:@(YES)]; //// [self.mapView performSelector:@selector(setShowsWorldMap:) withObject:@(YES)];
if ([ZJUserInfoManager CNLanguage]) { // if ([ZJUserInfoManager CNLanguage]) {
// self.mapView.mapLanguage = @0; // // self.mapView.mapLanguage = @0;
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(0)]; // // [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(0)];
}else{ // }else{
// self.mapView.mapLanguage = @1; // // self.mapView.mapLanguage = @1;
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)]; // // [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
} // }
_mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; // _mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
///把地图添加至view // ///把地图添加至view
[self.view addSubview: _mapView]; // [self.view addSubview: _mapView];
_mapView.delegate = self; _mapView.delegate = self;
// _mapView.zoomLevel = 14; // _mapView.zoomLevel = 14;
......
...@@ -123,6 +123,20 @@ ...@@ -123,6 +123,20 @@
}]; }];
} }
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated{
if(animated){
CAAnimation *shapeLayerAnimation = [self constructShapeLayerAnimation];
shapeLayerAnimation.delegate = self;
shapeLayerAnimation.removedOnCompletion = NO;
shapeLayerAnimation.fillMode = kCAFillModeForwards;
[self.shapeLayer addAnimation:shapeLayerAnimation forKey:@"shape"];
[self.mapView.layer addSublayer:self.shapeLayer];
}
}
- (void)setupUI { - (void)setupUI {
///初始化地图 ///初始化地图
...@@ -132,9 +146,11 @@ ...@@ -132,9 +146,11 @@
///把地图添加至view ///把地图添加至view
[self.view addSubview: _mapView]; [self.view addSubview: _mapView];
MKCircle * transparentCircle = [MKCircle circleWithCenterCoordinate:CLLocationCoordinate2DMake(39.905, 116.398) radius:100000000];
[self.mapView addOverlay:transparentCircle level:1];
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码 ///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
_mapView.showsUserLocation = false; _mapView.showsUserLocation = false;
_mapView.delegate = self; _mapView.delegate = self;
// _mapView.zoomLevel = 14; // _mapView.zoomLevel = 14;
_mapView.showsScale = false; _mapView.showsScale = false;
...@@ -244,10 +260,10 @@ ...@@ -244,10 +260,10 @@
// int count1 = sizeof(commonPolylineCoords) / sizeof(commonPolylineCoords[0]); // int count1 = sizeof(commonPolylineCoords) / sizeof(commonPolylineCoords[0]);
[self.track setCoordinate:commonPolylineCoords[0]]; [self.track setCoordinate:commonPolylineCoords[0]];
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self.track addMoveAnimationWithKeyCoordinates:commonPolylineCoords count:count withDuration:self.sumDistance / speed_car1 withName:nil completeCallback:^(BOOL isFinished) { // [self.track addMoveAnimationWithKeyCoordinates:commonPolylineCoords count:count withDuration:self.sumDistance / speed_car1 withName:nil completeCallback:^(BOOL isFinished) {
[weakSelf.trackTimeView.trackButton setEnabled:true]; // [weakSelf.trackTimeView.trackButton setEnabled:true];
[weakSelf.trackTimeView.trackButton setSelected:false]; // [weakSelf.trackTimeView.trackButton setSelected:false];
}]; // }];
MKMapRect rect = MKMapRectMake(self.commonPolyline.boundingMapRect.origin.x, self.commonPolyline.boundingMapRect.origin.y, self.commonPolyline.boundingMapRect.size.width, self.commonPolyline.boundingMapRect.size.height); MKMapRect rect = MKMapRectMake(self.commonPolyline.boundingMapRect.origin.x, self.commonPolyline.boundingMapRect.origin.y, self.commonPolyline.boundingMapRect.size.width, self.commonPolyline.boundingMapRect.size.height);
...@@ -255,11 +271,11 @@ ...@@ -255,11 +271,11 @@
// //
// CGPoint *points = [self pointsForCoordinates:commonPolylineCoords count:count]; CGPoint *points = [self pointsForCoordinates:commonPolylineCoords count:count];
// CGPathRef path = [self pathForPoints:points count:count]; CGPathRef path = [self pathForPoints:points count:count];
// [self initShapeLayerWithPath:path]; [self initShapeLayerWithPath:path];
// self.shapeLayer.frame = self.mapView.bounds; // self.shapeLayer.frame = self.mapView.bounds;
//
// CAAnimation *shapeLayerAnimation = [self constructShapeLayerAnimation]; // CAAnimation *shapeLayerAnimation = [self constructShapeLayerAnimation];
// shapeLayerAnimation.delegate = self; // shapeLayerAnimation.delegate = self;
// shapeLayerAnimation.removedOnCompletion = NO; // shapeLayerAnimation.removedOnCompletion = NO;
......
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