-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
symbol layer fades in upon setData #5716
Comments
I can replicate this issue as described by @andrewharvey on Chrome, Firefox, and Edge. Examples:
|
@ansis This sounds like it's probably another issue with how @ryanbaumann I shouldn't make light of broken functionality, but that fleet of ghost-planes crossing the South Pacific is... kind of awesome. |
Also reported as a bug with the "Animate a point along a route" example in #5490 (comment). |
I think it is the same issue, so posting it here: There is also an effect on a fill-pattern: Here are two examples, just zoom in to see the issue: v.0.41.0 example -> the blurry lines are only a short moment visible when zooming v.0.42.2 example -> the blurry lines are staying visible at certain zoom levels |
@pathmapper I think the underlying cause for that is different so I split your comment into a separate issue: #5740 (comment) |
@ansis sure and thanks! |
@livemixlove I'm not sure how you're adding that marker to the map, but this looks like expected collision detection behavior to me. Starting with If you want the symbols to be allowed to overlap, you have to explicitly use the |
The label collision feature is awesome. But, notice how the marker disappears (quickly fades in and out ) in a place where there should be no collision (below "Northern BLVD"). You might have to watch the gif a few times. This looks like a bug to me, unless I need to be setting some new parameters for layers. |
Also, when I say "marker", I'm only referring to the green marker being dragged. |
I added
to the green icon's layout properties, and I still see the same behavior. |
Ah OK thanks for the clarification, I was paying attention to the wrong thing -- looking at the labels underneath instead of that little flicker in the marker itself. A guess: this might be happening when the marker crosses a tile boundary (you can see tile boundaries by setting |
More info:
|
Shucks, I thought it was such a good guess. 🤔 Do you think you could put together a minimal JSFiddle demonstrating the behavior? |
Ok, I made a minimal example. I modified the https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/ example: https://codepen.io/anon/pen/xpwqpe (make sure to add your accessToken) If you increase the number of geojson features, the effect becomes more pronounced. On line 65 I add 2000 additional features that aren't being dragged. I think the bug happens when you use I'm on OSX 10.12.3 , Chrome Version 62.0.3202.94 (Official Build) (64-bit) |
I can replicate the flashing, to make it easier to see I forked your example to https://codepen.io/anon/pen/JMYWBg adding:
|
@ChrisLoer , should we reopen this issue? |
Yeah, let's re-open for now. I think we're probably looking at a different underlying problem, but might as well track it here until we figure it out. Thanks for the codepen! |
That's a good hint @livemixlove, and there's definitely a problem in I'm not certain it explains what you're seeing (depends on a lot of timing), but it definitely could. |
@andrewharvey @livemixlove I'm not actually sure what I'm looking for in your codepens. I set the map's |
@ChrisLoer In https://codepen.io/anon/pen/JMYWBg when you drag that circle around (you need to hover over the centre to get the grab mouse handler, and then you can drag it), and move it quickly it will flash in and out, rather than just moving from one location to the next as you'd expect. I'm not sure if this is the intended behaviour or a bug, ie. should it really fade in then out when using set data? When animating like this you probably want to skip the fade in/out. I just made a few changes to @livemixlove example to try to demonstrate the flashing easier. |
I still see the effect with |
Ah! I definitely do not see that on my machine. Not sure why. You're right, |
My machine: OSX 10.12.3 , Chrome Version 62.0.3202.94 |
I'm on macOS 10.13.2, but I doubt it makes a difference. In the example you showed, it's crossing over tile boundaries (or at least I think it is because it's at null island, and tiles always come together there) -- can you turn tile boundaries on and reproduce in an area without them? Because this can definitely happen crossing tile boundaries. The tile boundary issue is just a limitation of how we do fading (we don't have any reliable way to tell that two icons in two different tiles are conceptually "the same" and thus shouldn't be cross-faded): I think that's an argument for allowing individual layers to opt-out of fade animations. |
Here's the closest I can get: one missing circle on frame 20. But this is not the same as what you're seeing -- note that there's no fading. @ansis is almost ready to land a PR that will change this code pretty significantly: #5890. Might be worth checking out that branch to see if you can reproduce with that code as well. |
@ChrisLoer Maybe your computer is just much faster? I'm not sure if Chrome's dev tools CPU throttling would help recreate. |
I can reproduce both issues on #5890. I'll try to find the cause of the flickering within the tile bounds. |
@andrewharvey @livemixlove thanks for the test cases. They should be fixed by #5890 which was just merged into master. |
mapbox-gl-js version: git bisect reveals this is a regression in 1355618 (#5150)
When updating a source with setData any symbol layers using that source will fadein again after the setData. This causes the symbol to flicker when setData is fired frequently such as from a cursor event.
See this in action at https://jsbin.com/kezucog/edit?html,output (just move the cursor around the screen). This wasn't a problem in 0.41.0, but is a problem with 0.42.0 and I pinpointed it to the commit mentioned.
I can see that GL JS now does cross source symbol placement so previously the "Mapbox DC" (from the example) would overlap existing labels, now it will actually fade out the other labels to make room for it. To get the 0.41 behaviour back it's just a matter of using
"text-ignore-placement": true, "icon-ignore-placement": true
in that layer's layout properties. However even with this, the label still fades in again every time it is updated./cc @ChrisLoer
The text was updated successfully, but these errors were encountered: