Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using LocationPuck spams with warnings, when style is changed #2349

Open
SamuelBrucksch opened this issue Apr 19, 2024 · 0 comments
Open

Using LocationPuck spams with warnings, when style is changed #2349

SamuelBrucksch opened this issue Apr 19, 2024 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@SamuelBrucksch
Copy link

SamuelBrucksch commented Apr 19, 2024

Environment

  • Android OS version: 13
  • Devices affected: Oneplus Nord CE 5
  • Maps SDK Version: 11.1.0

When using the LocationPuck, we get warnings like this when changing the style:

[maps-android\Mbgl-Style]: Style object (accessing setStyleLayerProperty) should not be stored and used after MapView is destroyed or new style has been loaded.
[maps-android\Mbgl-Style]: Style object (accessing removeStyleLayer) should not be stored and used after MapView is destroyed or new style has been loaded.

I could narrow it down, to location, as when i disable it, it does not show the warning. It seems to be related to the LocationPuck images stored into a style, and when that style changes, it starts logging those warnings.

The warning is only logged, when the LocationPuck moves, for example when an animation is in place it logs multiple times per second.

There is a workaround, to avoid this, which also logs some warnings initially, but then stays quiet:

            mMapView?.location?.enabled = false
            mMapView?.location?.enabled = true

When toggling the location from enabled to disabled and back to enabled, it seems to reload the style or images or whatever, and then only the short moment it takes to disable and re-enable the location these warnings are logged. but then it is fine again.

Normally this is probably not a big issue, but for example when changing map style from day to night map, this spamming of logs happens. Not sure if that has an effect on performance, but it should nevertheless be looked into.

@SamuelBrucksch SamuelBrucksch added the bug 🪲 Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant