-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Android runtime style API bug with filters & numbers #6040
Comments
Confirmed that I am seeing the parks example in c34130a work just fine in my setup, so it's something more unique about my data set. |
@incanus I've tried out your json and code snippets by working it into the test app and it just seems to work. Can't say what's going wrong with your example based on the information you provided. See the patch here for more information: https://gist.github.com/ivovandongen/f6ac2d5edd66844f853126759134bc82 Hope that helps you. |
@ivovandongen You are adding a new layer rather than changing an existing one in Studio. See my original code in #6040 (comment): LineLayer segments = mapboxMap.getLayerAs("segments");
segments.setFilter(eq("uniqid", 10191020));
segments.setProperties(lineColor(Color.GREEN),
lineWidth(10f),
lineOpacity(0.5f)); This is finding the style layer which was created in Studio server-side from the source GeoJSON, not in the app. It uses Try this patch exactly to reproduce the problem: https://gist.github.com/incanus/b89e1b07bdbcc921b4ae928901584e93 What should happen is a styling similar to what's seen in Studio above, but what actually happens is that the whole of the |
This may actually be rendering related, not filter. See #5701. |
That's exactly what we're seeing here. I've confirmed that things work with both the primitive as the value as well as an |
Per extended chat with @ivovandongen—writing this up so we have a concrete place for it on which to hang commits and eventually mark it resolved.
Here is a sample data file:
https://gist.github.com/incanus/0607dccb035cd9b55ff95faa1b60cf8c
I've added this to a basic Mapbox Studio style at
mapbox://styles/justin/cirnit09r000bg1mb4kxqmvwi
.Each segment of the data file is addressable by a
uniqid
numeric field, e.g.10191020
. Something like this should be possible:This is the analog to doing it via the GUI in Studio:
However, all segments will get their style changed, not just the single one of the ~20 with that
uniqid
. The filter seems to be ignored.Numeric comparison, either types or precision, seems to be at fault. @ivovandongen tried a fix at ddf0d25 but it still doesn't seem to do it.
I will also test c34130a and see why it might be working but my example isn't. Is it maybe the size of the number in my data field?
/cc @frederoni just for when we might hit this on iOS filters.
The text was updated successfully, but these errors were encountered: