Package org.geoserver.wms

Examples of org.geoserver.wms.MapLayerInfo


            throw new ServiceException("SLD document contains no layers");
        }

        final List<MapLayerInfo> layers = new ArrayList<MapLayerInfo>();
        final List<Style> styles = new ArrayList<Style>();
        MapLayerInfo currLayer;

        StyledLayer sl = null;

        for (int i = 0; i < slCount; i++) {
            sl = styledLayers[i];

            String layerName = sl.getName();

            if (null == layerName) {
                throw new ServiceException("A UserLayer without layer name was passed");
            }

            // TODO: add support for remote WFS here
            // handle the InLineFeature stuff
            boolean isBaseMap = false;
            if ((sl instanceof UserLayer)
                    && ((((UserLayer) sl)).getInlineFeatureDatastore() != null)) {
                // SPECIAL CASE - we make the temporary version
                UserLayer ul = ((UserLayer) sl);
                CoordinateReferenceSystem crs = (getMapRequest.getCrs() == null) ? DefaultGeographicCRS.WGS84
                        : getMapRequest.getCrs();
                currLayer = initializeInlineFeatureLayer(ul, crs);
                addStyles(wms, getMapRequest, currLayer, styledLayers[i], layers, styles);
            } else {

                LayerGroupInfo layerGroup = getWMS().getLayerGroupByName(layerName);
               
                if (layerGroup != null) {
                    List<LayerInfo> layerGroupLayers = layerGroup.layers();
                    List<StyleInfo> layerGroupStyles = layerGroup.getStyles();
                    for (int j = 0; j < layerGroupStyles.size(); j++) {
                        StyleInfo si = layerGroupStyles.get(j);
                        LayerInfo layer = layerGroupLayers.get(j);
                        currLayer = new MapLayerInfo(layer);
                        if (si != null){
                            currLayer.setStyle(si.getStyle());
                        }
                        addStyles(wms, getMapRequest, currLayer, styledLayers[i], layers, styles);
                    }                   
                } else {
                    LayerInfo layerInfo = getWMS().getLayerByName(layerName);
                    if (layerInfo == null) {
                        throw new ServiceException("Layer not found: " + layerName);
                    }
                    currLayer = new MapLayerInfo(layerInfo);
                    addStyles(wms, getMapRequest, currLayer, styledLayers[i], layers, styles);
                }
            }

        }
View Full Code Here


            source = reTypedDS.getFeatureSource(reTypedDS.getTypeNames()[0]);
        } else {
            source = inlineDatastore.getFeatureSource(inlineDatastore.getTypeNames()[0]);
        }

        MapLayerInfo mapLayer = new MapLayerInfo(source);
        return mapLayer;
    }
View Full Code Here

        // set the content disposition
        StringBuffer filename = new StringBuffer();
        boolean containsRasterData = false;
        boolean isRegionatingFriendly = true;
        for (int i = 0; i < request.getLayers().size(); i++) {
            MapLayerInfo layer = request.getLayers().get(i);
            String name = layer.getName();

            containsRasterData = containsRasterData
                    || (layer.getType() == MapLayerInfo.TYPE_RASTER);

            if (layer.getType() == MapLayerInfo.TYPE_VECTOR) {
                isRegionatingFriendly = isRegionatingFriendly
                        && layer.getFeature().getFeatureSource(null, null).getQueryCapabilities()
                                .isReliableFIDSupported();
            } else if (layer.getType() == MapLayerInfo.TYPE_REMOTE_VECTOR) {
                isRegionatingFriendly = isRegionatingFriendly
                        && layer.getRemoteFeatureSource().getQueryCapabilities()
                                .isReliableFIDSupported();
            }

            // strip off prefix
            int j = name.indexOf(':');
View Full Code Here

     */
    private List<MapLayerInfo> expandLayers(Catalog catalog) {
        List<MapLayerInfo> layers = new ArrayList<MapLayerInfo>();

        if (layerInfo != null) {
            layers.add(new MapLayerInfo(layerInfo));
        } else {
            for (LayerInfo l : Iterables.filter(groupInfo.getLayers(), LayerInfo.class)) {
                layers.add(new MapLayerInfo(l));
            }
        }
        return layers;
    }
View Full Code Here

        // encode top level region, which is always visible
        addRegion(container, normalizedEnvelope, Integer.MAX_VALUE, -1);

        List<MapLayerInfo> layers = request.getLayers();
        for (int i = 0; i < layers.size(); i++) {
            MapLayerInfo layer = layers.get(i);
            if (cachedMode && isRequestGWCCompatible(request, i, wms)) {
                encodeGWCLink(container, request, layer);
            } else {
                encodeLayerSuperOverlay(container, i, normalizedEnvelope, zoomLevel);
            }
View Full Code Here

        link.setHref(url);
    }

    boolean isVectorLayer(Layer layer) {
        int index = mapContent.layers().indexOf(layer);
        MapLayerInfo info = mapContent.getRequest().getLayers().get(index);
        return (info.getType() == MapLayerInfo.TYPE_VECTOR || info.getType() == MapLayerInfo.TYPE_REMOTE_VECTOR);
    }
View Full Code Here

        final List<Layer> mapLayers = context.layers();
        final List<MapLayerInfo> layerInfos = context.getRequest().getLayers();
        for (int i = 0; i < mapLayers.size(); i++) {
            final Layer Layer = mapLayers.get(i);
            final MapLayerInfo layerInfo = layerInfos.get(i);

            ReferencedEnvelope layerLatLongBbox;
            layerLatLongBbox = computeLayerBounds(Layer, layerInfo, computeQueryBounds);
            try {
                layerLatLongBbox = layerLatLongBbox.transform(
View Full Code Here

        }

        final List<MapLayerInfo> layers = request.getLayers();
        final List<Style> styles = request.getStyles();
        for (int i = 0; i < layers.size(); i++) {
            MapLayerInfo layerInfo = layers.get(i);
            NetworkLink nl = container.createAndAddNetworkLink();
            nl.setName(layerInfo.getName());
            nl.setVisibility(true);
            nl.setOpen(true);

            // look at for this layer
            Envelope requestBox = context.getRequestBoxWGS84();
View Full Code Here

       
        // Map<String, String> namespaces = new HashMap<String, String>();
        // namespaces.put("atom", "http://purl.org/atom/ns#");
        // XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));

        MapLayerInfo layer = mockData.addFeatureTypeLayer("TestPoints", Point.class);
        mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        request.setLayers(Collections.singletonList(layer));

        SimpleFeatureSource featureSource;
        featureSource = (SimpleFeatureSource) ((FeatureTypeInfo)layer.getFeature()).getFeatureSource(null, null);
       
        mapLayer = new DefaultMapLayer(featureSource, mockData.getDefaultStyle().getStyle());

        httpreq.setScheme("http");
        httpreq.setServerName("geoserver.org");
View Full Code Here

     * @throws IOException
     * @see GetMapRequest#getMaxFeatures()
     * @see GetMapRequest#getStartIndex()
     */
    public void testEncodeWithPaging() throws Exception {
        MapLayerInfo layer = mockData.addFeatureTypeLayer("TestPoints", Point.class);
        FeatureTypeInfo typeInfo = layer.getFeature();
        SimpleFeatureType featureType = (SimpleFeatureType) typeInfo.getFeatureType();
        mockData.addFeature(featureType, new Object[] { "name1", "POINT(1 1)" });
        mockData.addFeature(featureType, new Object[] { "name2", "POINT(2 2)" });
        mockData.addFeature(featureType, new Object[] { "name3", "POINT(3 3)" });
        mockData.addFeature(featureType, new Object[] { "name4", "POINT(4 4)" });
View Full Code Here

TOP

Related Classes of org.geoserver.wms.MapLayerInfo

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.