@Override public void visit(StyledLayerDescriptor sld) { try { super.visit(sld); request.setLayers(layers); request.setStyles(styles); // Convert various more specific exceptions into service exceptions } catch (IllegalStateException | UncheckedIOException | UnsupportedOperationException e) { throw new ServiceException(e); } }
public static GetMapRequest autoSetMissingProperties(GetMapRequest getMap) { // set the defaults if (getMap.getFormat() == null) { getMap.setFormat(FORMAT); } if ((getMap.getStyles() == null) || getMap.getStyles().isEmpty()) { // set styles to be the defaults for the specified layers // TODO: should this be part of core WMS logic? is so lets throw // this // into the GetMapKvpRequestReader if ((getMap.getLayers() != null) && (getMap.getLayers().size() > 0)) { ArrayList<Style> styles = new ArrayList<Style>(getMap.getLayers().size()); for (int i = 0; i < getMap.getLayers().size(); i++) { styles.add(getMap.getLayers().get(i).getDefaultStyle()); } getMap.setStyles(styles); } else { getMap.setStyles(STYLES); } } // auto-magic missing info configuration autoSetBoundsAndSize(getMap); return getMap; }
getMap.setStyles(Arrays.asList(style));
@Test public void testExecuteNoStyles() { request.setStyles(null); assertInvalidMandatoryParam("StyleNotDefined"); }
request.setStyles(styles);
request.setStyles(styles); request.setBbox(new Envelope(-180, -90, 180, 90)); request.setCrs(DefaultGeographicCRS.WGS84);
getMapRequest.setStyles(styles); getMapRequest.setFilter(filters);
public GetMapRequest createRequest() { GetMapRequest request; request = new GetMapRequest(); request.setFormat(DummyRasterMapProducer.MIME_TYPE); request.setWidth(512); request.setHeight(256); Envelope envelope = new Envelope(-180, 180, -90, 90); request.setBbox(envelope); request.setSRS("EPSG:4326"); request.setCrs(DefaultGeographicCRS.WGS84); try { request.setStyles(Collections.singletonList(defaultStyle.getStyle())); } catch (IOException e) { throw new RuntimeException("shouldn't happen", e); } request.setRawKvp(new HashMap<String, String>()); request.setBaseUrl("http://example.geoserver.org/geoserver"); return request; }
request.setStyles(styles); request.setBbox((Envelope) requestEnvelope); request.setCrs(requestEnvelope.getCoordinateReferenceSystem());
request.setStyles(styles); request.setBbox((Envelope) requestEnvelope); request.setCrs(requestEnvelope.getCoordinateReferenceSystem());