| | |
| | | moveCamera(aMap, carMarker!!.position) |
| | | } |
| | | 5, 6 -> { |
| | | moveCamera(aMap, carMarker!!.position, endMarker!!.position) |
| | | if (endMarker == null){ |
| | | moveCamera(aMap, carMarker!!.position) |
| | | }else{ |
| | | moveCamera(aMap, carMarker!!.position, endMarker!!.position) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | 5, 6 -> { |
| | | // startAMapNavi(endMarker!!) |
| | | startActivity<GPSNaviActivity>( |
| | | "start" to carMarker!!.position, |
| | | "end" to endMarker!!.position |
| | | ) |
| | | if (endMarker == null){ |
| | | toast("暂无终点") |
| | | }else{ |
| | | startActivity<GPSNaviActivity>( |
| | | "start" to carMarker!!.position, |
| | | "end" to endMarker!!.position |
| | | ) |
| | | } |
| | | |
| | | } |
| | | else -> { |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }) |
| | | }else{ |
| | | var view = |
| | | creatCarView() |
| | | carMarker?.setIcon(getIcon(view)) |
| | | if (isMove) { |
| | | moveCamera(aMap, carMarker!!.position) |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun creatNullView(): View { |
| | | val carView = createView(R.layout.view_no, this) |
| | | return carView |
| | | } |
| | | |
| | | |
| | |
| | | tv_time.text = it.data.travelTime |
| | | tv_start_address.text = it.data.startAddress |
| | | tv_end_address.text = it.data.endAddress |
| | | tv_end_address.visibility = if (it.data.endAddress.isNullOrEmpty()) View.GONE else View.VISIBLE |
| | | tv_red_money.text = it.data.tipMoney.toString() + "元小费" |
| | | tv_phone.text = orderBean.data.phone |
| | | showStatueMapUI(it) |
| | |
| | | view.iv_img.setImageResource(R.mipmap.zhongdian) |
| | | endMarker = addMarker(aMap, it.data.endLat, it.data.endLon, view, "") |
| | | } |
| | | endMarker!!.isVisible = false |
| | | endMarker?.isVisible = false |
| | | if (carMarker == null) { |
| | | val carView = creatCarView("") |
| | | carMarker = addMarker( |
| | |
| | | carView.iv_img.setImageResource(R.mipmap.icon_car) |
| | | carView.tv_hint.visible() |
| | | carView.tv_hint.text = content |
| | | return carView |
| | | } |
| | | |
| | | fun creatCarView(): View { |
| | | val carView = createView(R.layout.item_map_market, this) |
| | | carView.iv_img.setImageResource(R.mipmap.icon_car) |
| | | carView.tv_hint.gone() |
| | | return carView |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | fun getTance(startLatLng: LatLng, endLatLng: LatLng, onclick: (tance: Float) -> Unit) { |
| | | AMapKit.initRouteLine( |
| | | this, |
| | | startLatLng, |
| | | endLatLng, |
| | | object : (MutableList<LatLng>, Float, Long) -> Unit { |
| | | override fun invoke(p1: MutableList<LatLng>, p2: Float, p3: Long) { |
| | | onclick(p2) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | override fun setOnclick() { |
| | | |