Package org.geomajas.layer.wms

Examples of org.geomajas.layer.wms.WmsLayer


  @RequestMapping(value = "/wms/**", method = RequestMethod.GET)
  public void getWms(HttpServletRequest request, HttpServletResponse response) throws Exception {

    // Search for the WMS layer:
    String layerId = parseLayerId(request);
    WmsLayer layer = getLayer(layerId);
    if (layer == null) {
      throw new LayerException(ExceptionCode.LAYER_NOT_FOUND, layerId);
    }
    RasterLayerInfo layerInfo = layer.getLayerInfo();

    String url = layer.getBaseWmsUrl() + "?" + request.getQueryString();
    InputStream stream = null;

    try {
      response.setContentType(layer.getFormat());
      stream = httpService.getStream(url, layer.getAuthentication());
      ServletOutputStream out = response.getOutputStream();
      int b;
      while ((b = stream.read()) >= 0 ) {
        out.write(b);
      }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.wms.WmsLayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.