Package org.mapfish.print.attribute.map

Examples of org.mapfish.print.attribute.map.BBoxMapBounds


                    mapValues.getZoomLevels(),
                    mapValues.getZoomSnapTolerance(),
                    mapValues.getZoomLevelSnapStrategy(), paintArea, dpiOfRequestor);
        }

        newBounds = new BBoxMapBounds(newBounds.toReferencedEnvelope(paintArea, dpiOfRequestor));

        if (mapValues.isUseAdjustBounds()) {
            newBounds = newBounds.adjustedEnvelope(paintArea);
        }
        return newBounds;
View Full Code Here


        final GridLayerPlugin plugin = new GridLayerPlugin();
        StyleParser styleParser = new StyleParser();
        plugin.setParser(styleParser);
        final GridLayer layer = plugin.parse(template, layerData);

        MapBounds bounds = new BBoxMapBounds(DefaultEngineeringCRS.GENERIC_2D, 100, 100, 140, 140);
        Dimension mapSize = new Dimension(400, 400);
        double rotation = 0;
        double dpi = 72;
        MapfishMapContext context = new MapfishMapContext(bounds, mapSize, rotation, dpi, Constants.PDF_DPI, null, true);
        final List<? extends Layer> layers = layer.getLayers(null, context, true);
View Full Code Here

        final GridLayerPlugin plugin = new GridLayerPlugin();
        StyleParser styleParser = new StyleParser();
        plugin.setParser(styleParser);
        final GridLayer layer = plugin.parse(template, layerData);

        MapBounds bounds = new BBoxMapBounds(DefaultEngineeringCRS.GENERIC_2D, 110, 90, 150, 132);
        Dimension mapSize = new Dimension(400, 400);
        double rotation = 0;
        double dpi = 72;
        MapfishMapContext context = new MapfishMapContext(bounds, mapSize, rotation, dpi, Constants.PDF_DPI, null, true);
        final List<? extends Layer> layers = layer.getLayers(null, context, true);
View Full Code Here

        assertEquals("converted to radians", Math.toRadians(90.0), transformer.getRotation(), 1e-9);
    }

    @Test
    public void testGetRotatedBounds_BBoxMapBounds() {
        MapBounds bounds = new BBoxMapBounds(DefaultGeographicCRS.WGS84, 5, 45, 25, 55);
       
        // rotate 90 degree
        MapfishMapContext transformer = new MapfishMapContext(bounds, null, 90, Constants.PDF_DPI, Constants.PDF_DPI, null, true);
        MapBounds rotatedBounds = new BBoxMapBounds(DefaultGeographicCRS.WGS84, 10, 40, 20, 60);
        assertEquals(rotatedBounds, transformer.getRotatedBounds());

        // rotate 180 degree
        transformer = new MapfishMapContext(bounds, null, 180, Constants.PDF_DPI, Constants.PDF_DPI, null, true);
        rotatedBounds = new BBoxMapBounds(DefaultGeographicCRS.WGS84, 5, 45, 25, 55);
        assertEquals(rotatedBounds, transformer.getRotatedBounds());

        // rotate 45 degree
        transformer = new MapfishMapContext(bounds, null, 45, Constants.PDF_DPI, Constants.PDF_DPI, null, true);
        ReferencedEnvelope rotatedEnvelope =
                transformer.getRotatedBounds().toReferencedEnvelope(new Rectangle(1, 1), 72);
        assertEquals(4.393398, rotatedEnvelope.getMinX(), 1e-6);
        assertEquals(25.606601, rotatedEnvelope.getMaxX(), 1e-6);
        assertEquals(39.393398, rotatedEnvelope.getMinY(), 1e-6);
        assertEquals(60.606601, rotatedEnvelope.getMaxY(), 1e-6);

        // rotate 45 degree
        bounds = new BBoxMapBounds(DefaultGeographicCRS.WGS84, -0.5, -0.5, 0.5, 0.5);
        transformer = new MapfishMapContext(bounds, null, 45, Constants.PDF_DPI, Constants.PDF_DPI, null, true);
        rotatedEnvelope =
                transformer.getRotatedBounds().toReferencedEnvelope(new Rectangle(1, 1), 72);
        assertEquals(-0.707106, rotatedEnvelope.getMinX(), 1e-6);
        assertEquals(0.707106, rotatedEnvelope.getMaxX(), 1e-6);
View Full Code Here

        assertEquals(141, rotatedMapSize.getHeight(), 1e-6);
    }

    @Test
    public void testGetTransform() {
        MapBounds bounds = new BBoxMapBounds(DefaultGeographicCRS.WGS84, -0.5, -0.5, 0.5, 0.5);
        Dimension mapSize = new Dimension(100, 100);
       
        // no rotation
        MapfishMapContext transformer = new MapfishMapContext(bounds, mapSize, 0, Constants.PDF_DPI, Constants.PDF_DPI, null, true);
        assertNull(transformer.getTransform());
View Full Code Here

    @Autowired
    private TestHttpClientFactory clientHttpRequestFactory;

    @Test
    public void testAttributesFromJson() throws Exception {
        MapfishMapContext mapContext = new MapfishMapContext(new BBoxMapBounds(null, 0,0,10,10), new Dimension(20,20), 0,
                72, Constants.PDF_DPI, null, true);
        configurationFactory.setDoValidation(false);
        final File configFile = getFile(StyleAttributeTest.class, "style_attributes/config.yaml");
        final Configuration config = configurationFactory.getConfig(configFile);
        final Template template = config.getTemplate("main");
View Full Code Here

TOP

Related Classes of org.mapfish.print.attribute.map.BBoxMapBounds

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.