private LayerGroupInfo buildGroup(String name, PublishedInfo... publisheds) { LayerGroupInfoImpl group = (LayerGroupInfoImpl) getCatalog().getFactory().createLayerGroup(); group.setId(name); group.setName(name); group.getLayers().addAll(Arrays.asList(publisheds)); return group; }
public static LayerGroupInfoImpl mockGroup(String name, LayerInfo... layers) { LayerGroupInfoImpl lg = new LayerGroupInfoImpl(); lg.setId("id-" + name); lg.setName(name); lg.setLayers(Lists.newArrayList(layers)); lg.setBounds(new ReferencedEnvelope(-180, -90, 180, 90, DefaultGeographicCRS.WGS84)); return lg; }
private void addLayerGroup(String id, String name, PublishedInfo... publisheds) { LayerGroupInfoImpl group = (LayerGroupInfoImpl) getCatalog().getFactory().createLayerGroup(); group.setId(id); group.setName(name); group.setTitle(name); group.getLayers().addAll(Arrays.asList(publisheds)); getCatalog().add(group); }
styles.add(catalog.getLayerByName("DividedRoutes").getDefaultStyle()); LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setName("layer_group"); layerGroup.setLayers(layers); layerGroup.setStyles(styles);
styles.add(catalog.getLayerByName("DividedRoutes").getDefaultStyle()); LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setName("layer_group"); layerGroup.setLayers(layers); layerGroup.setStyles(styles);
private void createTetLayerGroup() { Catalog catalog = getCatalog(); // preparing the list of layers LayerInfo roads = catalog.getLayerByName(new NameImpl(MockData.ROAD_SEGMENTS)); LayerInfo bridges = catalog.getLayerByName(new NameImpl(MockData.BRIDGES)); List<PublishedInfo> layers = Arrays.asList(roads, bridges); // creating the layer group LayerGroupInfoImpl layerGroup = new LayerGroupInfoImpl(); layerGroup.setId(TEST_LAYER_GROUP_NAME); layerGroup.setName(TEST_LAYER_GROUP_NAME); layerGroup.setLayers(layers); // adding a style, jms catalog handler expect the layer group to have styles layerGroup.setStyles(Arrays.asList(roads.getDefaultStyle(), bridges.getDefaultStyle())); // save the layer group catalog.add(layerGroup); } }
final String layerGroupId = "mock-layergroup-id"; layerGroup.setId(layerGroupId); layerGroup.setName("MockLayerGroup"); layerGroup.setLayers(Collections.singletonList((LayerInfo) layerInfo));