Package org.vfny.geoserver.wms

Examples of org.vfny.geoserver.wms.WMSMapContext


        ds.createSchema(type);
        ds.addFeatures(new SimpleFeature[] { f1, f2, f3 });

        FeatureSource fs = ds.getFeatureSource("test");

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(new ReferencedEnvelope(-250, 250, -250, 250, null));
        map.setMapWidth(300);
        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);

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

        SVGMapProducer producer = new SVGMapProducer(SvgMapProducerProxy.MIME_TYPE,
                SvgMapProducerProxy.OUTPUT_FORMATS);
        producer.setMapContext(map);
        producer.produceMap();
View Full Code Here


        Template template = cfg.getTemplate("OpenLayersMapTemplate.ftl");
        assertNotNull(template);

        GetMapRequest request = createGetMapRequest(MockData.BASIC_POLYGONS);
        WMSMapContext mapContext = new WMSMapContext();
        mapContext.addLayer(createMapLayer(MockData.BASIC_POLYGONS));
        mapContext.setRequest(request);
        mapContext.setMapWidth(256);
        mapContext.setMapHeight(256);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        HashMap map = new HashMap();
        map.put("context", mapContext);
        map.put("request", mapContext.getRequest());
        map.put("maxResolution", new Double(0.0005)); // just a random number
        map.put("baseUrl", "http://localhost:8080/geoserver/wms");
        map.put("parameters", new ArrayList());
        map.put("layerName", "layer");
        map.put("units", "degrees");
View Full Code Here

  protected void setUpInternal() throws Exception {
    super.setUpInternal();

    // create a map context
    WMSMapContext mapContext = new WMSMapContext();
    mapContext.addLayer(createMapLayer(MockData.BASIC_POLYGONS));
    mapContext.addLayer(createMapLayer(MockData.BUILDINGS));
    mapContext.setMapHeight(256);
    mapContext.setMapWidth(256);

    GetMapRequest getMapRequest = createGetMapRequest(new QName[] {
        MockData.BASIC_POLYGONS, MockData.BUILDINGS });
    mapContext.setRequest(getMapRequest);

    // create hte map producer
    mapProducer = new KMZMapProducer(getWMS());
    mapProducer.setMapContext(mapContext);
    mapProducer.produceMap();
View Full Code Here

    protected void setUpInternal() throws Exception {
        super.setUpInternal();

        mapLayer = createMapLayer( MockData.BASIC_POLYGONS );
       
        mapContext = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        mapContext.addLayer(mapLayer);
    }
View Full Code Here

   
    @SuppressWarnings("unchecked")
    public void testExternalGraphicBackround() throws Exception {
        // see http://jira.codehaus.org/browse/GEOS-1947
        MapLayer mapLayer = createMapLayer( MockData.POINTS,  "Bridge");
        WMSMapContext mapContext = new WMSMapContext(createGetMapRequest(MockData.POINTS));
        mapContext.addLayer(mapLayer);
        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);
        transformer.setIndentation(2);

        FeatureSource <SimpleFeatureType, SimpleFeature> featureSource;
        featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) mapLayer.getFeatureSource();
View Full Code Here

   
    @SuppressWarnings("unchecked")
    public void testFilteredData() throws Exception {
        MapLayer mapLayer = createMapLayer( MockData.BASIC_POLYGONS,  "SingleFeature");
       
        WMSMapContext mapContext = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        mapContext.addLayer(mapLayer);
       
        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);
        transformer.setIndentation(2);

        FeatureSource <SimpleFeatureType, SimpleFeature> featureSource;
View Full Code Here

        HashMap formatOptions = new HashMap();
        formatOptions.put("kmplacemark", new Boolean(doPlacemarks));
        formatOptions.put("kmscore", new Integer(0));
        getMapRequest.setFormatOptions(formatOptions);

        WMSMapContext mapContext = new WMSMapContext(getMapRequest);
        mapContext.addLayer(mapLayer);
        mapContext.setMapHeight(1024);
        mapContext.setMapWidth(1024);

        // create the map producer
        KMZMapProducer mapProducer = new KMZMapProducer(getWMS());
        mapProducer.setMapContext(mapContext);
        mapProducer.produceMap();
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);
        WMSMapContext mapContext = new WMSMapContext();
        request = mockData.createRequest();
        request.setLayers(new MapLayerInfo[] { layer });

        request.setFormatOptions(Collections.singletonMap("relLinks", "true"));
        MockHttpServletRequest httpreq = (MockHttpServletRequest) request.getHttpServletRequest();
        httpreq.setScheme("http");
        httpreq.setServerName("geoserver.org");
        httpreq.setServerPort(8181);
        httpreq.setContextPath("/geoserver");
        mapContext.setRequest(request);
    }
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(new MapLayerInfo[] { layer });

        FeatureSource<SimpleFeatureType, SimpleFeature> featureSource;
        featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) ((FeatureTypeInfo)layer.getFeature()).getFeatureSource(null, null);
View Full Code Here

        FeatureCollection<SimpleFeatureType, SimpleFeature> features = FeatureCollections
                .newCollection();
        Style style = mockData.getDefaultStyle().getStyle();
        MapLayer mapLayer = new DefaultMapLayer(features, style);

        WMSMapContext mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        mapContext.setRequest(request);

        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);

        Document document;
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wms.WMSMapContext

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.