public abstract static class MapboxStaticMap.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract MapboxStaticMap.Builder |
accessToken(java.lang.String accessToken)
Required to call when this is being built.
|
abstract MapboxStaticMap.Builder |
attribution(boolean attribution)
Optionally, control whether there is attribution on the image.
|
abstract MapboxStaticMap.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Mapbox one.
|
abstract MapboxStaticMap.Builder |
beforeLayer(java.lang.String beforeLayer)
String value for controlling where the overlay is inserted in the style.
|
MapboxStaticMap |
build()
This uses the provided parameters set using the
MapboxStaticMap.Builder and creates a new
MapboxStaticMap object. |
abstract MapboxStaticMap.Builder |
cameraAuto(boolean auto)
If auto is set to true, the viewport will fit the bounds of the overlay.
|
abstract MapboxStaticMap.Builder |
cameraBearing(double cameraBearing)
Optionally, bearing rotates the map around its center defined point given in
cameraPoint(Point) . |
abstract MapboxStaticMap.Builder |
cameraPitch(double cameraPitch)
Optionally, pitch tilts the map, producing a perspective effect.
|
abstract MapboxStaticMap.Builder |
cameraPoint(com.mapbox.geojson.Point cameraPoint)
Center point where the camera will be focused on.
|
abstract MapboxStaticMap.Builder |
cameraZoom(double cameraZoom)
Static maps camera zoom level.
|
abstract MapboxStaticMap.Builder |
geoJson(com.mapbox.geojson.GeoJson geoJson)
GeoJSON object which represents a specific annotation which will be placed on the static map.
|
abstract MapboxStaticMap.Builder |
height(int height)
Height of the image.
|
abstract MapboxStaticMap.Builder |
logo(boolean logo)
Optionally, control whether there is a Mapbox logo on the image.
|
abstract MapboxStaticMap.Builder |
precision(int precision)
In order to make the returned image better cache-able on the client, you can set the
precision in decimals instead of manually round the parameters.
|
abstract MapboxStaticMap.Builder |
retina(boolean retina)
Enhance your image by toggling retina to true.
|
abstract MapboxStaticMap.Builder |
staticMarkerAnnotations(java.util.List<StaticMarkerAnnotation> staticMarkerAnnotations)
Optionally provide a list of marker annotations which can be placed on the static map image
during the rendering process.
|
abstract MapboxStaticMap.Builder |
staticPolylineAnnotations(java.util.List<StaticPolylineAnnotation> staticPolylineAnnotations)
Optionally provide a list of polyline annotations which can be placed on the static map image
during the rendering process.
|
abstract MapboxStaticMap.Builder |
styleId(java.lang.String styleId)
The returning map images style, which can be one of the provided Mapbox Styles or a custom
style made inside Mapbox Studio.
|
abstract MapboxStaticMap.Builder |
user(java.lang.String user)
The username for the account that the directions engine runs on.
|
abstract MapboxStaticMap.Builder |
width(int width)
Width of the image.
|
public abstract MapboxStaticMap.Builder accessToken(@NonNull java.lang.String accessToken)
ServicesException
will be thrown.accessToken
- Mapbox access token, You must have a Mapbox account inorder to use
the Optimization APIpublic abstract MapboxStaticMap.Builder baseUrl(@NonNull java.lang.String baseUrl)
baseUrl
- base url used as end pointpublic abstract MapboxStaticMap.Builder user(@NonNull java.lang.String user)
Constants.MAPBOX_USER
.user
- a non-null string which will replace the default user used in the directions
requestpublic abstract MapboxStaticMap.Builder styleId(@NonNull java.lang.String styleId)
styleId
- either one of the styles defined inside StaticMapCriteria
or a custom
url pointing to a styled map made in Mapbox Studiopublic abstract MapboxStaticMap.Builder logo(boolean logo)
logo
- true places Mapbox logo on imagepublic abstract MapboxStaticMap.Builder attribution(boolean attribution)
attribution
- true places attribution on imagepublic abstract MapboxStaticMap.Builder retina(boolean retina)
retina
- true if the desired image being returned should contain double pixelspublic abstract MapboxStaticMap.Builder cameraPoint(@Nullable com.mapbox.geojson.Point cameraPoint)
cameraPoint
- a GeoJSON Point object which defines the cameras center positionpublic abstract MapboxStaticMap.Builder cameraZoom(double cameraZoom)
cameraZoom
- double number between 0 and 22public abstract MapboxStaticMap.Builder cameraBearing(double cameraBearing)
cameraPoint(Point)
. A value of 90 rotates the map 90 to the left. 180 flips the map.
Defaults is 0.cameraBearing
- double number between 0 and 360, interpreted as decimal degreespublic abstract MapboxStaticMap.Builder cameraPitch(double cameraPitch)
cameraPitch
- double number between 0 and 60public abstract MapboxStaticMap.Builder cameraAuto(boolean auto)
auto
- true if you'd like the viewport to be centered to display all map annotations,
defaults falsepublic abstract MapboxStaticMap.Builder beforeLayer(@Nullable java.lang.String beforeLayer)
beforeLayer
- s string representing the map layer you'd like to place your overlays
below.public abstract MapboxStaticMap.Builder width(int width)
width
- int number between 1 and 1280.public abstract MapboxStaticMap.Builder height(int height)
height
- int number between 1 and 1280.public abstract MapboxStaticMap.Builder geoJson(@Nullable com.mapbox.geojson.GeoJson geoJson)
geoJson
- a formatted string ready to be added to the static map image URLpublic abstract MapboxStaticMap.Builder staticMarkerAnnotations(@Nullable java.util.List<StaticMarkerAnnotation> staticMarkerAnnotations)
staticMarkerAnnotations
- a list made up of StaticMarkerAnnotation
objectspublic abstract MapboxStaticMap.Builder staticPolylineAnnotations(@Nullable java.util.List<StaticPolylineAnnotation> staticPolylineAnnotations)
staticPolylineAnnotations
- a list made up of StaticPolylineAnnotation
objectspublic abstract MapboxStaticMap.Builder precision(int precision)
precision
- integer value greater than zero which represents the decimal precision of
coordinate valuespublic MapboxStaticMap build()
MapboxStaticMap.Builder
and creates a new
MapboxStaticMap
object.MapboxStaticMap