[android] - load style without url or json
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
Reference in New Issue
Block a user