Commit 451c4336 authored by lujunye's avatar lujunye

修复右上角城市定位bug

parent e6aa950b
...@@ -361,7 +361,13 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -361,7 +361,13 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let cell = hListView.cellForRow(at: IndexPath(row: 0, section: 0)) as! HLLTopCell let cell = hListView.cellForRow(at: IndexPath(row: 0, section: 0)) as! HLLTopCell
cell.scrollView?.setContentOffset(CGPoint(x: selectCarType * Int(CGFloat(cell.scViewBg.bounds.size.width)), y: 0), animated: true) cell.scrollView?.setContentOffset(CGPoint(x: selectCarType * Int(CGFloat(cell.scViewBg.bounds.size.width)), y: 0), animated: true)
cell.idx = selectCarType cell.idx = selectCarType
locBtn.setTitle(" " + adrModel.name!, for: .normal) var city_name = ""
for item in adrDatas {
if item.city_id == city_id {
city_name = item.name!
}
}
locBtn.setTitle(" " + city_name, for:.normal)
extractedFunc() extractedFunc()
} }
} }
......
...@@ -214,7 +214,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -214,7 +214,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
citySelectBtn.setTitle(model.city!, for: .normal) citySelectBtn.setTitle(model.city!, for: .normal)
let locData = JZLocationConverter.wgs84(toGcj02: CLLocationCoordinate2D(latitude: (model.location?.lat)!, longitude: (model.location?.lon)!)) let locData = JZLocationConverter.wgs84(toGcj02: CLLocationCoordinate2D(latitude: (model.location?.lat)!, longitude: (model.location?.lon)!))
isMove = false isMove = false
print("fuli2 === ",locData.latitude,locData.longitude)
adrName = model.name! adrName = model.name!
detailAdr = model.address! detailAdr = model.address!
mapView.setCenter(CLLocationCoordinate2DMake(locData.latitude,locData.longitude), animated: false) mapView.setCenter(CLLocationCoordinate2DMake(locData.latitude,locData.longitude), animated: false)
...@@ -252,12 +252,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -252,12 +252,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
let searchBr = SearchBarView.init() let searchBr = SearchBarView.init()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// let data1 = JZLocationConverter.wgs84(toGcj02: CLLocationCoordinate2D(latitude: 23.139385038284008, longitude: 113.24607265183259))
// let data2 = JZLocationConverter.gcj02(toWgs84: data1)
// print("2222 === ",data2.latitude,data2.longitude)
navBgView.addSubview(searchBr) navBgView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in searchBr.snp.makeConstraints { (make) in
make.left.equalTo(citySelectBtn.snp_right).offset(5) make.left.equalTo(citySelectBtn.snp_right).offset(5)
...@@ -388,7 +383,6 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -388,7 +383,6 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
"name":model.name, "name":model.name,
"city_id":model.city_id "city_id":model.city_id
] as [String : Any] ] as [String : Any]
print()
adrDataModel = cityListDataModel(JSON: d) adrDataModel = cityListDataModel(JSON: d)
} }
...@@ -554,7 +548,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -554,7 +548,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
adrDataModel = cityListDataModel(JSON: d) adrDataModel = cityListDataModel(JSON: d)
} }
isHistory = false isHistory = false
print("fuli1 === ",adrDataModel?.lat_lon!.lat,adrDataModel?.lat_lon!.lon)
let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11), let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11),
NSAttributedString.Key.paragraphStyle: paraph] NSAttributedString.Key.paragraphStyle: paraph]
contentLbl!.attributedText = NSAttributedString(string: str, attributes: attributes) contentLbl!.attributedText = NSAttributedString(string: str, attributes: attributes)
......
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