/** * Constructor which adds a new layer and triggers a {@link LayerListEvent}. * * @param reader a reader with the new layer that will be added * @param style * @throws SchemaException * @throws FactoryRegistryException * @throws TransformException */ public MapLayer(GridCoverage2DReader reader, Style style) { internal = new GridReaderLayer(reader, style); }
public synchronized ReferencedEnvelope getBounds() { WMSCoverageReader wmsReader = getReader(); if (wmsReader != null) { return wmsReader.bounds; } return super.getBounds(); }
@Override public void setLayer(Layer layer) { if (!(layer instanceof GridReaderLayer)) { throw new IllegalArgumentException("layer must be an instance of GridReaderLayer"); } super.setLayer(layer); sourceRef = new WeakReference<GridCoverage2DReader>(((GridReaderLayer) layer).getReader()); }
/** * Render raster symbol. * * @param mapContent the map content * @param style the style */ private void renderRasterSymbol(MapContent mapContent, Style style) { GridReaderLayer gridLayer = new GridReaderLayer(gridCoverage, (org.geotools.styling.Style) style); mapContent.addLayer(gridLayer); mapContent.getViewport().setBounds(gridLayer.getBounds()); if (gridCoverage != null) { mapPane.setDisplayArea(gridCoverage.getOriginalEnvelope()); } }
} else if (layer instanceof GridReaderLayer) { GridReaderLayer gr = (GridReaderLayer) sl; sl = new GridReaderLayer(gr.getReader(), copy); } else { LOGGER.log(
@Override public void dispose() { preDispose(); if (reader != null) { try { reader.dispose(); } catch (Exception e) { // eat me } reader = null; } if (style != null) { this.style = null; } if (params != null) { this.params = null; } super.dispose(); }
@Override public void dispose() { this.reader = null; this.style = null; this.params = null; super.dispose(); } }
((GridReaderLayer) layer).getParams(); if (readParams == null || readParams.length == 0) {
List<Layer> layerList = new ArrayList<>(); if (style != null) { rasterLayer = new GridReaderLayer(gridCoverage, style); layerList.add(rasterLayer); viewport = new MapViewport(rasterLayer.getBounds()); } else { if (rasterLayer != null) { ReferencedEnvelope bounds = rasterLayer.getBounds(); renderer.paint(graphics, imageSize, bounds);
@Override public void dispose() { preDispose(); if (reader != null) { try{ reader.dispose(); }catch (Exception e) { // eat me } reader = null; } if( style != null ){ this.style = null; } if( params != null ){ this.params = null; } super.dispose(); }
/** * Constructor which adds a new layer and trigger a {@link LayerListEvent}. * * @param reader a reader with the new layer that will be added. * @param style * @param title * @throws SchemaException * @throws FactoryRegistryException * @throws TransformException */ public MapLayer(GridCoverage2DReader reader, Style style, String title) { internal = new GridReaderLayer(reader, style, title); }
public synchronized ReferencedEnvelope getBounds() { WMTSCoverageReader wmtsReader = getReader(); if (wmtsReader != null) { return wmtsReader.bounds; } return super.getBounds(); }
@Override public void setLayer(Layer layer) { if (!(layer instanceof GridReaderLayer)) { throw new IllegalArgumentException("layer must be an instance of GridReaderLayer"); } super.setLayer(layer); sourceRef = new WeakReference<AbstractGridCoverage2DReader>( ((GridReaderLayer) layer).getReader()); }
/** * Constructor which adds a new layer and trigger a {@link LayerListEvent}. * * @param reader a reader with the new layer that will be added. * @param style * @param title * @param params GeneralParameterValue[] that describe how the {@link * AbstractGridCoverage2DReader} shall read the images * @throws SchemaException * @throws FactoryRegistryException * @throws TransformException */ public MapLayer( GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params) throws TransformException, FactoryRegistryException, SchemaException { internal = new GridReaderLayer(reader, style, title, params); }
public synchronized ReferencedEnvelope getBounds() { WMTSCoverageReader wmtsReader = getReader(); if (wmtsReader != null) { return wmtsReader.bounds; } return super.getBounds(); }
/** * Add a new layer and trigger a {@link LayerListEvent} * * @param gridCoverage an AbstractGridCoverage2DReader with the new layer that will be added. */ public void addLayer(GridCoverage2DReader reader, Style style) { if (style == null) { throw new IllegalArgumentException("style cannot be null"); } Layer layer = new GridReaderLayer(reader, style); layers().add(layer); }
public synchronized ReferencedEnvelope getBounds() { WMSCoverageReader wmsReader = getReader(); if (wmsReader != null) { return wmsReader.bounds; } return super.getBounds(); }
/** * Add a grid coverage data to be supplied by the given reader as a new layer to the end of the * list of layers held by this context. * * <p>If a coordinate reference system has not been set for the context an attempt is made to * retrieve one from the reader and use that as the context's CRS. * * @param reader the grid coverage reader * @param style a Style to be used when rendering the new layer */ public void addLayer(GridCoverage2DReader reader, Style style) { if (style == null) { throw new IllegalArgumentException("Style cannot be null"); } // checkCRS(reader.getCrs()); Layer layer = new GridReaderLayer(reader, style); layers().add(layer); }
/** * Constructor which adds a new layer and trigger a {@link LayerListEvent}. * * @param reader * a reader with the new layer that will be added. * @param style * @param title * * @throws SchemaException * @throws FactoryRegistryException * @throws TransformException */ public MapLayer(AbstractGridCoverage2DReader reader, Style style, String title) { internal = new GridReaderLayer(reader, style, title); }
/** * Constructor which adds a new layer and triggers a {@link LayerListEvent}. * * @param reader * a reader with the new layer that will be added * @param style * * @throws SchemaException * @throws FactoryRegistryException * @throws TransformException */ public MapLayer(AbstractGridCoverage2DReader reader, Style style) { internal = new GridReaderLayer(reader, style); }