de.fhpotsdam.unfolding.providers
Class AbstractMapProvider

java.lang.Object
  extended by de.fhpotsdam.unfolding.providers.AbstractMapProvider
Direct Known Subclasses:
AbstractMapTileProvider, AbstractMapTileUrlProvider

public abstract class AbstractMapProvider
extends java.lang.Object

Abstract map provider handles map tiles in combination with the appropriate TileLoader.


Field Summary
 AbstractProjection projection
           
 
Constructor Summary
AbstractMapProvider(AbstractProjection projection)
           
 
Method Summary
 Location coordinateLocation(Coordinate coordinate)
           
abstract  processing.core.PImage getTile(Coordinate coordinate)
          Gets tiles for coordinate.
abstract  java.lang.String[] getTileUrls(Coordinate coordinate)
          Gets tile URLs for coordinate.
 Coordinate locationCoordinate(Location location)
           
static float random(int lower, int higher)
          since we're often given four tile servers to pick from
 Coordinate sourceCoordinate(Coordinate coordinate)
           
abstract  int tileHeight()
           
abstract  int tileWidth()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

projection

public AbstractProjection projection
Constructor Detail

AbstractMapProvider

public AbstractMapProvider(AbstractProjection projection)
Method Detail

getTile

public abstract processing.core.PImage getTile(Coordinate coordinate)
Gets tiles for coordinate. Either this or @{link #getTileUrls(Coordinate)} has to be implemented.

Parameters:
coordinate - The position and zoom to get tile for.
Returns:
A single PImage with the tile.

getTileUrls

public abstract java.lang.String[] getTileUrls(Coordinate coordinate)
Gets tile URLs for coordinate. May return multiple URLs, if provider handles multiple layers. Either this or @{link #getTile(Coordinate)} has to be implemented.

Parameters:
coordinate - The position and zoom to get tile for.
Returns:
An array with tile URLs (mostly just one)

tileWidth

public abstract int tileWidth()

tileHeight

public abstract int tileHeight()

locationCoordinate

public Coordinate locationCoordinate(Location location)

coordinateLocation

public Location coordinateLocation(Coordinate coordinate)

sourceCoordinate

public Coordinate sourceCoordinate(Coordinate coordinate)

random

public static float random(int lower,
                           int higher)
since we're often given four tile servers to pick from