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