Commit b636f122 authored by lujunye's avatar lujunye

地图移动中不显示,

parent 0c061e02
......@@ -719,11 +719,9 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
lineV.frame.origin.x = fullScreenWidth * 0.5
hllView.isHidden = false
locBtn.isUserInteractionEnabled = true
if fullScreenHeight > 736 {
hBtnViewH.constant = 83
}else{
hBtnViewH.constant = 49
}
hBtnViewH.constant = CGFloat(TabHeight)
if isAlready {
......@@ -2115,10 +2113,12 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
//将delegate设置成自己
pickerView.delegate=self
view.addSubview(pickerView)
pickerView.snp.makeConstraints { (make) in
make.top.equalTo(line.snp.bottom)
make.left.right.equalTo(0)
make.bottom.equalTo(-49)
make.bottom.equalTo(-TabHeight)
}
pickerView.selectRow(dayIdx, inComponent: 0, animated: false)
pickerView(pickerView, didSelectRow: dayIdx, inComponent: 0)
......@@ -2129,15 +2129,25 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let btmBtn = UIButton()
btmBtn.backgroundColor = UIColor(named: "按钮渐变色上")
btmBtn.setTitle("确定", for: .normal)
btmBtn.setTitleColor(UIColor.white, for: .normal)
btmBtn.titleLabel?.font = UIFont(name: "PingFangSC-Medium", size: 15)
btmBtn.addTarget(self, action: #selector(submitAc), for: .touchUpInside)
view.addSubview(btmBtn)
btmBtn.snp.makeConstraints { (make) in
make.top.equalTo(pickerView.snp.bottom)
make.left.right.bottom.equalTo(0)
}
let lbl1 = UILabel()
lbl1.text = "确定"
lbl1.font = UIFont.init(name: "PingFangSC-Medium", size: 15)
lbl1.textColor = UIColor.white
lbl1.textAlignment = .center
view.addSubview(lbl1)
lbl1.snp.makeConstraints { (make) in
make.top.equalTo(pickerView.snp.bottom)
make.left.right.equalTo(0)
make.height.equalTo(49)
}
}
var stime:Double = 0
@objc func submitAc(){
......
......@@ -39,7 +39,7 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
userPhoneTF.text = arr![1]
messageTV.text = arr![2]
}
messageTV.text = "格利食品"
}
......
......@@ -29,6 +29,28 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var tempCityName = ""
var detailAdrStr = ""
func mapView(_ mapView: MAMapView!, regionWillChangeAnimated animated: Bool) {
if titleLbl != nil {
titleLbl!.text = ""
introView?.isHidden = true
sjImg?.isHidden = true
}
}
func mapView(_ mapView: MAMapView!, regionDidChangeAnimated animated: Bool) {
if titleLbl != nil {
titleLbl!.text = ""
introView?.isHidden = true
sjImg?.isHidden = true
}
}
func mapView(_ mapView: MAMapView!, mapWillMoveByUser wasUserAction: Bool) {
if titleLbl != nil {
titleLbl!.text = ""
introView?.isHidden = true
sjImg?.isHidden = true
}
}
@objc func backToCurrentLoc(_ sender: Any) {
cityName = tempCityName as NSString
lat = tempLat
......@@ -356,11 +378,13 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var districet = ""
//MARK: -- 地址选择完成
@IBAction func sureSelectAddressAction(_ sender: LGButton) {
print("sureSelectAddressAction")
if titleLbl?.text == "" {
return
}
var dict:Dictionary<String,Any> = Dictionary()
dict["menPai"] = addressDetailTF.text
dict["shouHuoRen"] = nameTF.text
......@@ -447,6 +471,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
//MARK: - 高德地图delegate
var introView:UIView?
var sjImg:UIImageView?
var titleLbl:UILabel?
var contentLbl:UILabel?
......@@ -461,7 +486,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var specRecord = ""
func onPOISearchDone(_ request: AMapPOISearchBaseRequest!, response: AMapPOISearchResponse!) {
print("mapDidMoveByUser3",isMove)
if response.count == 0 {
return
}
......@@ -492,10 +517,18 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
contentLbl?.numberOfLines = 0
contentLbl?.lineBreakMode = .byCharWrapping
introView?.addSubview(contentLbl!)
}
let img = UIImageView()
img.image = UIImage(named: "矩形")
MapBgView.addSubview(img)
sjImg = img
}
titleLbl!.text = response.pois.first?.name
if titleLbl!.text!.count > 0 {
introView?.isHidden = false
sjImg?.isHidden = false
}
cityName = response.pois.first?.city as! NSString
if tempCityName == ""{
......@@ -537,15 +570,14 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
}
if isHistory == false {
print("移动地图")
let coordinate = JZLocationConverter.gcj02(toWgs84: CLLocationCoordinate2D(latitude: lat, longitude: lng))
let d = ["lat_lon":["lat":coordinate.latitude,"lon":coordinate.longitude],
"name":titleLbl!.text,
"city_id":city_id
] as [String : Any]
adrDataModel = cityListDataModel(JSON: d)
}
isHistory = false
let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11),
......@@ -598,10 +630,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
make.height.equalTo(h+20)
})
let img = UIImageView()
img.image = UIImage(named: "矩形")
MapBgView.addSubview(img)
img.snp.makeConstraints { (make) in
sjImg?.snp.makeConstraints { (make) in
make.centerX.equalTo(introView!.snp.centerX)
make.top.equalTo(introView!.snp.bottom)
make.height.equalTo(7.25)
......@@ -629,6 +658,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
func mapView(_ mapView: MAMapView!, mapDidMoveByUser wasUserAction: Bool) {
let req = AMapPOIAroundSearchRequest()
//地址
print("mapDidMoveByUser2",isMove)
if isMove {
adrName = ""
detailAdr = ""
......@@ -636,14 +666,14 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
historySelect = 10086
}
req.location = AMapGeoPoint.location(withLatitude: CGFloat(mapView.centerCoordinate.latitude), longitude: CGFloat(mapView.centerCoordinate.longitude))
req.requireExtension = true
search.aMapPOIAroundSearch(req)
}
var isHistory = false
var annotation:MAPointAnnotation? = nil
func mapViewRegionChanged(_ mapView: MAMapView!) {
......
......@@ -58,12 +58,12 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JfY-Q9-10Q">
<rect key="frame" x="46" y="29" width="232" height="42"/>
<rect key="frame" x="46" y="29" width="242" height="42"/>
<attributedString key="attributedText">
<fragment content=" ">
<attributes>
<color key="NSColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<font key="NSFont" metaFont="system" size="12"/>
<font key="NSFont" metaFont="cellTitle"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
......@@ -85,6 +85,7 @@
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gIq-zy-KC4">
<rect key="frame" x="303" y="29" width="40" height="20"/>
<color key="backgroundColor" name="白色背景色"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="b8d-ak-qvu"/>
<constraint firstAttribute="width" constant="40" id="lLc-Ql-JTh"/>
......@@ -135,7 +136,7 @@
<constraint firstAttribute="trailing" secondItem="d4F-L8-sHy" secondAttribute="trailing" constant="15" id="fik-0a-bN6"/>
<constraint firstItem="d4F-L8-sHy" firstAttribute="leading" secondItem="wxD-2W-Kct" secondAttribute="leading" id="geB-F3-UYR"/>
<constraint firstItem="xQh-lb-yiJ" firstAttribute="leading" secondItem="JJG-L3-lyj" secondAttribute="trailing" constant="10" id="rId-AJ-tk5"/>
<constraint firstAttribute="trailing" secondItem="JfY-Q9-10Q" secondAttribute="trailing" constant="80" id="rWE-FX-NSP"/>
<constraint firstItem="gIq-zy-KC4" firstAttribute="leading" secondItem="JfY-Q9-10Q" secondAttribute="trailing" constant="15" id="rWE-FX-NSP"/>
<constraint firstItem="eV0-oM-vuy" firstAttribute="centerX" secondItem="JJG-L3-lyj" secondAttribute="centerX" id="wRy-Qd-9t3"/>
<constraint firstItem="Zm0-Vi-78r" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="24.5" id="ygX-wP-k9T"/>
<constraint firstAttribute="bottom" secondItem="eV0-oM-vuy" secondAttribute="bottom" id="zZh-DB-pte"/>
......
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