use of com.baremaps.model.MbStyleSources in project baremaps by baremaps.
the class Init method call.
@Override
public Integer call() throws BlobStoreException, IOException {
BlobStore blobStore = options.blobStore();
ObjectMapper mapper = defaultObjectMapper();
if (style != null) {
MbStyle styleObject = new MbStyle();
styleObject.setName("Baremaps");
MbStyleSources sources = new MbStyleSources();
sources.setType("vector");
sources.setUrl("http://localhost:9000/tiles.json");
styleObject.setSources(Map.of("baremaps", sources));
blobStore.put(style, Blob.builder().withByteArray(mapper.writerWithDefaultPrettyPrinter().writeValueAsBytes(styleObject)).build());
logger.info("Style initialized: {}", style);
}
if (tileset != null) {
TileJSON tilesetObject = new TileJSON();
tilesetObject.setTilejson("2.2.0");
tilesetObject.setName("Baremaps");
tilesetObject.setTiles(Arrays.asList("http://localhost:9000/tiles.json"));
blobStore.put(tileset, Blob.builder().withByteArray(mapper.writerWithDefaultPrettyPrinter().writeValueAsBytes(tilesetObject)).build());
logger.info("Tileset initialized: {}", tileset);
}
return 0;
}
Aggregations