PendingResult<ImageResult>public class StaticMapsRequest
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
StaticMapsRequest.ImageFormat |
|
static class |
StaticMapsRequest.Markers |
|
static class |
StaticMapsRequest.Path |
|
static class |
StaticMapsRequest.StaticMapType |
PendingResult.Callback<T>| Constructor | Description |
|---|---|
StaticMapsRequest(GeoApiContext context) |
| Modifier and Type | Method | Description |
|---|---|---|
T |
await() |
Performs the request synchronously.
|
T |
awaitIgnoreError() |
Performs the request synchronously, ignoring exceptions while performing the request and errors
returned by the server.
|
void |
cancel() |
Attempts to cancel the request.
|
StaticMapsRequest |
center(LatLng location) |
center (required if markers not present) defines the center of the map,
equidistant from all edges of the map. |
StaticMapsRequest |
center(java.lang.String location) |
center (required if markers not present) defines the center of the map,
equidistant from all edges of the map. |
A |
channel(java.lang.String channel) |
A channel to pass with the request.
|
A |
custom(java.lang.String parameter,
java.lang.String value) |
Custom parameter.
|
StaticMapsRequest |
format(StaticMapsRequest.ImageFormat format) |
format defines the format of the resulting image. |
A |
language(java.lang.String language) |
The language in which to return results.
|
StaticMapsRequest |
maptype(StaticMapsRequest.StaticMapType maptype) |
maptype defines the type of map to construct. |
StaticMapsRequest |
markers(StaticMapsRequest.Markers markers) |
markers parameter defines a set of one or more markers (map pins) at a set of
locations. |
protected A |
param(java.lang.String key,
int val) |
|
protected A |
param(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
|
protected A |
param(java.lang.String key,
java.lang.String val) |
|
protected A |
paramAddToList(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val) |
|
protected A |
paramAddToList(java.lang.String key,
java.lang.String val) |
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
params() |
|
StaticMapsRequest |
path(EncodedPolyline path) |
The
path parameter defines a set of one or more locations connected by a path to
overlay on the map image. |
StaticMapsRequest |
path(StaticMapsRequest.Path path) |
The
path parameter defines a set of one or more locations connected by a path to
overlay on the map image. |
StaticMapsRequest |
region(java.lang.String region) |
region defines the appropriate borders to display, based on geo-political
sensitivities. |
StaticMapsRequest |
scale(int scale) |
scale affects the number of pixels that are returned. |
void |
setCallback(PendingResult.Callback<T> callback) |
|
StaticMapsRequest |
size(Size size) |
size defines the rectangular dimensions of the map image. |
protected void |
validateRequest() |
|
StaticMapsRequest |
visible(LatLng visibleLocation) |
visible instructs the Google Static Maps API service to construct a map such that
the existing locations remain visible. |
StaticMapsRequest |
visible(java.lang.String visibleLocation) |
visible instructs the Google Static Maps API service to construct a map such that
the existing locations remain visible. |
StaticMapsRequest |
zoom(int zoom) |
zoom (required if markers not present) defines the zoom level of the map, which
determines the magnification level of the map. |
public StaticMapsRequest(GeoApiContext context)
protected void validateRequest()
public StaticMapsRequest center(LatLng location)
center (required if markers not present) defines the center of the map,
equidistant from all edges of the map.location - The location of the center of the map.StaticMapsRequest for call chaining.public StaticMapsRequest center(java.lang.String location)
center (required if markers not present) defines the center of the map,
equidistant from all edges of the map.location - The location of the center of the map.StaticMapsRequest for call chaining.public StaticMapsRequest zoom(int zoom)
zoom (required if markers not present) defines the zoom level of the map, which
determines the magnification level of the map.zoom - The zoom level of the region.StaticMapsRequest for call chaining.public StaticMapsRequest size(Size size)
size defines the rectangular dimensions of the map image.size - The Size of the static map.StaticMapsRequest for call chaining.public StaticMapsRequest scale(int scale)
scale affects the number of pixels that are returned. Setting scale
to 2 returns twice as many pixels as scale set to 1 while retaining the same
coverage area and level of detail (i.e. the contents of the map doesn't change).scale - The scale of the static map.StaticMapsRequest for call chaining.public StaticMapsRequest format(StaticMapsRequest.ImageFormat format)
format defines the format of the resulting image. By default, the Google Static
Maps API creates PNG images. There are several possible formats including GIF, JPEG and PNG
types.format - The format of the static map.StaticMapsRequest for call chaining.public StaticMapsRequest maptype(StaticMapsRequest.StaticMapType maptype)
maptype defines the type of map to construct.maptype - The map type of the static map.StaticMapsRequest for call chaining.public StaticMapsRequest region(java.lang.String region)
region defines the appropriate borders to display, based on geo-political
sensitivities. Accepts a region code specified as a two-character ccTLD ('top-level domain')
value.region - The region of the static map.StaticMapsRequest for call chaining.public StaticMapsRequest markers(StaticMapsRequest.Markers markers)
markers parameter defines a set of one or more markers (map pins) at a set of
locations. Each marker defined within a single markers declaration must exhibit the same visual
style; if you wish to display markers with different styles, you will need to supply multiple
markers parameters with separate style information.markers - A group of markers with the same style.StaticMapsRequest for call chaining.public StaticMapsRequest path(StaticMapsRequest.Path path)
path parameter defines a set of one or more locations connected by a path to
overlay on the map image.path - A path to render atop the map.StaticMapsRequest for call chaining.public StaticMapsRequest path(EncodedPolyline path)
path parameter defines a set of one or more locations connected by a path to
overlay on the map image. This variant of the method accepts the path as an EncodedPolyline.path - A path to render atop the map, as an EncodedPolyline.StaticMapsRequest for call chaining.public StaticMapsRequest visible(LatLng visibleLocation)
visible instructs the Google Static Maps API service to construct a map such that
the existing locations remain visible.visibleLocation - The location to be made visible in the requested Static Map.StaticMapsRequest for call chaining.public StaticMapsRequest visible(java.lang.String visibleLocation)
visible instructs the Google Static Maps API service to construct a map such that
the existing locations remain visible.visibleLocation - The location to be made visible in the requested Static Map.StaticMapsRequest for call chaining.public final void setCallback(PendingResult.Callback<T> callback)
PendingResultonResult or onFailure after the request has been
completed.setCallback in interface PendingResult<T>callback - The callback to call on completion.public final T await()
throws ApiException,
java.lang.InterruptedException,
java.io.IOException
PendingResultawait in interface PendingResult<T>ApiException - Thrown if the API Returned result is an error.java.lang.InterruptedException - Thrown when a thread is waiting, sleeping, or otherwise occupied,
and the thread is interrupted.java.io.IOException - Thrown when an I/O exception of some sort has occurred.public final T awaitIgnoreError()
PendingResultawaitIgnoreError in interface PendingResult<T>public final void cancel()
PendingResultcancel in interface PendingResult<T>protected A param(java.lang.String key,
java.lang.String val)
protected A param(java.lang.String key,
int val)
protected A param(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val)
protected A paramAddToList(java.lang.String key,
java.lang.String val)
protected A paramAddToList(java.lang.String key,
com.google.maps.internal.StringJoin.UrlValue val)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params()
public final A language(java.lang.String language)
language - The language code, e.g. "en-AU" or "es".public A channel(java.lang.String channel)
channel - String to pass with the request for analytics.public A custom(java.lang.String parameter,
java.lang.String value)
parameter - The name of the custom parameter.value - The value of the custom parameter.