mapbox / mapbox/mapbox-maps-android

MapIdle won't fire if location pulsingEnabled is true

Open
#2,116 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Environment

  • Android OS version: 14.0 (U) - API 34
  • Devices affected: Emulator
  • Maps SDK Version: 10.14.0 and c7a4d0a06e7ee01808bf08bbe6046a0d15031f04

Observed behavior and steps to reproduce

MapIdle callbacks are not fired if location is enabled

To reproduce use this code in the repo as SimpleMapActivity.

package com.mapbox.maps.testapp.examples

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.mapbox.geojson.Point
import com.mapbox.maps.CameraOptions
import com.mapbox.maps.MapView
import com.mapbox.maps.plugin.locationcomponent.location

/**
 * Example of displaying a map.
 */
class SimpleMapActivity : AppCompatActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val mapView = MapView(this)
    setContentView(mapView)
    mapView.getMapboxMap()
      .apply {
        setCamera(
          CameraOptions.Builder()
            .center(Point.fromLngLat(LONGITUDE, LATITUDE))
            .zoom(9.0)
            .build()
        )
      }
    mapView.getMapboxMap().addOnStyleLoadedListener {
      mapView.getMapboxMap().addOnMapIdleListener { event ->
        print(" [] => On MapIdle: ${event}")
      }
      if (true) {
        mapView.location.updateSettings {
          enabled = true
          pulsingEnabled = true
        }
      }
    }

  }

  companion object {
    private const val LATITUDE = 40.0
    private const val LONGITUDE = -74.5
  }
}

Expected behavior

MapIdle callbacks should be called even if location is enabled

Notes / preliminary analysis

It looks location pulsing prevents onMapIdle to be called.

Additional links and references

See #1944

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided SimpleMapActivity, MapView, and location.updateSettings configuration on Android 14 with pulsingEnabled enabled. Review the behavior and the related issue #1944. Done means MapIdle callbacks fire while location pulsing remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.