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

Blinking symbol update #71

Open
Sprechen opened this issue Feb 26, 2023 · 7 comments
Open

Blinking symbol update #71

Sprechen opened this issue Feb 26, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Sprechen
Copy link

I'm using the Maplibre android-sdk:9.6.0 with org.maplibre.gl:android-plugin-annotation-v9:1.0.0.

I have a symbol manager with only a symbol (that is an image) with potentially fast updates of location and icon rotation.

Sometimes, the symbol "flick" or "blink" when updated.
I found a similar issue on the mapbox repository, where the suggested solution was to allow the overlap of icon and text as follow:

symbolManager.setIconAllowOverlap(true);
symbolManager.setTextAllowOverlap(true);

this suggestion only mitigate the effect, but sometimes the "blink" is still happening.
Do you have any suggestion to completely resolve this issue?

I set also up other properties, as follows:

        symbolManager = SymbolManager(mapView, map, style)
        symbolManager.iconRotationAlignment = Property.ICON_ROTATION_ALIGNMENT_MAP
        symbolManager.iconAllowOverlap = true
        symbolManager.textIgnorePlacement = true
        symbolManager.textAllowOverlap = true
        symbolManager.iconIgnorePlacement = true

Thanks for any suggestion!

@Sprechen Sprechen added the bug Something isn't working label Feb 26, 2023
@ovivoda
Copy link

ovivoda commented Feb 28, 2023

@Sprechen Please update MapLibre android-sdk to v10.0.2 and see if this is still an issue?

@Sprechen
Copy link
Author

@ovivoda I've updated to the latest version of the sdk, v10.0.2. No changes are needed in my code, and I'm still using the 'org.maplibre.gl:android-plugin-annotation-v9:1.0.0 plugin.
Unfortunately, the "blink" is still present.
It seems that if only the rotation is updated, the blink is not present. Otherwise, when both rotation and position are updated, the blink is visible.

@Sprechen
Copy link
Author

Sprechen commented Mar 7, 2023

@ovivoda any update on this issue?

@ovivoda
Copy link

ovivoda commented Mar 7, 2023

@Sprechen is it possible for you to provide a sample application were this can be easily reproducible?

@jDilshodbek
Copy link

Hello @ovivoda I have also witnessed this issue I am providing you screen video and code.

Symbol.flicker.mp4

Here I am updating symbol latlng positions continuosly with raw location updates from FusedLocationProvider.

`val valueAnimator = ValueAnimator.ofFloat(0F, 1F)
valueAnimator.duration = 3000
valueAnimator.interpolator = LinearInterpolator()
valueAnimator.addUpdateListener { valueAnimator1 ->
val v = valueAnimator1.animatedFraction
val lat = v * currentLatLng.latitude + (1 - v) * lastLocation!!.latitude
val lng = v * currentLatLng.longitude + (1 - v) * lastLocation!!.longitude
val newPos = LatLng(lat, lng)
markerCurrentLocation!!.latLng = newPos
val bear = bearingBetweenLocations(
LatLng(
lastLocation!!.latitude,
lastLocation!!.longitude,
),
currentLatLng,
)
CommonPrefModel.BEAR = bear

                if (bear > 0 && abs(bear.toInt()) != abs(lastBear.toInt() - 180)) {
                    markerCurrentLocation!!.iconRotate = bear
                    lastBear = bear
                }

                symbolManager?.update(markerCurrentLocation)
            }`

@ravenfeld
Copy link
Contributor

I don't know if it's the same problem, but on my side, some of them disappear when I move the card, especially if I rotate it.

Wouldn't it be better to make the issue in the plugin repo?

@louwers louwers transferred this issue from maplibre/maplibre-native Oct 8, 2024
@louwers
Copy link
Collaborator

louwers commented Oct 8, 2024

@ravenfeld Thanks. Transferred.

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

5 participants