You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Runtime Styling API - Filters on number properties not applied properly #5978
Hello,
filtering by numbers still does not work for me. Trying on version 4.2.2 and also 5.0.0-beta.1 and I am experiencing the same odd behavior.
When I have source
{"size_text":"193 KB","idzxy":902770176}
and filter
symbolLayer.setFilter(eq("idzxy", 902770176));
then filter evaluates to true and I can see the symbol.
But another symbol
{"size_text":"194 KB","idzxy":902760176}
and filter
symbolLayer.setFilter(eq("idzxy", 902760176));
then filter evaluates to false and I cannot see the symbol.
Has anybody chance to confirm this behavior and propose the solution?
Thanks.
@ouska Thanks for the report. Would you have the opportunity to make a small sample project which demonstrates the behaviour you describe here? I can't seem to reproduce this with the information in the ticket.
@ivovandongen
Hello,
project is not needed. Just throw these lines into your general mapbox project. Today I tested it with the version 5.0.0-SNAPSHOT. The same result. Let me know whether it helps or not.
you will see two "X" letters between Dover (GB) and Calais (FR) - you must zoom enough to see both Xes.
Now change ID values to 902770175, 902770176 instead of 100 and 200. You will see only one X with ID 902770176. There must be something odd with these high numbers - even they are regular Integers. I suspect some number cast in native part of the library.
Activity
ouska commentedon Feb 26, 2017
Hello,
filtering by numbers still does not work for me. Trying on version 4.2.2 and also 5.0.0-beta.1 and I am experiencing the same odd behavior.
When I have source
{"size_text":"193 KB","idzxy":902770176}
and filter
symbolLayer.setFilter(eq("idzxy", 902770176));
then filter evaluates to true and I can see the symbol.
But another symbol
{"size_text":"194 KB","idzxy":902760176}
and filter
symbolLayer.setFilter(eq("idzxy", 902760176));
then filter evaluates to false and I cannot see the symbol.
Has anybody chance to confirm this behavior and propose the solution?
Thanks.
ivovandongen commentedon Feb 28, 2017
@ouska Thanks for the report. Would you have the opportunity to make a small sample project which demonstrates the behaviour you describe here? I can't seem to reproduce this with the information in the ticket.
ouska commentedon Mar 2, 2017
@ivovandongen
Hello,
project is not needed. Just throw these lines into your general mapbox project. Today I tested it with the version 5.0.0-SNAPSHOT. The same result. Let me know whether it helps or not.
public void onMapReady(MapboxMap map) {
StringBuilder b = new StringBuilder();
b.append("{"type": "FeatureCollection", "features": [");
b.append("{"type": "Feature", "properties": {"id": 100}, ");
b.append(""geometry": {"type": "Point", "coordinates": [ 1.716198, 51.226369 ]}},");
b.append("{"type": "Feature", "properties": {"id": 200}, ");
b.append(""geometry": {"type": "Point", "coordinates": [ 1.516198, 51.026369 ]}}");
b.append("]}");
map.addSource(new GeoJsonSource("vt_centroid", b.toString()));
SymbolLayer slayer = new SymbolLayer("layer", "vt_centroid");
slayer.setProperties(textField("X"));
slayer.setFilter(in("id", 100, 200));
map.addLayer(slayer);
}
you will see two "X" letters between Dover (GB) and Calais (FR) - you must zoom enough to see both Xes.
Now change ID values to 902770175, 902770176 instead of 100 and 200. You will see only one X with ID 902770176. There must be something odd with these high numbers - even they are regular Integers. I suspect some number cast in native part of the library.
public void onMapReady(MapboxMap map) {
StringBuilder b = new StringBuilder();
b.append("{"type": "FeatureCollection", "features": [");
b.append("{"type": "Feature", "properties": {"id": 902770175}, ");
b.append(""geometry": {"type": "Point", "coordinates": [ 1.716198, 51.226369 ]}},");
b.append("{"type": "Feature", "properties": {"id": 902770176}, ");
b.append(""geometry": {"type": "Point", "coordinates": [ 1.516198, 51.026369 ]}}");
b.append("]}");
map.addSource(new GeoJsonSource("vt_centroid", b.toString()));
SymbolLayer slayer = new SymbolLayer("layer", "vt_centroid");
slayer.setProperties(textField("X"));
slayer.setFilter(in("id", 902770175, 902770176));
map.addLayer(slayer);
}
O.
ouska commentedon Mar 21, 2017
Hi @ivovandongen, have you had a chance to look at this? Any progress? Is there something more I can do about it?
Thank you for the feedback.
VO.