mapnik
Class MapDefinition

java.lang.Object
  extended by mapnik.NativeObject
      extended by mapnik.MapDefinition

public class MapDefinition
extends NativeObject

Wrapper around the mapnik::Map object.

Several methods that are found elsewhere in the C++ code but operate exlusively on maps are located directly on this class:

Not all child objects are implemented.

Note that the following child objects are value types. When they are added to or read from a MapDefinition, the caller will be left with a copy.

Author:
stella

Constructor Summary
MapDefinition()
           
MapDefinition(int width, int height, java.lang.String srs)
           
MapDefinition(MapDefinition other)
           
 
Method Summary
 void addLayer(Layer layer)
           
 void addStyle(java.lang.String name, FeatureTypeStyle style)
           
 Color getBackground()
           
 java.lang.String getBackgroundImage()
           
 java.lang.String getBasePath()
           
 Box2d getBufferedExtent()
           
 int getBufferSize()
           
 Box2d getCurrentExtent()
           
 int getHeight()
           
 Layer getLayer(int index)
           
 int getLayerCount()
           
 Box2d getMaximumExtent()
           
 double getScale()
           
 double getScaleDenominator()
           
 java.lang.String getSrs()
           
 FeatureTypeStyle getStyle(java.lang.String name)
           
 java.util.Collection<java.lang.String> getStyleNames()
           
 int getWidth()
           
 void loadMap(java.lang.String filename, boolean strict)
           
 void loadMapString(java.lang.String str, boolean strict, java.lang.String basePath)
           
 void pan(int x, int y)
           
 void panAndZoom(int x, int y, double zoom)
           
 void removeAllLayers()
           
 void removeLayer(int index)
           
 void removeStyle(java.lang.String name)
           
 void resize(int widht, int height)
           
 void saveMap(java.lang.String fileName)
           
 void saveMap(java.lang.String fileName, boolean explicitDefaults)
           
 java.lang.String saveMapToString()
           
 java.lang.String saveMapToString(boolean explicitDefaults)
           
 void setBackground(Color color)
           
 void setBackgroundImage(java.lang.String filename)
           
 void setBasePath(java.lang.String basePath)
           
 void setBufferSize(int bufferSize)
           
 void setHeight(int height)
           
 void setLayer(int index, Layer layer)
           
 void setMaximumExtent(Box2d extent)
           
 void setSrs(java.lang.String srs)
           
 void setWidth(int width)
           
 void zoom(double factor)
           
 void zoomAll()
           
 void zoomToBox(Box2d box)
           
 
Methods inherited from class mapnik.NativeObject
dispose, isDisposed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapDefinition

public MapDefinition()

MapDefinition

public MapDefinition(int width,
                     int height,
                     java.lang.String srs)

MapDefinition

public MapDefinition(MapDefinition other)
Method Detail

loadMap

public void loadMap(java.lang.String filename,
                    boolean strict)

loadMapString

public void loadMapString(java.lang.String str,
                          boolean strict,
                          java.lang.String basePath)

getWidth

public int getWidth()

getHeight

public int getHeight()

setWidth

public void setWidth(int width)

setHeight

public void setHeight(int height)

resize

public void resize(int widht,
                   int height)

getSrs

public java.lang.String getSrs()

setSrs

public void setSrs(java.lang.String srs)

setBufferSize

public void setBufferSize(int bufferSize)

getBufferSize

public int getBufferSize()

getBasePath

public java.lang.String getBasePath()

setBasePath

public void setBasePath(java.lang.String basePath)

getLayerCount

public int getLayerCount()

getLayer

public Layer getLayer(int index)

setLayer

public void setLayer(int index,
                     Layer layer)

removeLayer

public void removeLayer(int index)

removeAllLayers

public void removeAllLayers()

addLayer

public void addLayer(Layer layer)

getStyleNames

public java.util.Collection<java.lang.String> getStyleNames()

getStyle

public FeatureTypeStyle getStyle(java.lang.String name)

addStyle

public void addStyle(java.lang.String name,
                     FeatureTypeStyle style)

removeStyle

public void removeStyle(java.lang.String name)

getMaximumExtent

public Box2d getMaximumExtent()

setMaximumExtent

public void setMaximumExtent(Box2d extent)

getCurrentExtent

public Box2d getCurrentExtent()

getBufferedExtent

public Box2d getBufferedExtent()

zoom

public void zoom(double factor)

zoomToBox

public void zoomToBox(Box2d box)

zoomAll

public void zoomAll()

pan

public void pan(int x,
                int y)

panAndZoom

public void panAndZoom(int x,
                       int y,
                       double zoom)

getScale

public double getScale()

getScaleDenominator

public double getScaleDenominator()

getBackground

public Color getBackground()

setBackground

public void setBackground(Color color)

getBackgroundImage

public java.lang.String getBackgroundImage()

setBackgroundImage

public void setBackgroundImage(java.lang.String filename)

saveMap

public void saveMap(java.lang.String fileName,
                    boolean explicitDefaults)

saveMapToString

public java.lang.String saveMapToString(boolean explicitDefaults)

saveMap

public void saveMap(java.lang.String fileName)

saveMapToString

public java.lang.String saveMapToString()