Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Marker symbol flickering issue while zooming out #16471

Open
ystsoi opened this issue May 18, 2020 · 6 comments
Open

Marker symbol flickering issue while zooming out #16471

ystsoi opened this issue May 18, 2020 · 6 comments
Labels
archived Archived because of inactivity

Comments

@ystsoi
Copy link

ystsoi commented May 18, 2020

Platform: Android / iOS
Mapbox SDK version: 9.2.1 / 5.9.0

Steps to trigger behavior

  1. For Android, can use the Mapbox Demo app, open the Styles > Symbol layer icons example. For iOS, can use the Add a marker symbol example.
  2. Zoom in and out, using the one-finger zoom gesture, for example. Zoom quickly if needed.

Expected behavior

No flickering.

Actual behavior

You will notice that the marker symbol will flicker at some points while zooming out.

@abrahamhunt
Copy link

There is a bit of flicker on iOS 5.8.0 but it got much worse in 5.9.0

example_videos.zip

@mrfaa
Copy link

mrfaa commented Jul 29, 2020

maybe related with #16473 ?

@ystsoi
Copy link
Author

ystsoi commented Jul 29, 2020

Yes, both involve flickering issue.

For Android, the Mapbox Demo app is not updated for 9.3.0, so not tested.

For iOS, 6.0.0 is definitely much better than 5.9.0. Cannot reproduce the flickering issue easily now, although still exist sometimes.

@knov
Copy link

knov commented Aug 31, 2020

We've released Android v9.4.0 and iOS v6.1.0 which resolve #16473. We believe that this issue should now be resolved.

@ystsoi
Copy link
Author

ystsoi commented Sep 1, 2020

I have installed the Mapbox Demo app in Google Play, which is of v9.3.1, it seems that the symbols still flicker easily.

The marker symbol example for the iOS version is much better. iOS v6.1.0 is similar to iOS v6.0.0, not easy to reproduce the flickering issue.

@ystsoi
Copy link
Author

ystsoi commented Oct 6, 2020

Tested. This issue does not exist in the latest Mapbox Demo app (v9.5.0) in Google Play.

By the way, I found that adding a symbol which allows overlap may flicker sometimes on Android. For example, can add a button, and attach the following handler to reproduce the issue:

public void onClick(View v) {
    if (++index == 1) {
        style.addImage("test_icon", ContextCompat.getDrawable(MainActivity.this, com.mapbox.mapboxsdk.R.drawable.mapbox_user_icon));
    }
    double latOff = (mapboxMap.getProjection().getVisibleRegion().latLngBounds.getLatitudeSpan() * (Math.random() - 0.5)) * 0.8;
    double lonOff = (mapboxMap.getProjection().getVisibleRegion().latLngBounds.getLongitudeSpan() * (Math.random() - 0.5)) * 0.8;
    Geometry g = Point.fromLngLat(mapboxMap.getCameraPosition().target.getLongitude() + lonOff, mapboxMap.getCameraPosition().target.getLatitude() + latOff);
    Feature f = Feature.fromGeometry(g);
    GeoJsonSource s = new GeoJsonSource("test_source" + index, f);
    SymbolLayer l = new SymbolLayer("test_layer" + index, "test_source" + index);
    l.setProperties(PropertyFactory.iconAllowOverlap(true), PropertyFactory.iconIgnorePlacement(true), PropertyFactory.iconImage("test_icon"));
    style.addSource(s);
    style.addLayer(l);
}

And I found that changing the following lines:

const JointOpacityState defaultOpacityState(
textAllowOverlap && (iconAllowOverlap || !(bucket.hasIconData() || bucket.hasSdfIconData()) || bucket.layout->get<style::IconOptional>()),
iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || bucket.layout->get<style::TextOptional>()),
true);

to:

const JointOpacityState defaultOpacityState(
        bucket.justReloaded && textAllowOverlap && (iconAllowOverlap || !(bucket.hasIconData() || bucket.hasSdfIconData()) || bucket.layout->get<style::IconOptional>()),
        bucket.justReloaded && iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || bucket.layout->get<style::TextOptional>()),
        true);

may prevent this issue. Please check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity
Projects
None yet
Development

No branches or pull requests

4 participants