地图显示annnotations优化
This commit is contained in:
Binary file not shown.
@@ -349,8 +349,8 @@
|
||||
filePath = "OrderScheduling/Rescue/ViewController/DispatchOrderController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "310"
|
||||
endingLineNumber = "310"
|
||||
startingLineNumber = "315"
|
||||
endingLineNumber = "315"
|
||||
landmarkName = "dd_mapView(_:didAnnotationViewTapped:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@@ -381,8 +381,8 @@
|
||||
filePath = "OrderScheduling/Rescue/ViewController/DispatchOrderController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "136"
|
||||
endingLineNumber = "136"
|
||||
startingLineNumber = "138"
|
||||
endingLineNumber = "138"
|
||||
landmarkName = "addActions()"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
@@ -444,8 +444,8 @@
|
||||
filePath = "OrderScheduling/Rescue/ViewController/DispatchOrderController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "154"
|
||||
endingLineNumber = "154"
|
||||
startingLineNumber = "156"
|
||||
endingLineNumber = "156"
|
||||
landmarkName = "addActions()"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
@@ -2915,8 +2915,8 @@
|
||||
filePath = "OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "555"
|
||||
endingLineNumber = "555"
|
||||
startingLineNumber = "557"
|
||||
endingLineNumber = "557"
|
||||
landmarkName = "viewDidAppear(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@@ -2931,8 +2931,8 @@
|
||||
filePath = "OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "511"
|
||||
endingLineNumber = "511"
|
||||
startingLineNumber = "513"
|
||||
endingLineNumber = "513"
|
||||
landmarkName = "viewDidLoad()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
||||
@@ -15,6 +15,8 @@ import DDMAMapKit_Private
|
||||
|
||||
fileprivate let dispatchPannelViewHeight = auto(300)
|
||||
fileprivate let dispatchPannelViewTopInset = auto(45)
|
||||
fileprivate let mapInsetTopSafeArea = auto(80)
|
||||
fileprivate let mapInsetBottomSafeArea = auto(80)
|
||||
|
||||
extension DispatchOrderController {
|
||||
func addActions() {
|
||||
@@ -114,18 +116,18 @@ extension DispatchOrderController {
|
||||
|
||||
dispatchOrderView.dispatchPannelView.offlineView.submitButton.rx.tap
|
||||
.filter({[weak self] _ in
|
||||
if self?.dispatchOrderView.dispatchPannelView.offlineView.name.textFiled.text?.isEmpty != false {
|
||||
self?.view.dd_makeToast(dispatchOrderInputName)
|
||||
return false
|
||||
}
|
||||
// if self?.dispatchOrderView.dispatchPannelView.offlineView.name.textFiled.text?.isEmpty != false {
|
||||
// self?.view.dd_makeToast(dispatchOrderInputName)
|
||||
// return false
|
||||
// }
|
||||
if self?.dispatchOrderView.dispatchPannelView.offlineView.phone.textFiled.text?.isEmpty != false {
|
||||
self?.view.dd_makeToast(dispatchOrderInputPhone)
|
||||
return false
|
||||
}
|
||||
if self?.dispatchOrderView.dispatchPannelView.offlineView.license.textFiled.text?.isEmpty != false {
|
||||
self?.view.dd_makeToast(dispatchOrderInputLicense)
|
||||
return false
|
||||
}
|
||||
// if self?.dispatchOrderView.dispatchPannelView.offlineView.license.textFiled.text?.isEmpty != false {
|
||||
// self?.view.dd_makeToast(dispatchOrderInputLicense)
|
||||
// return false
|
||||
// }
|
||||
return self?.dispatchOrderView.dispatchPannelView.offlineView.name.textFiled.text?.isEmpty == false && self?.dispatchOrderView.dispatchPannelView.offlineView.phone.textFiled.text?.isEmpty == false && self?.dispatchOrderView.dispatchPannelView.offlineView.license.textFiled.text?.isEmpty == false
|
||||
})
|
||||
.flatMapLatest {[weak self] _ in
|
||||
@@ -177,6 +179,9 @@ extension DispatchOrderController {
|
||||
self?.vehicleAnnotions.append(pointAnnotation)
|
||||
}
|
||||
|
||||
if (self?.dispatchOrderView.maMapView.maMapView.annotations.count ?? 0) > 0 , let annotations = self?.dispatchOrderView.maMapView.maMapView.annotations {
|
||||
self?.dispatchOrderView.maMapView.maMapView.showAnnotations(annotations, edgePadding:UIEdgeInsets(top: mapInsetTopSafeArea, left: 0, bottom: dispatchPannelViewHeight + mapInsetBottomSafeArea, right: 0), animated: true)
|
||||
}
|
||||
self?.dispatchOrderView.dispatchPannelView.tableView.reloadData()
|
||||
}
|
||||
}else{
|
||||
@@ -532,8 +537,8 @@ open class DispatchOrderPannelView : DDView {
|
||||
radiusView.addSubview(tapBackgroundView)
|
||||
onlineButton.setImage(UIImage(named: "dispatchOrder_online_unselected"), for: .normal)
|
||||
onlineButton.setImage(UIImage(named: "dispatchOrder_online_selected"), for: .selected)
|
||||
onlineButton.setTitle("线上调度", for: .normal)
|
||||
onlineButton.setTitle("线上调度", for: .selected)
|
||||
onlineButton.setTitle("app调度", for: .normal)
|
||||
onlineButton.setTitle("app调度", for: .selected)
|
||||
onlineButton.setTitleColor(.hex("585E6F").alpha(0.7), for: .normal)
|
||||
onlineButton.setTitleColor(.hex("000000"), for: .selected)
|
||||
onlineButton.titleLabel?.font = .mediumFont(auto(16))
|
||||
@@ -541,8 +546,8 @@ open class DispatchOrderPannelView : DDView {
|
||||
radiusView.addSubview(onlineButton)
|
||||
offlineButton.setImage(UIImage(named: "dispatchOrder_offline_unselected"), for: .normal)
|
||||
offlineButton.setImage(UIImage(named: "dispatchOrder_offline_selected"), for: .selected)
|
||||
offlineButton.setTitle("线下调度", for: .normal)
|
||||
offlineButton.setTitle("线下调度", for: .selected)
|
||||
offlineButton.setTitle("小程序调度", for: .normal)
|
||||
offlineButton.setTitle("小程序调度", for: .selected)
|
||||
offlineButton.setTitleColor(.hex("585E6F").alpha(0.7), for: .normal)
|
||||
offlineButton.setTitleColor(.hex("000000"), for: .selected)
|
||||
offlineButton.titleLabel?.font = .mediumFont(auto(16))
|
||||
|
||||
@@ -407,20 +407,24 @@ extension VehicleMonitoringController : JXCategoryListContainerViewDelegate {
|
||||
self?.preciousTableView = vc?.vehicleMonitoringListView.tableView
|
||||
|
||||
// 设置当前选中的annotation
|
||||
self?.vehicleMonitoringView.maMapView.maMapView.setCenter(CLLocationCoordinate2D(latitude: Double(model.lat ?? "0")!, longitude: Double(model.lon ?? "0")!), animated: true)
|
||||
if let lat = model.lat,let lon = model.lon {
|
||||
self?.vehicleMonitoringView.maMapView.maMapView.setCenter(CLLocationCoordinate2D(latitude: Double(lat) ?? 0, longitude: Double(lon) ?? 0), animated: true)
|
||||
}
|
||||
|
||||
// 当前annotation展开,其他闭合
|
||||
self?.vehicleMonitoringView.maMapView.maMapView.removeAnnotations(self?.mapAnnotaions)
|
||||
self?.mapAnnotaions.removeAll()
|
||||
for index in 0..<(vc?.models.count ?? 0) {
|
||||
let model = vc?.models[index]
|
||||
let coordinate = CLLocationCoordinate2D(latitude: Double(model?.lat ?? "") ?? 0, longitude: Double(model?.lon ?? "") ?? 0)
|
||||
let pointAnnotation = MAPointAnnotation.init()
|
||||
pointAnnotation.annotationClass = VehicleMonitoringPointAnnotation.self
|
||||
pointAnnotation.coordinate = coordinate
|
||||
pointAnnotation.tag = index
|
||||
self?.vehicleMonitoringView.maMapView.maMapView.addAnnotation(pointAnnotation)
|
||||
self?.mapAnnotaions.append(pointAnnotation)
|
||||
if let _ = model?.lat,let _ = model?.lon {
|
||||
let coordinate = CLLocationCoordinate2D(latitude: Double(model?.lat ?? "") ?? 0, longitude: Double(model?.lon ?? "") ?? 0)
|
||||
let pointAnnotation = MAPointAnnotation.init()
|
||||
pointAnnotation.annotationClass = VehicleMonitoringPointAnnotation.self
|
||||
pointAnnotation.coordinate = coordinate
|
||||
pointAnnotation.tag = index
|
||||
self?.vehicleMonitoringView.maMapView.maMapView.addAnnotation(pointAnnotation)
|
||||
self?.mapAnnotaions.append(pointAnnotation)
|
||||
}
|
||||
}
|
||||
}
|
||||
return vc
|
||||
@@ -467,7 +471,6 @@ extension VehicleMonitoringController : JXCategoryViewDelegate {
|
||||
}
|
||||
|
||||
vehicleMonitoringView.maMapView.maMapView.removeAnnotations(mapAnnotaions)
|
||||
var hasSetCenter = false
|
||||
for index in 0..<(mapModel?.count ?? 0) {
|
||||
let model = mapModel?[index]
|
||||
if model?.lat != nil && model?.lon != nil {
|
||||
@@ -478,13 +481,12 @@ extension VehicleMonitoringController : JXCategoryViewDelegate {
|
||||
pointAnnotation.tag = index
|
||||
vehicleMonitoringView.maMapView.maMapView.addAnnotation(pointAnnotation)
|
||||
mapAnnotaions.append(pointAnnotation)
|
||||
|
||||
if hasSetCenter == false {
|
||||
hasSetCenter = true
|
||||
vehicleMonitoringView.maMapView.maMapView.setCenter(coordinate, animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let annotations = vehicleMonitoringView.maMapView.maMapView.annotations {
|
||||
vehicleMonitoringView.maMapView.maMapView.showAnnotations(annotations, animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user