[android] - load style without url or json

This commit is contained in:
tobrun
2019-05-23 18:52:33 +02:00
committed by Tobrun
parent 04309e01ce
commit 9cf1746e35
9 changed files with 103 additions and 7 deletions

View File

@@ -837,7 +837,7 @@ public final class MapboxMap {
nativeMapView.setStyleJson(builder.getJson());
} else {
// user didn't provide a `from` component, load a blank style instead
nativeMapView.setStyleJson("{}");
nativeMapView.setStyleJson(Style.EMPTY_JSON);
}
}

View File

@@ -37,6 +37,8 @@ import java.util.Map;
@SuppressWarnings("unchecked")
public class Style {
static final String EMPTY_JSON = "{\"version\": 8,\"sources\": {},\"layers\": []}";
private final NativeMap nativeMap;
private final HashMap<String, Source> sources = new HashMap<>();
private final HashMap<String, Layer> layers = new HashMap<>();