use of com.baremaps.model.StyleSetEntry in project baremaps by baremaps.
the class StylesResource method getStyleSet.
@Override
public Response getStyleSet() {
List<UUID> ids = jdbi.withHandle(handle -> handle.createQuery("select id from styles").mapTo(UUID.class).list());
StyleSet styleSet = new StyleSet();
List<StyleSetEntry> entries = new ArrayList<>();
String address = uriInfo.getRequestUri().toString();
for (UUID id : ids) {
Link link = new Link();
link.setHref(address + id);
link.setType("application/vnd.mapbox.style+json");
link.setRel("stylesheet");
StyleSetEntry entry = new StyleSetEntry();
entry.setId(id);
entry.setLinks(List.of(link));
entries.add(entry);
}
styleSet.setStyles(entries);
return Response.ok(styleSet).build();
}
Aggregations