android 第二次发布后,标记未在GoogleMap中显示

qq24tv8q  于 12个月前  发布在  Android
关注(0)|答案(1)|浏览(107)

`object常量{

fun buildWelcomeMessage(): String {
    return StringBuilder("Welcome, ")
        .append(currentRider!!.firstName)
        .append(" ")
        .append(currentRider!!.lastName)
        .toString()
}

fun buildName(firstName: String, lastName: String): String {
    return StringBuilder(firstName).append("").append(lastName).toString()
}

var marketList: MutableMap<String, Marker> = HashMap()
var driversFound: MutableSet<DriverGeoModel> = HashSet()
const val DRIVER_INFO_REFERENCE = "DriverInfo"
const val RIDER_INFO_REFERENCE: String = "Riders"
const val CHANNEL_ID = "myChannelRider"
const val DRIVERS_LOCATION_REFERENCES: String = "DriversLocation"
var currentRider: RiderModel? = null
const val TOKEN_REFERENCE: String = "Token"`

个字符
这一个是RIDER应用程序在这里当骑手打开并等待在线驱动程序,在驱动程序应用程序时,驱动程序成为在线,它应该在这里显示在线驱动程序标记在谷歌Map,当应用程序启动第一次(安装后),它工作如预期,并显示在Map上,并删除,如果驱动程序离线。当应用程序被laucnhed第二次(安装后)小吃工程,说有司机发现和所有的东西,但标记不显示在Map上

nmpmafwu

nmpmafwu1#

到目前为止,

private fun refreshMap() {
        // Remove all markers from the map
        for (marker in Constants.marketList.values) {
            marker.remove()
        }
        Constants.marketList.clear()
        // Reset any other marker-related objects or data as needed
        Constants.driversFound.clear()
        distance = 1.0 // Reset the distance for querying drivers
        firstTime = true // Reset the firstTime flag
        // Load available drivers again
        loadAvailableDrivers()
    }

    override fun onDestroy() {
        super.onDestroy()
        _mapFragment = null
        refreshMap()
    }

字符串

相关问题