Fix raster sources
This commit is contained in:
@@ -1,9 +1,18 @@
|
|||||||
package eu.konggdev.strikemaps.map.source;
|
package eu.konggdev.strikemaps.map.source;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
|
||||||
public class MapSource {
|
public class MapSource {
|
||||||
public String url;
|
public String url;
|
||||||
public String type;
|
public String type;
|
||||||
public String schema;
|
public String schema;
|
||||||
|
|
||||||
|
public String attribution;
|
||||||
|
|
||||||
|
/* For raster sources */
|
||||||
|
public JsonNode tiles;
|
||||||
|
public int minzoom;
|
||||||
|
public int maxzoom;
|
||||||
|
|
||||||
public MapSource() { }
|
public MapSource() { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import eu.konggdev.strikemaps.map.source.MapSource;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class MapStyle {
|
public class MapStyle {
|
||||||
//Only local data
|
//Only local data/
|
||||||
public String name;
|
public String name;
|
||||||
public Bitmap icon;
|
public Bitmap icon;
|
||||||
|
/
|
||||||
public JsonNode metadata; // everything except layers + sources
|
public JsonNode metadata; // everything except layers + sources
|
||||||
public Map<String, MapSource> sources;
|
public Map<String, MapSource> sources;
|
||||||
public JsonNode layerDefinitions; // the "layers" array
|
public JsonNode layerDefinitions; // the "layers" array
|
||||||
@@ -31,10 +31,10 @@ public class MapStyle {
|
|||||||
try {
|
try {
|
||||||
JsonNode root = mapper.readTree(styleContents);
|
JsonNode root = mapper.readTree(styleContents);
|
||||||
|
|
||||||
MapStyle style = new MapStyle();
|
MapStyle style = new MapStyle();
|
||||||
style.name = root.path("name").asText();
|
style.name = root.path("name").asText();
|
||||||
style.icon = getIcon(root.path("icon").asText(), app);
|
style.icon = getIcon(root.path("icon").asText(), app);
|
||||||
|
/
|
||||||
style.sources = mapper.convertValue(
|
style.sources = mapper.convertValue(
|
||||||
root.path("sources"),
|
root.path("sources"),
|
||||||
new TypeReference<Map<String, MapSource>>() {}
|
new TypeReference<Map<String, MapSource>>() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user