Package org.geotools.map

Examples of org.geotools.map.MapContent$LayerList


        mapPane.reset();
    }
   
    @Test
    public void moveImageIgnoredWhenPaneNotVisible() {
        MapContent mapContent = createMapContent(WORLD);
        mapPane.setMapContent(mapContent);
       
        listener.setExpected(MapPaneEvent.Type.DISPLAY_AREA_CHANGED);
        mapPane.moveImage(100, 0);
       
View Full Code Here


    }

    @Before
    public void setup() {
        layer = new GridReaderLayer(reader, null);
        mapContent = new MapContent();
        mapContent.addLayer(layer);
       
        helper = new GridReaderLayerHelper();
        helper.setMapContent(mapContent);
        helper.setLayer(layer);
View Full Code Here

    }
   
    @Test
    public void getInfoOutsideLayerBoundsReturnsEmptyResult() throws Exception {
        Layer layer = TestDataUtils.getPointLayer();
        MapContent mapContent = new MapContent();
        mapContent.addLayer(layer);

        helper.setMapContent(mapContent);
        helper.setLayer(layer);
       
        ReferencedEnvelope bounds = layer.getBounds();
View Full Code Here

        assertNotNull(info);
        assertEquals(0, info.getNumFeatures());
    }
   
    private void doGetInfoTest(Layer layer, int maxFeatures) throws Exception {
        MapContent mapContent = new MapContent();
        mapContent.addLayer(layer);

        helper.setMapContent(mapContent);
        helper.setLayer(layer);

        SimpleFeatureIterator iter =
                ((SimpleFeatureSource)layer.getFeatureSource()).getFeatures().features();
        try {
            int n = 0;
            while (iter.hasNext() && n < maxFeatures) {
                SimpleFeature feature = iter.next();
                assertGetInfo(feature);
                n++ ;
            }

        } finally {
            iter.close();
            mapContent.dispose();
        }
    }
View Full Code Here

        });
    }
   
    @Test
    public void createItemWhenMapContentHasBeenSet() {
        MapContent mapContent = new MapContent();
        mapPane.setMapContent(mapContent);
        createItemInEDT();
    }
View Full Code Here

            @Override
            protected JFrame executeInEDT() throws Throwable {
                JFrame frame = new JFrame();
                frame.setLayout(new BorderLayout());
                mapContent = new MapContent();
                mapContent.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);
                mapPane = new MockMapPane();
                mapPane.setMapContent(mapContent);
                item = new JCRSStatusBarItem(mapPane);
                frame.add(item, BorderLayout.CENTER);
View Full Code Here

    }

    @Before
    public void setup() {
        layer = new GridCoverageLayer(coverage, null);
        mapContent = new MapContent();
        mapContent.addLayer(layer);
       
        helper = new GridCoverageLayerHelper();
        helper.setMapContent(mapContent);
        helper.setLayer(layer);
View Full Code Here

     * @return the transform or {@code null} if the layer's CRS is the same
     *     as that of the map content, or if either has no CRS defined
     */
    protected MathTransform getContentToLayerTransform() {
        if (transform == null && !transformFailed) {
            MapContent content = getMapContent();
            Layer layer = getLayer();

            if (content != null && layer != null) {
                CoordinateReferenceSystem contentCRS = content.getCoordinateReferenceSystem();
                CoordinateReferenceSystem layerCRS =
                        layer.getFeatureSource().getSchema().getCoordinateReferenceSystem();

                if (contentCRS != null && layerCRS != null) {
                    if (CRS.equalsIgnoreMetadata(contentCRS, layerCRS)) {
View Full Code Here

            // the temporary MapContents created below from changing it
            MapViewport vp = new MapViewport(mapContent.getViewport());
            vp.setEditable(false);
           
            for (RenderingOperands op : operands) {
                MapContent mc = new SingleLayerMapContent(op.getLayer());
                mc.setViewport(vp);
                op.getRenderer().setMapContent(mc);
                RenderingTask task = new RenderingTask(mapContent, op.getGraphics(), op.getRenderer());
                Future<Boolean> future = taskExecutor.submit(task);
                currentTasks.add( new TaskInfo(id, task, mc, future, listener) );
            }
View Full Code Here

    public void onMouseClicked(MapMouseEvent ev) {
        DirectPosition2D pos = ev.getWorldPos();
        createReporter();
        report(pos);

        MapContent content = getMapPane().getMapContent();
        final int nlayers = content.layers().size();
        int n = 0;
        for (Layer layer : content.layers()) {
            if (layer.isSelected()) {
                InfoToolHelper helper = null;

                String layerName = layer.getTitle();
                if (layerName == null || layerName.length() == 0) {
View Full Code Here

TOP

Related Classes of org.geotools.map.MapContent$LayerList

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.