Examples of GetMapRequest


Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        raw.put("height", "300");
        raw.put("width", "300");
        raw.put("remote_ows_type", "WFS");
        raw.put("remote_ows_url", RemoteOWSTestSupport.WFS_SERVER_URL);

        GetMapRequest request = (GetMapRequest) reader.createRequest();
        try {
            request = (GetMapRequest) reader.read(request, parseKvp(raw), raw);
            fail("This should have thrown an exception because of the missing style");
        } catch(WmsException e) {
            assertEquals("NoDefaultStyle", e.getCode());
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        raw.put("height", "300");
        raw.put("width", "300");
        raw.put("remote_ows_type", "WFS");
        raw.put("remote_ows_url", "http://phantom.openplans.org:8080/crapserver/wfs?");

        GetMapRequest request = (GetMapRequest) reader.createRequest();
        try {
            request = (GetMapRequest) reader.read(request, parseKvp(raw), raw);
            fail("This should have thrown an exception because of the non existent layer");
        } catch(WmsException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        final URL url = GetMapKvpRequestReader.class.getResource("BaseMapGroup.sld");
        // URLDecoder.decode fixes GEOS-3709
        kvp.put("sld", URLDecoder.decode(url.toString(), "UTF-8"));
        kvp.put("version", "1.1.1");

        GetMapRequest request = (GetMapRequest) reader.createRequest();
        request = (GetMapRequest) reader.read(request, parseKvp(kvp), kvp);
       
        assertEquals(1, request.getLayers().length);
        assertEquals(1, request.getStyles().size());
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), request.getLayers()[0].getName());
        Style expectedStyle = getCatalog().getStyleByName("polygon").getStyle();
        assertEquals(expectedStyle, request.getStyles().get(0));
    }
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

    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());
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        doTestRasterPlacemark(true);
        doTestRasterPlacemark(false);
    }

    protected void doTestRasterPlacemark(boolean doPlacemarks) throws Exception {
        GetMapRequest getMapRequest = createGetMapRequest(MockData.BASIC_POLYGONS);
        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);
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

    public OWS5MapProducer(String mapFormat, String mime_type) {
        super(mapFormat, mime_type);
    }
   
    public void produceMap() throws WmsException {
        final GetMapRequest request = mapContext.getRequest();
       
        // check module related parameters (extended data off by default, style on by default)
        String extendedDataParam = (String) request.getFormatOptions().get("extendedData");
        boolean extendedData = extendedDataParam != null && "true".equals(extendedDataParam.toLowerCase());
        String styleParam = (String) request.getFormatOptions().get("style");
        boolean style = styleParam == null || "true".equals(styleParam.toLowerCase());
       
        transformer = new OWS5Transformer(extendedData, style);
        transformer.setIndentation(3);
    }
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        // 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);
       
        mapLayer = new DefaultMapLayer(featureSource, mockData.getDefaultStyle().getStyle());

        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

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

                .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

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        Style style = mockData.getDefaultStyle().getStyle();
        MapLayer mapLayer = new DefaultMapLayer(features, style);
        mapLayer.setTitle("TestPointsTitle");

        WMSMapContext mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        request.setLayers(new MapLayerInfo[] { layer });

        request.setMaxFeatures(2);
        request.setStartIndex(2);
        request.setFormatOptions(Collections.singletonMap("relLinks", "true"));
        MockHttpServletRequest httpreq = (MockHttpServletRequest) request.getHttpServletRequest();
        httpreq.setRequestURL("baseurl");
        mapContext.setRequest(request);

        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);
        transformer.setStandAlone(false);
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetMapRequest

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("setting up " + paintArea.width + "x" + paintArea.height + " image");
        }

        // extra antialias setting
        final GetMapRequest request = mapContext.getRequest();
        String antialias = (String) request.getFormatOptions().get("antialias");
        if (antialias != null)
            antialias = antialias.toUpperCase();

        // figure out a palette for buffered image creation
        IndexColorModel palette = null;
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.