Commit 903efe81 authored by Qiu Xiang's avatar Qiu Xiang
Browse files

修正自定义信息窗体显示问题

parent 43d80ae7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() {

    override fun addView(marker: AMapMarker, view: View, index: Int) {
        when (view) {
            is AMapInfoWindow -> marker.infoWindow = view as ReactViewGroup
            is AMapInfoWindow -> marker.infoWindow = view
            is AMapOverlay -> marker.setIconView(view)
        }
    }
+4 −4
Original line number Diff line number Diff line
@@ -80,13 +80,13 @@ class AMapView(context: ThemedReactContext) : MapView(context) {
        }

        map.setInfoWindowAdapter(object : AMap.InfoWindowAdapter {
            private val paddingTop = context.resources.displayMetrics.density
            val paddingTop = context.resources.displayMetrics.density

            override fun getInfoWindow(marker: Marker): View {
                return markers[marker.id]?.infoWindow as View
            override fun getInfoWindow(marker: Marker): View? {
                return markers[marker.id]?.infoWindow
            }

            override fun getInfoContents(marker: Marker): View {
            override fun getInfoContents(marker: Marker): View? {
                val layout = LinearLayout(context)
                layout.orientation = LinearLayout.VERTICAL
                val titleView = TextView(context)