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
a973179a
Commit
a973179a
authored
Jul 24, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ab66a73f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
33 deletions
+55
-33
ZhiJi.xcscheme
ZhiJi.xcodeproj/xcshareddata/xcschemes/ZhiJi.xcscheme
+1
-1
ZJBaseMapViewController.m
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
+54
-32
No files found.
ZhiJi.xcodeproj/xcshareddata/xcschemes/ZhiJi.xcscheme
View file @
a973179a
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
ignoresPersistentStateOnLaunch =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
debugServiceExtension =
"internal"
allowLocationSimulation =
"
YES
"
>
allowLocationSimulation =
"
NO
"
>
<BuildableProductRunnable
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
runnableDebuggingMode =
"0"
>
<BuildableReference
<BuildableReference
...
...
ZhiJi/Classes/Map/Controller/ZJBaseMapViewController.m
View file @
a973179a
...
@@ -33,19 +33,7 @@
...
@@ -33,19 +33,7 @@
@property
(
nonatomic
,
strong
)
GMSCircle
*
selfCircle
;
@property
(
nonatomic
,
strong
)
GMSCircle
*
selfCircle
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
selfMarker
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
selfMarker
;
@property
(
nonatomic
,
assign
)
float
__block
zoom
;
@property
(
nonatomic
,
assign
)
float
__block
zoom
;
@property
(
nonatomic
,
assign
)
float
__block
animationZoom
;
@property
(
nonatomic
,
assign
)
BOOL
referCamera
;
@property
(
nonatomic
,
assign
)
NSTimer
*
ttt
;
@property
(
nonatomic
,
assign
)
NSInteger
tttCount
;
@property
(
nonatomic
,
strong
)
GMSPolyline
*
initialPolyline
;
@property
(
nonatomic
,
strong
)
GMSPolyline
*
actionPolyline
;
@property
(
nonatomic
,
strong
)
GMSMutablePath
*
initiallinepath
;
@property
(
nonatomic
,
strong
)
GMSMutablePath
*
actionlinepath
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
startMarker
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
endMarker
;
@property
(
nonatomic
,
strong
)
GMSMarker
*
actionMarker
;
@end
@end
...
@@ -66,6 +54,15 @@
...
@@ -66,6 +54,15 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
getFriendList
];
[
self
getFriendList
];
});
});
[[
ZJLocationManager
shared
]
initWithLocationUpdateInfo
:
^
(
ZJLocationModel
*
model
,
CLLocation
*
location
,
ZJMapType
mapType
)
{
if
(
!
model
){
return
;
}
self
.
mapType
=
mapType
;
}];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
@@ -78,6 +75,13 @@
...
@@ -78,6 +75,13 @@
if
(
_mapType
==
ZJ_GMSMapType
)
{
if
(
_mapType
==
ZJ_GMSMapType
)
{
_GGMapView
.
hidden
=
NO
;
_GGMapView
.
hidden
=
NO
;
_GDMapView
.
hidden
=
YES
;
_GDMapView
.
hidden
=
YES
;
if
(
_referCamera
)
{
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:[[[
self
.
data
Read
]
objectForKey
:
@"latitude"
]
doubleValue
]
longitude
:[[[
self
.
data
Read
]
objectForKey
:
@"longitude"
]
doubleValue
]
zoom
:
_zoom
];
self
.
GGMapView
.
camera
=
camera
;
_referCamera
=
NO
;
}
}
else
{
}
else
{
_GGMapView
.
hidden
=
YES
;
_GGMapView
.
hidden
=
YES
;
_GDMapView
.
hidden
=
NO
;
_GDMapView
.
hidden
=
NO
;
...
@@ -87,6 +91,9 @@
...
@@ -87,6 +91,9 @@
-
(
void
)
setupUI
{
-
(
void
)
setupUI
{
_zoom
=
18
;
_zoom
=
18
;
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:[[[
self
.
data
Read
]
objectForKey
:
@"latitude"
]
doubleValue
]
longitude
:[[[
self
.
data
Read
]
objectForKey
:
@"longitude"
]
doubleValue
]
zoom
:
_zoom
];
GMSCameraPosition
*
camera
=
[
GMSCameraPosition
cameraWithLatitude
:[[[
self
.
data
Read
]
objectForKey
:
@"latitude"
]
doubleValue
]
longitude
:[[[
self
.
data
Read
]
objectForKey
:
@"longitude"
]
doubleValue
]
zoom
:
_zoom
];
if
(
!
[[
self
.
data
Read
]
objectForKey
:
@"latitude"
])
{
_referCamera
=
YES
;
}
///初始化地图
///初始化地图
self
.
GGMapView
=
[
GMSMapView
mapWithFrame
:
self
.
view
.
bounds
camera
:
camera
];
self
.
GGMapView
=
[
GMSMapView
mapWithFrame
:
self
.
view
.
bounds
camera
:
camera
];
_GGMapView
.
delegate
=
self
;
_GGMapView
.
delegate
=
self
;
...
@@ -95,6 +102,8 @@
...
@@ -95,6 +102,8 @@
_GGMapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
_GGMapView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
_GGMapView
.
hidden
=
YES
;
_GGMapView
.
hidden
=
YES
;
[
self
setPoint
:
camera
.
target
target
:
1
];
self
.
GDMapView
=
[[
MAMapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
self
.
GDMapView
=
[[
MAMapView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
_GDMapView
.
delegate
=
self
;
_GDMapView
.
delegate
=
self
;
...
@@ -224,7 +233,7 @@
...
@@ -224,7 +233,7 @@
if
(
self
.
mapType
==
ZJ_GMSMapType
){
if
(
self
.
mapType
==
ZJ_GMSMapType
){
CLLocationCoordinate2D
coord
=
CLLocationCoordinate2DMake
([[[
self
.
data
Read
]
objectForKey
:
@"latitude"
]
doubleValue
],
[[[
self
.
data
Read
]
objectForKey
:
@"longitude"
]
doubleValue
]);
CLLocationCoordinate2D
coord
=
CLLocationCoordinate2DMake
([[[
self
.
data
Read
]
objectForKey
:
@"latitude"
]
doubleValue
],
[[[
self
.
data
Read
]
objectForKey
:
@"longitude"
]
doubleValue
]);
[
self
setPoint
:
coord
target
:
1
];
[
self
setPoint
:
coord
target
:
2
];
}
else
{
}
else
{
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
self
.
GDMapView
.
showsUserLocation
=
YES
;
self
.
GDMapView
.
showsUserLocation
=
YES
;
...
@@ -274,11 +283,19 @@
...
@@ -274,11 +283,19 @@
double
lat
=
[
response
[
@"result"
][
@"data"
][
@"lat"
]
doubleValue
];
double
lat
=
[
response
[
@"result"
][
@"data"
][
@"lat"
]
doubleValue
];
double
lon
=
[
response
[
@"result"
][
@"data"
][
@"lon"
]
doubleValue
];
double
lon
=
[
response
[
@"result"
][
@"data"
][
@"lon"
]
doubleValue
];
MAPointAnnotation
*
pointAnnotation
=
[[
MAPointAnnotation
alloc
]
init
];
pointAnnotation
.
coordinate
=
CLLocationCoordinate2DMake
(
lat
,
lon
);
if
(
self
.
mapType
==
ZJ_GMSMapType
){
pointAnnotation
.
title
=
@"latestLocation"
;
CLLocationCoordinate2D
coord
=
CLLocationCoordinate2DMake
(
lat
,
lon
);
[
self
.
GDMapView
addAnnotation
:
pointAnnotation
];
self
.
GGMapView
.
camera
=
[
GMSCameraPosition
cameraWithTarget
:
coord
zoom
:
self
.
zoom
];
[
self
.
GDMapView
setCenterCoordinate
:
pointAnnotation
.
coordinate
animated
:
false
];
[
self
setPoint
:
coord
target
:
1
];
[
_self
.
GGMapView
animateToLocation
:
coord
];
}
else
{
MAPointAnnotation
*
pointAnnotation
=
[[
MAPointAnnotation
alloc
]
init
];
pointAnnotation
.
coordinate
=
CLLocationCoordinate2DMake
(
lat
,
lon
);
pointAnnotation
.
title
=
@"latestLocation"
;
[
_self
.
GDMapView
addAnnotation
:
pointAnnotation
];
[
_self
.
GDMapView
setCenterCoordinate
:
pointAnnotation
.
coordinate
animated
:
false
];
}
}
else
if
([[
response
objectForKey
:
@"status"
]
integerValue
]
==
105
)
{
}
else
if
([[
response
objectForKey
:
@"status"
]
integerValue
]
==
105
)
{
[
MBProgressHUD
showError
:[
response
objectForKey
:
@"msg"
]
toView
:
self
.
view
];
[
MBProgressHUD
showError
:[
response
objectForKey
:
@"msg"
]
toView
:
self
.
view
];
...
@@ -309,19 +326,22 @@
...
@@ -309,19 +326,22 @@
#pragma mark - GMSMap Function google
#pragma mark - GMSMap Function google
-
(
void
)
setPoint
:
(
CLLocationCoordinate2D
)
point
target
:
(
NSInteger
)
target
{
-
(
void
)
setPoint
:
(
CLLocationCoordinate2D
)
point
target
:
(
NSInteger
)
target
{
if
(
target
==
1
)
{
CLLocationCoordinate2D
position
=
point
;
CLLocationCoordinate2D
position
=
point
;
_selfMarker
.
map
=
nil
;
_selfMarker
.
map
=
nil
;
_selfMarker
=
[
GMSMarker
markerWithPosition
:
position
];
_selfMarker
=
[
GMSMarker
markerWithPosition
:
position
];
// _selfMarker.appearAnimation = kGMSMarkerAnimationPop;
// _selfMarker.appearAnimation = kGMSMarkerAnimationPop;
// _selfMarker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]];
// _selfMarker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]];
_selfMarker
.
icon
=
[
UIImage
imageNamed
:
@"userPosition"
];
_selfMarker
.
icon
=
[
UIImage
imageNamed
:
@"userPosition"
];
_selfMarker
.
tracksInfoWindowChanges
=
YES
;
_selfMarker
.
tracksInfoWindowChanges
=
YES
;
_selfMarker
.
infoWindowAnchor
=
CGPointMake
(
0
.
5
,
0
.
25
);
_selfMarker
.
map
=
_GGMapView
;
if
(
target
==
1
)
{
_selfMarker
.
title
=
@"Me"
;
_selfMarker
.
title
=
@"Me"
;
_selfMarker
.
snippet
=
@"WTF"
;
_selfMarker
.
snippet
=
@"WTF"
;
_selfMarker
.
infoWindowAnchor
=
CGPointMake
(
0
.
5
,
0
.
25
);
_selfMarker
.
map
=
_GGMapView
;
CLLocationDistance
distance
=
50
;
CLLocationDistance
distance
=
50
;
_selfCircle
.
map
=
nil
;
_selfCircle
.
map
=
nil
;
_selfCircle
=
[
GMSCircle
circleWithPosition
:
position
radius
:
distance
];
_selfCircle
=
[
GMSCircle
circleWithPosition
:
position
radius
:
distance
];
...
@@ -331,12 +351,14 @@
...
@@ -331,12 +351,14 @@
_selfCircle
.
map
=
_GGMapView
;
_selfCircle
.
map
=
_GGMapView
;
}
else
{
}
else
{
CLLocationCoordinate2D
position
=
point
;
_selfMarker
.
title
=
@"Friend"
;
GMSMarker
*
marker
=
[
GMSMarker
markerWithPosition
:
position
];
_selfMarker
.
snippet
=
@"WTF"
;
marker
.
title
=
@"Hello World"
;
marker
.
map
=
_GGMapView
;
}
}
}
}
#pragma mark - GMSMap Delegate google
-
(
void
)
mapView
:
(
GMSMapView
*
)
mapView
idleAtCameraPosition
:
(
GMSCameraPosition
*
)
position
{
_zoom
=
position
.
zoom
;
}
@end
@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