class Map extends java.lang.Object
The GeoScript Map for rendering Layers.
import geoscript.render.* import geoscript.layer.* import geoscript.style.* Map map = new Map(layers:[new Shapefile("states.shp")]) map.renderToImage()
Modifiers | Name | Description |
---|---|---|
protected MapContent |
content |
The GeoTools MapContent |
protected GTRenderer |
renderer |
The GeoTools Renderer |
Type | Name and description |
---|---|
java.lang.String |
backgroundColor The background color (if any) |
Bounds |
bounds |
boolean |
fixAspectRatio A flag to fix the aspect ration (true) or not (false) |
int |
height The height of the Map |
java.util.List |
layers The List of Layers |
java.lang.Object |
proj |
java.lang.String |
type The output type (png, jpg, pdf, svg, base64) |
int |
width The width of the Map |
Constructor and description |
---|
Map
() Create a new Map |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addLayer(Layer layer) Add a Layer |
|
void |
addLayer(Renderable renderable) Add a Renderable Map Layer |
|
void |
addRaster(Raster raster) Add a Raster |
|
void |
addTileLayer(TileLayer layer) Add a TileLayer |
|
void |
close() Closes the Map by disposing of any resources. |
|
void |
display() Display the Map in an interactive GUI |
|
Bounds |
getBounds() Get the Bounds |
|
Projection |
getProj() Get the Map's Projection |
|
double |
getScaleDenominator() Get the scale denominator |
|
void |
render(java.lang.String fileName) Render the Map at a Bounds to a file name |
|
void |
render(java.io.File file) Render the Map at a Bounds to a File |
|
void |
render(java.io.OutputStream out) Render the Map at a Bounds to an OutputStream |
|
void |
render(java.awt.Graphics2D g) Render the Map directly to a Graphics2D context |
|
java.awt.image.BufferedImage |
renderToImage() Render the Map to a BufferedImage for the given Bounds |
|
Map |
setAdvancedProjectionHandling(boolean value) Set whether to use advanced projection handling or not. |
|
void |
setBackgroundColor(java.lang.Object color) Set the background color |
|
void |
setBounds(Bounds bounds) Set the Bounds |
|
Map |
setContinuousMapWrapping(boolean value) Set whether to enable continuous map wrapping or not. |
|
void |
setProj(java.lang.Object projection) Set the Map Projection |
|
Map |
setScaleComputation(java.lang.String type) Set the scale computation algorithm (accurate or ogc). |
|
protected void |
setUpRendering() Set up for rendering (add layers, configure bounds and projection) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The GeoTools MapContent
The GeoTools Renderer
The background color (if any)
A flag to fix the aspect ration (true) or not (false)
The height of the Map
The List of Layers
The output type (png, jpg, pdf, svg, base64)
The width of the Map
Add a Layer
layer
- The LayerAdd a Renderable Map Layer
renderable
- The Renderable Map LayerAdd a Raster
raster
- The RasterAdd a TileLayer
layer
- The TileLayerCloses the Map by disposing of any resources.
Display the Map in an interactive GUI
Get the Bounds
Get the Map's Projection
Get the scale denominator
The
- scale denminatorRender the Map at a Bounds to a file name
bounds
- The BoundsfileName
- The file nameRender the Map at a Bounds to a File
bounds
- The Boundsfile
- The FileRender the Map at a Bounds to an OutputStream
out
- The OutputStreamRender the Map directly to a Graphics2D context
g
- The Graphics2D contextRender the Map to a BufferedImage for the given Bounds
Set whether to use advanced projection handling or not. The default is true.
value
- Whether to use advanced projection handling or not.Set the background color
color
- The background color (#ffffff, red)Set the Bounds
bounds
- The BoundsSet whether to enable continuous map wrapping or not. The default is true.
value
- Whether to enable continuous map wrapping ot notSet the Map Projection
proj
- The ProjectionSet the scale computation algorithm (accurate or ogc). Accurate the default.
type
- The scale computation algorithm (accurate or ogc).Set up for rendering (add layers, configure bounds and projection)
Groovy Documentation