Package huskymaps
Class MapServer
- java.lang.Object
-
- huskymaps.MapServer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MapServer.BoundingBox
A bounding box represented by the upper-left and lower-right corners' latitudes and longitudes.
-
Constructor Summary
Constructors Constructor Description MapServer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
private static void
overlay(BufferedImage image, List<Location> route, MapServer.BoundingBox bbox)
Overlay the route on the image using the bounding box parameters.private static int
port()
Returns the port for communicating with the server.private static URL
url(MapServer.BoundingBox bbox, int width, int height, List<Location> locations)
Return the API URL for retrieving the map image.
-
-
-
Method Detail
-
overlay
private static void overlay(BufferedImage image, List<Location> route, MapServer.BoundingBox bbox)
Overlay the route on the image using the bounding box parameters.- Parameters:
image
- the input image.route
- the input route.bbox
- the bounding box.
-
port
private static int port()
Returns the port for communicating with the server.- Returns:
- the port for communicating with the server.
-
url
private static URL url(MapServer.BoundingBox bbox, int width, int height, List<Location> locations) throws MalformedURLException
Return the API URL for retrieving the map image.- Parameters:
bbox
- the bounding box.width
- the width of the window.height
- the height of the window.locations
- the list of locations (or null).- Returns:
- the URL for retrieving the map image.
- Throws:
MalformedURLException
- if the URL is invalid.
-
-