Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
b192caa5
Commit
b192caa5
authored
Aug 13, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复返回当前定位bug
parent
451c4336
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
...wController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
+9
-10
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
b192caa5
No preview for this file type
GeliBusinessPlatform/ViewController/货拉拉/收发货地址/ToAndFormSelectViewController.swift
View file @
b192caa5
...
...
@@ -30,10 +30,11 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var
detailAdrStr
=
""
@objc
func
backToCurrentLoc
(
_
sender
:
Any
)
{
print
(
"返回当前位置"
)
cityName
=
tempCityName
as
NSString
lat
=
tempLat
lng
=
tempLng
print
(
"返回当前位置"
,
lat
,
lng
)
mapView
.
centerCoordinate
=
CLLocationCoordinate2D
(
latitude
:
lat
,
longitude
:
lng
)
searchList
.
isHidden
=
true
closeBtn
.
isHidden
=
true
...
...
@@ -277,12 +278,12 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
AMapServices
.
shared
()
.
apiKey
=
"ca417b43e3d031db9c29382cc09a174a"
if
lat
==
0
&&
lng
==
0
{
manger
.
delegate
=
self
manger
.
requestAlwaysAuthorization
()
manger
.
requestWhenInUseAuthorization
()
manger
.
startUpdatingLocation
()
}
initMapView
()
initSearch
()
...
...
@@ -314,17 +315,15 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
func
locationManager
(
_
manager
:
CLLocationManager
,
didUpdateLocations
locations
:
[
CLLocation
])
{
manger
.
stopUpdatingLocation
()
let
location
=
locations
.
last
if
lat
==
0
&&
lng
==
0
{
lat
=
location
?
.
coordinate
.
latitude
as!
CLLocationDegrees
lng
=
location
?
.
coordinate
.
longitude
as!
CLLocationDegrees
tempLat
=
lat
tempLng
=
lng
mapView
.
centerCoordinate
=
CLLocationCoordinate2DMake
((
lat
),(
lng
))
}
tempLat
=
location
?
.
coordinate
.
latitude
as!
CLLocationDegrees
tempLng
=
location
?
.
coordinate
.
longitude
as!
CLLocationDegrees
}
func
setMapCenter
(
lat
:
CLLocationDegrees
,
lng
:
CLLocationDegrees
)
{
mapView
.
setCenter
(
CLLocationCoordinate2D
(
latitude
:
lat
,
longitude
:
lng
),
animated
:
false
)
}
...
...
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