70 lines
1.6 KiB
Swift
70 lines
1.6 KiB
Swift
//
|
|
// ItineraryDetailView.swift
|
|
// QuickLocation
|
|
//
|
|
// Created by 八条 on 2026/6/26.
|
|
//
|
|
|
|
import UIKit
|
|
import RxSwift
|
|
import RxCocoa
|
|
import AMapNaviKit
|
|
|
|
class ItineraryDetailView: UIView {
|
|
|
|
private func setupUI() {
|
|
addSubview(mapView)
|
|
addSubview(navBgView)
|
|
addSubview(navView)
|
|
|
|
navBgView.layoutChain
|
|
.edges(excludingEdge: .bottom)
|
|
.heightToWidth(160/375)
|
|
|
|
navView.layoutChain
|
|
.edges(excludingEdge: .bottom)
|
|
.height(kNaviHeight)
|
|
|
|
mapView.layoutChain
|
|
.edges()
|
|
}
|
|
|
|
lazy var navBgView: UIImageView = {
|
|
let iv = UIImageView()
|
|
iv.image = UIImage(named: "Common/navBar_bg_2")
|
|
iv.contentMode = .scaleAspectFill
|
|
return iv
|
|
}()
|
|
|
|
lazy var navView: BaseNavigationView = {
|
|
let nav = BaseNavigationView(title: "行程路线")
|
|
return nav
|
|
}()
|
|
|
|
lazy var mapView: MAMapView! = {
|
|
let mv = MAMapView()
|
|
mv.zoomLevel = 14
|
|
mv.showsUserLocation = false
|
|
mv.showsCompass = false
|
|
mv.userTrackingMode = .none
|
|
// DispatchQueue.main.async { mv.logoCenter = CGPoint(x: mv.bounds.width - 55, y: kNaviHeight) }
|
|
return mv
|
|
}()
|
|
|
|
func cleanupMap() {
|
|
mapView?.delegate = nil
|
|
mapView?.removeFromSuperview()
|
|
mapView = nil
|
|
}
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: .zero)
|
|
backgroundColor = .white
|
|
setupUI()
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
}
|