Package huskymaps

Class MapServer


  • public class MapServer
    extends Object
    Run the huskymaps server.
    See Also:
    MapGraph
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int MAX_MATCHES
      Maximum number of autocomplete search results.
      private static String OSM_DB_PATH
      The OpenStreetMap XML file path.
      private static String PLACES_PATH
      The place-importance TSV data file path from OpenStreetMap.
      private static int PORT
      Default port for serving the application locally.
      private static double SEATTLE_ROOT_LATDPP
      The latitudinal distance per pixel when the map is centered on Seattle.
      private static double SEATTLE_ROOT_LONDPP
      The longitudinal distance per pixel when the map is centered on Seattle.
    • Constructor Summary

      Constructors 
      Constructor Description
      MapServer()  
    • Field Detail

      • PORT

        private static final int PORT
        Default port for serving the application locally.
        See Also:
        Constant Field Values
      • OSM_DB_PATH

        private static final String OSM_DB_PATH
        The OpenStreetMap XML file path. Downloaded from BBBike using custom region selection.
        See Also:
        Constant Field Values
      • PLACES_PATH

        private static final String PLACES_PATH
        The place-importance TSV data file path from OpenStreetMap.
        See Also:
        Constant Field Values
      • MAX_MATCHES

        private static final int MAX_MATCHES
        Maximum number of autocomplete search results.
        See Also:
        Constant Field Values
      • SEATTLE_ROOT_LONDPP

        private static final double SEATTLE_ROOT_LONDPP
        The longitudinal distance per pixel when the map is centered on Seattle.
        See Also:
        Constant Field Values
      • SEATTLE_ROOT_LATDPP

        private static final double SEATTLE_ROOT_LATDPP
        The latitudinal distance per pixel when the map is centered on Seattle.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MapServer

        public MapServer()
    • Method Detail

      • 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​(org.locationtech.spatial4j.shape.Point center,
                               int zoom,
                               int width,
                               int height,
                               List<org.locationtech.spatial4j.shape.Point> locations)
                        throws MalformedURLException
        Return the API URL for retrieving the map image.
        Parameters:
        center - the center of the map image.
        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.