Package org.geotools.map

Examples of org.geotools.map.FeatureLayer


                env.getMaxY() + shift);

        WMSMapContent map = new WMSMapContent();
        GetMapRequest request = new GetMapRequest();
        map.setRequest(request);
        map.addLayer(new FeatureLayer(fSource, style));
        map.getViewport().setBounds(new ReferencedEnvelope(env, DefaultGeographicCRS.WGS84));
        map.setMapWidth(w);
        map.setMapHeight(h);
        map.setBgColor(BG_COLOR);
        map.setTransparent(false);
View Full Code Here


                // return delegate.getFeatures(query);
            }
        };

        StyleInfo someStyle = getCatalog().getStyleByName("line");
        map.addLayer(new FeatureLayer(source, someStyle.getStyle()));
        request.setFormat(getMapFormat());
        RenderedImageMap imageMap = this.rasterMapProducer.produceMap(map);
        BufferedImage image = (BufferedImage) imageMap.getImage();
        imageMap.dispose();
View Full Code Here

    @Test
    public void testAddLayer() throws Exception {
        FeatureTypeInfo ft = getCatalog().getFeatureTypeByName(getLayerId(MockData.BRIDGES));
        FeatureSource<? extends FeatureType, ? extends Feature> fs = ft.getFeatureSource(null, null);
        Style style = getCatalog().getStyleByName("point").getStyle();
        final FeatureLayer layer = new FeatureLayer(fs, style);
        layer.setTitle("extra");
        TestCallback callback = new TestCallback() {
            @Override
            public WMSMapContent beforeRender(WMSMapContent mapContent) {
                mapContent.addLayer(layer);
                return super.beforeRender(mapContent);
View Full Code Here

    public void testFilter() throws Exception {
        // Set up a map context with a filtered layer
        WMSMapContent map = new WMSMapContent(createGetMapRequest(MockData.BUILDINGS));
        Document document;
        try {
            FeatureLayer layer = (FeatureLayer) createMapLayer(MockData.BUILDINGS);
            Filter f = ff.equals(ff.property("ADDRESS"), ff.literal("215 Main Street"));
            layer.setQuery(new Query(MockData.BUILDINGS.getLocalPart(), f));
            map.addLayer(layer);

            document = getRSSResponse(map, AtomGeoRSSTransformer.GeometryEncoding.LATLONG);
        } finally {
            map.dispose();
View Full Code Here

        map.setTransparent(false);
        map.setRequest(request);
   
        StyleInfo styleByName = catalog.getStyleByName("Default");
        Style basicStyle = styleByName.getStyle();
        FeatureLayer layer = new FeatureLayer(fs, basicStyle);
        layer.setTitle("Title");
        map.addLayer(layer);
        request.setFormat("application/openlayers");
        RawMap rawMap = this.mapProducer.produceMap(map);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        rawMap.writeTo(bos);
View Full Code Here

        Layer layer = null;
        if (info != null) {
            FeatureSource<? extends FeatureType, ? extends Feature> featureSource;
            featureSource = info.getFeatureSource(null, null);

            layer = new FeatureLayer(featureSource, style);
        }
        else {
            //try a coverage
            CoverageInfo cinfo =
                catalog.getCoverageByName(layerName.getNamespaceURI(), layerName.getLocalPart());
View Full Code Here

        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);

        Style basicStyle = getCatalog().getStyleByName("Default").getStyle();
        map.addLayer(new FeatureLayer(fs, basicStyle));

        SVGStreamingMapOutputFormat producer = new SVGStreamingMapOutputFormat();
        StreamingSVGMap encodeSVG = producer.produceMap(map);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        encodeSVG.encode(out);
View Full Code Here

        request.setBaseUrl("http://geoserver.org:8181/geoserver");

        mapContent = new WMSMapContent(request);
        FeatureSource source = layer.getFeatureSource(true);
        Style layerStyle = mockData.getDefaultStyle().getStyle();
        Layer Layer = new FeatureLayer(source, layerStyle);
        mapContent.addLayer(Layer);
    }
View Full Code Here

        request.setLayers(Collections.singletonList(layer));

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

        httpreq.setScheme("http");
        httpreq.setServerName("geoserver.org");
        httpreq.setServerPort(8181);
        httpreq.setContextPath("/geoserver");
View Full Code Here

        b.add(wkt.read("LINESTRING(0 0, 1 1)"));
        b.add("one");
        features2.add(b.buildFeature("fid.1"));
       
        WMSMapContent context = new WMSMapContent();
        context.addLayer(new FeatureLayer(DataUtilities.source(features1), null));
        context.addLayer(new FeatureLayer(DataUtilities.source(features2), null));
        context.setMapWidth(500);
        context.setMapHeight(500);
        context.getViewport().setBounds(new ReferencedEnvelope(-180, 180, -90, 90, DefaultGeographicCRS.WGS84));
       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.geotools.map.FeatureLayer

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.