Package org.mapfish.print.wrapper.json

Examples of org.mapfish.print.wrapper.json.PJsonArray


        mapAttribute.setMaxDpi(600.0);
        MapAttributeValues mapParams = mapAttribute.createValue(null);
        mapParams.dpi = 72;
        mapParams.center = new double[]{-8235878.4938425, 4979784.7605681};
        mapParams.scale = 26000.0;
        mapParams.layers = new PJsonArray(null, new JSONArray(), "");
        mapParams.postConstruct();

        ScalebarAttribute scalebarAttibute = new ScalebarAttribute();
        scalebarAttibute.setWidth(300);
        scalebarAttibute.setHeight(40);
View Full Code Here


        final String contentAsString = servletResponse.getContentAsString();
        assertFalse(contentAsString.contains("\n"));
        final PJsonObject getInfoJson = parseJSONObjectFromString(contentAsString);

        assertTrue(getInfoJson.has("layouts"));
        final PJsonArray layouts = getInfoJson.getJSONArray("layouts");
        assertEquals(2, layouts.size());
        final PObject mainLayout = layouts.getObject(0);
        assertEquals("A4 Landscape", mainLayout.getString("name"));
        assertTrue(mainLayout.has("attributes"));
        assertEquals(2, mainLayout.getArray("attributes").size());
        assertEquals("imageMap", mainLayout.getArray("attributes").getObject(1).getString("name"));
        assertTrue(getInfoJson.has("formats"));
        final PJsonArray formats = getInfoJson.getJSONArray("formats");
        assertCapabilitiesFormats(formats);

    }
View Full Code Here

        final String contentAsString = servletResponse.getContentAsString();
        assertTrue(contentAsString.contains("\n"));
        final PJsonObject getInfoJson = parseJSONObjectFromString(contentAsString);

        assertTrue(getInfoJson.has("layouts"));
        final PJsonArray layouts = getInfoJson.getJSONArray("layouts");
        assertEquals(2, layouts.size());
        final PObject mainLayout = layouts.getObject(0);
        assertEquals("A4 Landscape", mainLayout.getString("name"));
        assertTrue(mainLayout.has("attributes"));
        assertEquals(2, mainLayout.getArray("attributes").size());
        assertEquals("imageMap", mainLayout.getArray("attributes").getObject(1).getString("name"));
        assertTrue(getInfoJson.has("formats"));
        final PJsonArray formats = getInfoJson.getJSONArray("formats");
        assertCapabilitiesFormats(formats);
    }
View Full Code Here

        assertEquals(HttpStatus.OK.value(), defaultGetInfoResponse.getStatus());

        final String contentAsString = defaultGetInfoResponse.getContentAsString();
        assertFalse(contentAsString.contains("\n"));
        final PJsonObject defaultGetInfoJson = parseJSONObjectFromString(contentAsString);
        final PJsonArray defaultLayouts = defaultGetInfoJson.getJSONArray("layouts");
        final PObject a4LandscapeLayout = defaultLayouts.getObject(0);
        assertEquals("A4 Landscape", a4LandscapeLayout.getString("name"));

        final MockHttpServletResponse app2GetInfoResponse = new MockHttpServletResponse();
        this.servlet.getCapabilities("app2", false, "", app2GetInfoResponse);
        assertEquals(HttpStatus.OK.value(), app2GetInfoResponse.getStatus());

        final PJsonObject app2GetInfoJson = parseJSONObjectFromString(app2GetInfoResponse.getContentAsString());
        final PJsonArray app2Layouts = app2GetInfoJson.getJSONArray("layouts");
        final PObject mainLayout = app2Layouts.getObject(0);
        assertEquals("main", mainLayout.getString("name"));

        final MockHttpServletResponse noSuchGetInfoResponse = new MockHttpServletResponse();
        this.servlet.getCapabilities("NoSuch", false, "", noSuchGetInfoResponse);
        assertEquals(HttpStatus.NOT_FOUND.value(), noSuchGetInfoResponse.getStatus());
View Full Code Here

    @Test
    public void testExpressionProperties() throws Exception {
        String jsonString = Files.toString(getFile("v2-style-all-properies-as-expressions.json"), Constants.DEFAULT_CHARSET);
        PJsonObject json = MapPrinter.parseSpec(jsonString).getJSONObject("*");

        final PJsonArray symb = json.getJSONArray(MapfishJsonStyleVersion2.JSON_SYMB);
        final PointSymbolizer pointSymbolizer = this.helper.createPointSymbolizer(symb.getJSONObject(0));
        final LineSymbolizer lineSymbolizer = this.helper.createLineSymbolizer(symb.getJSONObject(1));
        final PolygonSymbolizer polygonSymbolizer = this.helper.createPolygonSymbolizer(symb.getJSONObject(2));
        final TextSymbolizer textSymbolizer = this.helper.createTextSymbolizer(symb.getJSONObject(3));

        final Graphic graphic = pointSymbolizer.getGraphic();
        assertEquals("rotation", propertyName(graphic.getRotation()));
        assertEquals("graphicOpacity", propertyName(graphic.getOpacity()));
        assertEquals("pointRadius", propertyName(graphic.getSize()));
View Full Code Here

TOP

Related Classes of org.mapfish.print.wrapper.json.PJsonArray

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.