de.yaina.trackrenderer
Class TrackRender

java.lang.Object
  extended by de.yaina.trackrenderer.TrackRender

public class TrackRender
extends java.lang.Object

The actual renderer. It reads a GPX file and writes the track on a collection of tiles.


Field Summary
 int DEFAULT_COLOUR
           
 int DEFAULT_STYLE
           
 int DEFAULT_TILE_SIZE
           
 
Constructor Summary
TrackRender(java.lang.String tiledir, int zoom)
          Create a new renderer
 
Method Summary
 MapCanvas createCanvas()
          Create the canvas to draw on
 byte getColour()
          Return the colour
 int getStyle()
          Return the point/line style for this map
 int getTileXSize()
          Return the horizontal tile size in pixel
 int getTileYSize()
          Return the vertical tile size in pixel
 void renderMap(java.lang.String gpxfile)
          Render a track from a GPX file
 void setColour(byte colour)
          Set the colour index for the track
 void setStyle(int style)
          Set the point/line style or marker type for this map
 void setTileSize(int size)
          Set the horizontal and vertical tile size to the same value
 void setTileXSize(int dimx)
          Set the horizontal tile size in pixel
 void setTileYSize(int dimy)
          Set the vertical tile size in pixel
 void writeTiles(MapCanvas canvas)
          Write the map to disk, as one PNG file per tile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TILE_SIZE

public final int DEFAULT_TILE_SIZE
See Also:
Constant Field Values

DEFAULT_COLOUR

public final int DEFAULT_COLOUR
See Also:
Constant Field Values

DEFAULT_STYLE

public final int DEFAULT_STYLE
See Also:
Constant Field Values
Constructor Detail

TrackRender

public TrackRender(java.lang.String tiledir,
                   int zoom)
Create a new renderer

Parameters:
tiledir - where to store the generated tiles
zoom - zoom level of the map
Method Detail

writeTiles

public void writeTiles(MapCanvas canvas)
Write the map to disk, as one PNG file per tile

Parameters:
canvas - the map

setColour

public void setColour(byte colour)
Set the colour index for the track

Parameters:
colour - colour index

getColour

public byte getColour()
Return the colour

Returns:
colour index

setStyle

public void setStyle(int style)
Set the point/line style or marker type for this map

Parameters:
style - point/line style

getStyle

public int getStyle()
Return the point/line style for this map

Returns:
style

setTileXSize

public void setTileXSize(int dimx)
Set the horizontal tile size in pixel

Parameters:
dimx - horizontal tile size

getTileXSize

public int getTileXSize()
Return the horizontal tile size in pixel

Returns:
tile size

setTileYSize

public void setTileYSize(int dimy)
Set the vertical tile size in pixel

Parameters:
dimy - vertical tile size

getTileYSize

public int getTileYSize()
Return the vertical tile size in pixel

Returns:
tile size

setTileSize

public void setTileSize(int size)
Set the horizontal and vertical tile size to the same value

Parameters:
size - tile size

createCanvas

public MapCanvas createCanvas()
Create the canvas to draw on

Returns:
reference to canvas

renderMap

public void renderMap(java.lang.String gpxfile)
Render a track from a GPX file

Parameters:
gpxfile - path of the GPX file