首页 > 解决方案 > Kotlin/Android:自定义 googlemaps 标记的旋转

问题描述

标记将如何在 googlemaps 上旋转?使用精简模式。我已经尝试了很多。没有任何效果。这是我的调查基础,对我来说看起来很正确:

val marker = map.addMarker(
        MarkerOptions()
            .position(arrowPointPosition)
            .icon(BitmapDescriptorFactory.fromBitmap(
                IconGenerator(context).run {
                    setBackground(resources.getDrawable(R.drawable.ic_arrow_head, null)) // also tried to wrap it into a layout
                    setRotation(33) // alternative A
                    makeIcon()
                }
            ))
            .anchor(0.5F, 0.5F)
            .rotation(33F) // alternative B
    )

标签: androidgoogle-mapskotlinrotationmarker

解决方案


推荐阅读