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
04611fd0
Commit
04611fd0
authored
Jul 05, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
7fc9eee0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
23 deletions
+39
-23
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+14
-14
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+25
-9
No files found.
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
04611fd0
...
@@ -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;
...
...
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
04611fd0
...
@@ -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;
...
...
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