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
8901206b
Commit
8901206b
authored
Jul 04, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applemap
parent
684ba8e8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
237 additions
and
98 deletions
+237
-98
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+50
-44
ZJFriendTrackMapViewController.m
...i/Classes/Map/Controller/ZJFriendTrackMapViewController.m
+187
-54
No files found.
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
8901206b
...
...
@@ -7,10 +7,12 @@
//
#import "ZJBaseMapViewController.h"
#import <MapKit/MapKit.h>
@interface
ZJBaseMapViewController
()
<
MAMapViewDelegate
,
XMPopupListViewDelegate
>
@interface
ZJBaseMapViewController
()
<
MAMapViewDelegate
,
XMPopupListViewDelegate
,
MKMapViewDelegate
>
@property
(
nonatomic
,
strong
)
MAMapView
*
mapView
;
@property
(
nonatomic
,
strong
)
MKMapView
*
mapView
;
//@property (nonatomic, strong) MAMapView *mapView;
@property
(
nonatomic
,
strong
)
UIButton
*
gpsButton
;
@property
(
nonatomic
,
strong
)
ZJMapViewPersonCardView
*
cardView
;
...
...
@@ -40,41 +42,32 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
getFriendList
];
});
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
)];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
self
.
navigationController
setNavigationBarHidden
:
true
animated
:
true
];
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
)];
}
}
-
(
void
)
setupUI
{
///初始化地图
self
.
mapView
=
[[
M
A
MapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
self
.
mapView
=
[[
M
K
MapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
self
.
mapView
.
mapType
=
0
;
_mapView
.
showsWorldMap
=
@YES
;
[
self
.
mapView
performSelector
:
@selector
(
setShowsWorldMap
:)
withObject
:
@
(
YES
)];
// _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)];
}
_mapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
///把地图添加至view
[
self
.
view
addSubview
:
_mapView
];
_mapView
.
delegate
=
self
;
_mapView
.
zoomLevel
=
14
;
//
_mapView.zoomLevel = 14;
_mapView
.
showsScale
=
false
;
_mapView
.
showsCompass
=
false
;
...
...
@@ -126,29 +119,29 @@
};
}
-
(
void
)
mapView
:
(
UIView
*
)
mapView
regionDidChangeAnimated
:
(
BOOL
)
animated
{
// if(mapView.isHidden) {
// return;
// }
//- (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(self.isSwitching) {
// self.isSwitching = NO;
// return;
// if([mapView isKindOfClass:[MAMapView class]]) {
// if(!AMapDataAvailableForCoordinate(self.mapView.centerCoordinate)) {
//
// }
// } else {
// if(AMapDataAvailableForCoordinate(self.mapView.centerCoordinate)) {
//
// }
// }
// [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
{
...
...
@@ -251,7 +244,7 @@
MAPointAnnotation
*
pointAnnotation
=
[[
MAPointAnnotation
alloc
]
init
];
pointAnnotation
.
coordinate
=
CLLocationCoordinate2DMake
(
lat
,
lon
);
pointAnnotation
.
title
=
@"latestLocation"
;
[
_self
.
mapView
addAnnotation
:
pointAnnotation
];
[
_self
.
mapView
addAnnotation
:
(
id
<
MKAnnotation
>
)
pointAnnotation
];
[
_self
.
mapView
setCenterCoordinate
:
pointAnnotation
.
coordinate
animated
:
false
];
}
else
{
...
...
@@ -279,6 +272,19 @@
annotationView
.
enabled
=
NO
;
return
annotationView
;
}
else
if
([
annotation
isKindOfClass
:[
MKUserLocation
class
]]){
NSString
*
pointReuseIndetifier
=
@"pointReuseIndetifier3"
;
MKAnnotationView
*
annotationView
=
(
MKAnnotationView
*
)[
mapView
dequeueReusableAnnotationViewWithIdentifier
:
pointReuseIndetifier
];
if
(
annotationView
==
nil
)
{
annotationView
=
[[
MKAnnotationView
alloc
]
initWithAnnotation
:(
id
<
MKAnnotation
>
)
annotation
reuseIdentifier
:
pointReuseIndetifier
];
annotationView
.
canShowCallout
=
YES
;
}
annotationView
.
image
=
[
UIImage
imageNamed
:
@"userPosition"
];
annotationView
.
enabled
=
NO
;
return
(
MAAnnotationView
*
)
annotationView
;
}
return
nil
;
}
...
...
ZhiJi/Classes/Map/Controller/ZJFriendTrackMapViewController.m
View file @
8901206b
This diff is collapsed.
Click to expand it.
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