Class GoogleMapsProvider


public class GoogleMapsProvider extends TiledProvider
This is a GoogleMaps Provider https://developers.google.com/maps/documentation/staticmaps/
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    This is a satellite + road map
    static final int
    This is a regular road map
    static final int
    This is a satellite map

    Fields inherited from class TiledProvider

    _url, _zoomLevel
    Modifier and Type
    Field
    Description
    protected final String
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Google map provider Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    The provider attribution.
    Defines the language to use for display of labels on map tiles.
    static int
    Returns
    boolean
    Specifies whether the application requesting the static map is using a sensor to determine the user's location.
    int
    Maximal zoom level.
    void
    setLanguage(String language)
    Defines the language to use for display of labels on map tiles.
    void
    setMapType(int type)
    Sets the map type
    void
    setSensor(boolean sensor)
    Specifies whether the application requesting the static map is using a sensor to determine the user's location.
    static void
    setTileSize(int aTileSize)
    Parameters
    Gets a tile for the given bounding box

    Methods inherited from class TiledProvider

    bboxFor, scale, url
    Modifier and Type
    Method
    Description
    bboxFor(Coord position, int zoomLevel)
    Returns the bounding box of a position ina given zoom level
    scale(int zoomLevel)
    Scale to the zoom level
    protected String
    url(int zoomLevel, int xTile, int yTile)
    build a url request for a tile

    Methods inherited from class MapProvider

    maxZoomFor, minZoomLevel, projection, tileSize, tileSize, translate
    Modifier and Type
    Method
    Description
    int
    Returns the maximum zoom of a specific Tile.
    int
    Minimal zoom level user is able to see.
    Gets the Provider projection
    Gets the tile size
    void
    Request map to provide tiles of specific sizes.
    translate(Coord position, int zoomLevel, int pixelsX, int pixelsY)
    Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Field Details

  • Constructor Details

    • GoogleMapsProvider

      public GoogleMapsProvider(String apiKey)

      Google map provider Constructor

      Parameters
      • apiKey: @param apiKey google maps api key https://developers.google.com/maps/documentation/staticmaps/#api_key
  • Method Details

    • getTileSize

      public static int getTileSize()
      Returns

      the tileSize

    • setTileSize

      public static void setTileSize(int aTileSize)
      Parameters
      • aTileSize: the tileSize to set
    • setMapType

      public void setMapType(int type)
      Sets the map type
    • maxZoomLevel

      public int maxZoomLevel()
      Maximal zoom level. Zoom levels are counted from zero to maxZoomLevel(). 0 is farest view, where the scale is greatest.
      Specified by:
      maxZoomLevel in class MapProvider
    • attribution

      public String attribution()

      The provider attribution.

      Returns

      a String of the provider attribution

      Specified by:
      attribution in class MapProvider
    • tileFor

      public Tile tileFor(BoundingBox bbox)

      Gets a tile for the given bounding box

      Parameters
      • bbox: a bounding box
      Returns

      a Tile for the given bounding box

      Overrides:
      tileFor in class TiledProvider
    • getLanguage

      public String getLanguage()

      Defines the language to use for display of labels on map tiles. Note that this parameter is only supported for some country tiles; if the specific language requested is not supported for the tile set, then the default language for that tileset will be used.

      Returns

      the language

    • setLanguage

      public void setLanguage(String language)

      Defines the language to use for display of labels on map tiles. Note that this parameter is only supported for some country tiles; if the specific language requested is not supported for the tile set, then the default language for that tileset will be used.

      Parameters
      • language: the language to set
    • isSensor

      public boolean isSensor()

      Specifies whether the application requesting the static map is using a sensor to determine the user's location.

      Returns

      the sensor

    • setSensor

      public void setSensor(boolean sensor)

      Specifies whether the application requesting the static map is using a sensor to determine the user's location.

      Parameters
      • sensor: the sensor to set