Examples of WmsLayer


Examples of chunmap.raster.wms.WmsLayer

  }

  @Override
  protected void addLayer(MapCtrl map) {
    String testRrl="http://localhost:8080/chunmapService/test?";
    Layer layer=new WmsLayer(testRrl);
   
    map.getLayerCollection().add(layer);
  }
View Full Code Here

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

Examples of org.geotools.map.WMSLayer

        }
        MapContent mapcontent = new MapContent();
        mapcontent.setTitle( wms.getCapabilities().getService().getTitle() );
       
        for( Layer wmsLayer : wmsLayers ){
            WMSLayer displayLayer = new WMSLayer(wms, wmsLayer );
            mapcontent.addLayer(displayLayer);
        }
        // Now display the map
        JMapFrame.showMap(mapcontent);
    }
View Full Code Here

Examples of org.geotools.map.WMSLayer

        }

        // the wms layer does request in a CRS that's compatible with the WMS server srs
        // list,
        // we may need to transform
        WMSLayer ml = new WMSLayer(wms, layer);
        // delegate to the web map layer as there's quite a bit of reprojection magic
        // code
        // that we want to be consistently reproduced for GetFeatureInfo as well
        final InputStream is = ml.getFeatureInfo(bbox, width, height, x, y,
                "application/vnd.ogc.gml", maxFeatures);
        List<FeatureCollection> results = new ArrayList<FeatureCollection>();
        try {
            Parser parser = new Parser(new WFSConfiguration());
            parser.setStrict(false);
View Full Code Here

Examples of org.geotools.map.WMSLayer

                // see if we can merge this layer with the previous one
                boolean merged = false;
                if (mapContent.layers().size() > 0) {
                    org.geotools.map.Layer lastLayer = mapContent.layers().get(mapContent.layers().size() - 1);
                    if (lastLayer instanceof WMSLayer) {
                        WMSLayer lastWMS = (WMSLayer) lastLayer;
                        WebMapServer otherWMS = lastWMS.getWebMapServer();
                        if (otherWMS.equals(wms)) {
                            lastWMS.addLayer(gt2Layer);
                            merged = true;
                        }
                    }
                }
                if (!merged) {
                    WMSLayer Layer = new WMSLayer(wms, gt2Layer);
                    Layer.setTitle(wmsLayer.prefixedName());
                    mapContent.addLayer(Layer);
                }
            } else {
                throw new IllegalArgumentException("Unkown layer type " + layerType);
            }
View Full Code Here

Examples of org.geowebcache.layer.wms.WMSLayer

    }
   
    public void handleAddEvent(CatalogAddEvent event) throws CatalogException {
        Object obj = event.getSource();
       
        WMSLayer wmsLayer = null;
       
        // We only handle layers here. Layer groups are initially empty
        if(obj instanceof LayerInfo) {
            LayerInfo layerInfo = (LayerInfo) obj;
            wmsLayer = getLayer(layerInfo);
        }
       
        if (wmsLayer != null && this.list != null) {
            addToList(wmsLayer);
            layerDispatcher.getLayers();
            layerDispatcher.add(wmsLayer);
            log.finer(wmsLayer.getName() + " added to TileLayerDispatcher");
        }
    }
View Full Code Here

Examples of org.geowebcache.layer.wms.WMSLayer

               // Next layer group
           }
          
        } else {

        WMSLayer wmsLayer = null; //getLayer(obj);

        if(obj instanceof LayerInfo) {
            LayerInfo li = (LayerInfo) obj;
            wmsLayer = getLayer(li);
        } else
        if(obj instanceof LayerGroupInfo) {
            LayerGroupInfo lgInfo = (LayerGroupInfo) obj;
            wmsLayer = getLayer(lgInfo);
        }
       
        if (wmsLayer != null && this.list != null) {           
            updateList(wmsLayer);
            layerDispatcher.getLayers();
            layerDispatcher.update(wmsLayer);
            log.finer(wmsLayer.getName() + " updated on TileLayerDispatcher");
            cleanser.deleteLayer(wmsLayer.getName());
        }
        }
    }
View Full Code Here

Examples of org.geowebcache.layer.wms.WMSLayer

                    + lgi.getBounds() + " to EPSG:4326");
           
            return null;
        }
       
        WMSLayer retLayer = new WMSLayer(
                lgi.getName(),
                getWMSUrl(),
                null, // Styles
                lgi.getName(),
                mimeFormats,
                getGrids(lgi.getName(), latLonBounds, bounds, nativeSRSName),
                metaFactors,
                null,
                true);
       
        retLayer.setBackendTimeout(120);
        retLayer.setSourceHelper(new WMSGeoServerHelper(this.gsDispatcher));
       
        retLayer.initialize(gridSetBroker);
        return retLayer;
    }
View Full Code Here

Examples of org.geowebcache.layer.wms.WMSLayer

            nativeEnv = fti.boundingBox();
        } catch (Exception e) {
            e.printStackTrace();
        }
       
        WMSLayer retLayer = new WMSLayer(
                fti.getPrefixedName(),
                getWMSUrl(),
                null, // Styles
                fti.getPrefixedName(),
                mimeFormats,
                getGrids(fti.getPrefixedName(), fti.getLatLonBoundingBox(), nativeEnv, fti.getSRS()),
                metaFactors,
                null,
                true);
        retLayer.setBackendTimeout(120);
        retLayer.setSourceHelper(new WMSGeoServerHelper(this.gsDispatcher));
       
        retLayer.initialize(gridSetBroker);
        return retLayer;
    }
View Full Code Here

Examples of org.geowebcache.layer.wms.WMSLayer

        GridSubset grid = GridSubsetFactory.createGridSubSet(gridSetBroker.WORLD_EPSG4326, new BoundingBox(-30.0,15.0,45.0,30), 0,10);
       
        grids.put(grid.getName(), grid);
        int[] metaWidthHeight = {3,3};
       
        WMSLayer layer = new WMSLayer("test:layer", urls, "aStyle", "test:layer", formatList, grids, null, metaWidthHeight, "vendorparam=true", false);
       
        layer.initialize(gridSetBroker);
       
        return layer;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.