[android] #6014 - add example with numerical filter

This commit is contained in:
Ivo van Dongen
2016-08-16 10:10:44 +02:00
parent 1daba5d04b
commit c34130ac6d
2 changed files with 4 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import static com.mapbox.mapboxsdk.style.layers.Filter.eq;
import static com.mapbox.mapboxsdk.style.layers.Filter.*;
import static com.mapbox.mapboxsdk.style.layers.Function.Stop;
import static com.mapbox.mapboxsdk.style.layers.Function.stop;
import static com.mapbox.mapboxsdk.style.layers.Function.zoom;
@@ -244,8 +244,8 @@ public class RuntimeStyleActivity extends AppCompatActivity {
fillAntialias(true)
);
//Only show me parks
layer.setFilter(eq("type", "park"));
//Only show me parks (except westerpark with stroke-width == 3)
layer.setFilter(all(eq("type", "park"), eq("stroke-width", 2)));
mapboxMap.addLayer(layer, "building");
//layer.setPaintProperty(fillColor(Color.RED)); //XXX But not after the object is attached

View File

@@ -5,7 +5,7 @@
"type": "Feature",
"properties": {
"stroke": "#555555",
"stroke-width": 2,
"stroke-width": 3,
"stroke-opacity": 1,
"fill": "#555555",
"fill-opacity": 0.5,