public class MapServer
extends Object
Modifier and Type | Field | Description |
---|---|---|
static double |
ROOT_LRLAT |
The root upper left/lower right longitudes and latitudes represent the bounding box of
the root tile, as the images in the img/ folder are scraped.
|
static double |
ROOT_LRLON |
The root upper left/lower right longitudes and latitudes represent the bounding box of
the root tile, as the images in the img/ folder are scraped.
|
static double |
ROOT_ULLAT |
The root upper left/lower right longitudes and latitudes represent the bounding box of
the root tile, as the images in the img/ folder are scraped.
|
static double |
ROOT_ULLON |
The root upper left/lower right longitudes and latitudes represent the bounding box of
the root tile, as the images in the img/ folder are scraped.
|
static Color |
ROUTE_STROKE_COLOR |
Route stroke information: Cyan with half transparency.
|
static float |
ROUTE_STROKE_WIDTH_PX |
Route stroke information: typically roads are not more than 5px wide.
|
static int |
TILE_SIZE |
Each tile is 256x256 pixels.
|
Constructor | Description |
---|---|
MapServer() |
Modifier and Type | Method | Description |
---|---|---|
static void |
clearRoute() |
Clear the current found route, if it exists.
|
static List<Map<String,Object>> |
getLocations(String locationName) |
Collect all locations that match a cleaned
locationName , and return
information about each node that matches. |
static List<String> |
getLocationsByPrefix(String prefix) |
In linear time, collect all the names of OSM locations that prefix-match the query string.
|
static void |
initialize() |
Place any initialization statements that will be run before the server main loop here.
|
static void |
main(String[] args) |
public static final double ROOT_ULLAT
public static final double ROOT_ULLON
public static final double ROOT_LRLAT
public static final double ROOT_LRLON
public static final int TILE_SIZE
public static final float ROUTE_STROKE_WIDTH_PX
public static final Color ROUTE_STROKE_COLOR
public static void initialize()
public static void main(String[] args)
public static void clearRoute()
public static List<String> getLocationsByPrefix(String prefix)
prefix
- Prefix string to be searched for. Could be any case, with our without
punctuation.List
of the full names of locations whose cleaned name matches the
cleaned prefix
.public static List<Map<String,Object>> getLocations(String locationName)
locationName
, and return
information about each node that matches.locationName
- A full name of a location searched for.locationName
, and each location is a map of parameters for the Json
response as specified: