de.fhpotsdam.unfolding.providers
Class AbstractMapProvider
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
projection
public AbstractProjection projection
AbstractMapProvider
public AbstractMapProvider(AbstractProjection projection)
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