Add test demo for filter with expression in (#218)

* Add test demo for filter with expression in

* Update gl-native
This commit is contained in:
Kevin Li
2020-03-12 19:03:08 +08:00
committed by GitHub
parent 5c7a432bd6
commit c8108edc29
5 changed files with 110 additions and 2 deletions

View File

@@ -118,7 +118,6 @@ public class RuntimeStyleActivity extends AppCompatActivity {
// Center and Zoom (Amsterdam, zoomed to streets)
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(52.379189, 4.899431), 1));
mapboxMap.setStyle(
new Style.Builder()
.fromUri(Style.MAPBOX_STREETS)
@@ -243,6 +242,9 @@ public class RuntimeStyleActivity extends AppCompatActivity {
case R.id.action_bring_water_to_front:
bringWaterToFront();
return true;
case R.id.action_fill_filter_color:
styleFillColorLayer();
return true;
default:
return super.onOptionsItemSelected(item);
}
@@ -532,6 +534,11 @@ public class RuntimeStyleActivity extends AppCompatActivity {
mapboxMap.getStyle().addLayer(lineLayer);
}
private void styleFillColorLayer() {
mapboxMap.setStyle(new Style.Builder().fromUri("asset://fill_color_style.json"));
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(31, -100), 3));
}
private void styleFillFilterLayer() {
mapboxMap.setStyle(new Style.Builder().fromUri("asset://fill_filter_style.json"));
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(31, -100), 3));