Rework expression conversion (#11490)

* [android] - rework expression conversion
This commit is contained in:
Tobrun
2018-04-10 11:09:42 +02:00
committed by GitHub
parent 351ac83c75
commit 44ce5ab087
26 changed files with 318 additions and 157 deletions

View File

@@ -99,7 +99,7 @@ public class CircleLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -99,7 +99,7 @@ public class FillExtrusionLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -99,7 +99,7 @@ public class FillLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -99,7 +99,7 @@ public class HeatmapLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -3,6 +3,7 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.NonNull;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.mapbox.mapboxsdk.style.expressions.Expression;
/**
@@ -72,7 +73,7 @@ public abstract class Layer {
protected native void nativeSetFilter(Object[] filter);
protected native JsonArray nativeGetFilter();
protected native JsonElement nativeGetFilter();
protected native void nativeSetSourceLayer(String sourceLayer);

View File

@@ -99,7 +99,7 @@ public class LineLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -99,7 +99,7 @@ public class SymbolLayer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}

View File

@@ -119,7 +119,7 @@ public class <%- camelize(type) %>Layer extends Layer {
@Nullable
public Expression getFilter() {
Expression expression = null;
JsonArray array = nativeGetFilter();
JsonArray array = (JsonArray) nativeGetFilter();
if (array != null) {
expression = Expression.Converter.convert(array);
}