public class MapboxMapOptions extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<MapboxMapOptions> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
MapboxMapOptions()
Creates a new MapboxMapOptions object.
|
Modifier and Type | Method and Description |
---|---|
MapboxMapOptions |
apiBaseUrl(String apiBaseUrl)
Specifies the URL used for API endpoint.
|
MapboxMapOptions |
attributionEnabled(boolean enabled)
Specifies the visibility state of a attribution for a map view.
|
MapboxMapOptions |
attributionGravity(int gravity)
Specifies the gravity state of attribution for a map view.
|
MapboxMapOptions |
attributionMargins(int[] margins)
Specifies the margin state of attribution for a map view
|
MapboxMapOptions |
attributionTintColor(int color)
Specifies the tint color of the attribution for a map view
|
MapboxMapOptions |
camera(CameraPosition cameraPosition)
Specifies a the initial camera position for the map view.
|
MapboxMapOptions |
compassEnabled(boolean enabled)
Specifies the visibility state of a mapbox_compass_icon for a map view.
|
MapboxMapOptions |
compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth)
Specifies if the mapbox_compass_icon fades to invisible when facing north.
|
MapboxMapOptions |
compassGravity(int gravity)
Specifies the gravity state of mapbox_compass_icon for a map view.
|
MapboxMapOptions |
compassImage(Drawable compass)
Specifies the image of the CompassView.
|
MapboxMapOptions |
compassMargins(int[] margins)
Specifies the margin state of mapbox_compass_icon for a map view
|
static MapboxMapOptions |
createFromAttributes(Context context,
AttributeSet attrs)
Creates a MapboxMapsOptions from the attribute set.s
|
MapboxMapOptions |
debugActive(boolean enabled)
Specifies the used debug type for a map view.
|
int |
describeContents() |
MapboxMapOptions |
doubleTapGesturesEnabled(boolean enabled)
Specifies if the double tap gesture is enabled for a map view.
|
boolean |
equals(Object o) |
String |
getApiBaseUrl()
Get the current configured API endpoint base URL.
|
boolean |
getAttributionEnabled()
Get the current configured visibility state for attribution for a map view.
|
int |
getAttributionGravity()
Get the current configured gravity state for attribution for a map view.
|
int[] |
getAttributionMargins()
Get the current configured margins for attribution for a map view.
|
int |
getAttributionTintColor()
Get the current configured tint color for attribution for a map view.
|
CameraPosition |
getCamera()
Get the current configured initial camera position for a map view.
|
boolean |
getCompassEnabled()
Get the current configured visibility state for mapbox_compass_icon for a map view.
|
boolean |
getCompassFadeFacingNorth()
Get the current configured state for fading the mapbox_compass_icon when facing north.
|
int |
getCompassGravity()
Get the current configured gravity state for mapbox_compass_icon for a map view.
|
Drawable |
getCompassImage()
Get the current configured CompassView image.
|
int[] |
getCompassMargins()
Get the current configured margins for mapbox_compass_icon for a map view.
|
boolean |
getDebugActive()
Get the current configured debug state for a map view.
|
boolean |
getDoubleTapGesturesEnabled()
Get the current configured double tap gesture state for a map view.
|
String |
getLocalIdeographFontFamily()
Returns the font-family for locally overriding generation of glyphs in the
‘CJK Unified Ideographs’ and ‘Hangul Syllables’ ranges.
|
boolean |
getLocationEnabled()
Get the current configured user location view state for a map view.
|
boolean |
getLogoEnabled()
Get the current configured visibility state for mapbox_compass_icon for a map view.
|
int |
getLogoGravity()
Get the current configured gravity state for logo for a map view.
|
int[] |
getLogoMargins()
Get the current configured margins for logo for a map view.
|
double |
getMaxZoomPreference()
Get the current configured maximum zoom for a map view.
|
double |
getMinZoomPreference()
Get the current configured min zoom for a map view.
|
int |
getMyLocationAccuracyAlpha()
Get the current configured MyLocationView accuracy circle alpha value.
|
float |
getMyLocationAccuracyThreshold()
Returns current accuracy threshold value (in meters).
|
int |
getMyLocationAccuracyTintColor()
Get the current configured MyLocationView accuracy circle color tint value.
|
Drawable |
getMyLocationBackgroundDrawable()
Get the current configured MyLocationView background drawable.
|
int[] |
getMyLocationBackgroundPadding()
Get the current configured MyLocationView background padding.
|
int |
getMyLocationBackgroundTintColor()
Get the current configured MyLocationView background tint color.
|
Drawable |
getMyLocationForegroundBearingDrawable()
Get the current configured MyLocationView foreground bearing drawable.
|
Drawable |
getMyLocationForegroundDrawable()
Get the current configured MyLocationView foreground drawable.
|
int |
getMyLocationForegroundTintColor()
Get the current configured MyLocationView foreground tint color.
|
boolean |
getPrefetchesTiles()
Check whether tile pre-fetching is enabled.
|
boolean |
getRenderSurfaceOnTop()
Get the flag to render the map surface on top of another surface.
|
boolean |
getRotateGesturesEnabled()
Get the current configured rotate gesture state for a map view.
|
boolean |
getScrollGesturesEnabled()
Get the current configured scroll gesture state for a map view.
|
String |
getStyle()
Get the current configured style url for a map view.
|
boolean |
getTextureMode()
Returns true if TextureView is being used the render view.
|
boolean |
getTiltGesturesEnabled()
Get the current configured tilt gesture state for a map view.
|
boolean |
getTranslucentTextureSurface() |
boolean |
getZoomControlsEnabled()
Get the current configured zoom controls state for a map view.
|
boolean |
getZoomGesturesEnabled()
Get the current configured zoom gesture state for a map view.
|
int |
hashCode() |
MapboxMapOptions |
localIdeographFontFamily(String fontFamily)
Set the font family for generating glyphs locally for ideographs in the ‘CJK Unified Ideographs’
and ‘Hangul Syllables’ ranges.
|
MapboxMapOptions |
locationEnabled(boolean locationEnabled)
Specifies if the user location view is enabled for a map view.
|
MapboxMapOptions |
logoEnabled(boolean enabled)
Specifies the visibility state of a logo for a map view.
|
MapboxMapOptions |
logoGravity(int gravity)
Specifies the gravity state of logo for a map view.
|
MapboxMapOptions |
logoMargins(int[] margins)
Specifies the margin state of logo for a map view
|
MapboxMapOptions |
maxZoomPreference(double maxZoom)
Specifies the used maximum zoom level for a map view.
|
MapboxMapOptions |
minZoomPreference(double minZoom)
Specifies the used minimum zoom level for a map view.
|
MapboxMapOptions |
myLocationAccuracyAlpha(int alpha)
Set the MyLocationView accuracy alpha value.
|
MapboxMapOptions |
myLocationAccuracyThreshold(float myLocationAccuracyThreshold)
Set accuracy circle threshold.
|
MapboxMapOptions |
myLocationAccuracyTint(int myLocationAccuracyTintColor)
Set the MyLocationView accuracy circle tint color.
|
MapboxMapOptions |
myLocationBackgroundDrawable(Drawable myLocationBackgroundDrawable)
Set the background drawable of MyLocationView.
|
MapboxMapOptions |
myLocationBackgroundPadding(int[] myLocationBackgroundPadding)
Set the MyLocationView padding.
|
MapboxMapOptions |
myLocationBackgroundTintColor(int myLocationBackgroundTintColor)
Set the background tint color of MyLocationView.
|
MapboxMapOptions |
myLocationForegroundDrawable(Drawable myLocationForegroundDrawable)
Set the foreground drawable of the MyLocationView.
|
MapboxMapOptions |
myLocationForegroundDrawables(Drawable myLocationForegroundDrawable,
Drawable myLocationBearingDrawable)
Set the foreground drawables of the MyLocationView.
|
MapboxMapOptions |
myLocationForegroundTintColor(int myLocationForegroundTintColor)
Set the foreground tint color of MyLocationView.
|
void |
renderSurfaceOnTop(boolean renderOnTop)
Set the flag to render the map surface on top of another surface.
|
MapboxMapOptions |
rotateGesturesEnabled(boolean enabled)
Specifies if the rotate gesture is enabled for a map view.
|
MapboxMapOptions |
scrollGesturesEnabled(boolean enabled)
Specifies if the scroll gesture is enabled for a map view.
|
MapboxMapOptions |
setPrefetchesTiles(boolean enable)
Enable tile pre-fetching.
|
MapboxMapOptions |
styleUrl(String styleUrl)
Specifies the style url associated with a map view.
|
MapboxMapOptions |
textureMode(boolean textureMode)
Enable
TextureView as rendered surface. |
MapboxMapOptions |
tiltGesturesEnabled(boolean enabled)
Specifies if the tilt gesture is enabled for a map view.
|
MapboxMapOptions |
translucentTextureSurface(boolean translucentTextureSurface) |
void |
writeToParcel(Parcel dest,
int flags) |
MapboxMapOptions |
zoomControlsEnabled(boolean enabled)
Specifies if the zoom controls are enabled for a map view.
|
MapboxMapOptions |
zoomGesturesEnabled(boolean enabled)
Specifies if the zoom gesture is enabled for a map view.
|
public static final Parcelable.Creator<MapboxMapOptions> CREATOR
public MapboxMapOptions()
public static MapboxMapOptions createFromAttributes(@NonNull Context context, @Nullable AttributeSet attrs)
context
- Context related to a map view.attrs
- Attributeset containing configurationpublic MapboxMapOptions apiBaseUrl(String apiBaseUrl)
apiBaseUrl
- The base of our API endpointpublic MapboxMapOptions camera(CameraPosition cameraPosition)
cameraPosition
- Inital camera positionpublic MapboxMapOptions styleUrl(String styleUrl)
styleUrl
- Url to be used to load a stylepublic MapboxMapOptions debugActive(boolean enabled)
enabled
- True is debug is enabledpublic MapboxMapOptions minZoomPreference(double minZoom)
minZoom
- Zoom level to be usedpublic MapboxMapOptions maxZoomPreference(double maxZoom)
maxZoom
- Zoom level to be usedpublic MapboxMapOptions compassEnabled(boolean enabled)
enabled
- True and mapbox_compass_icon is shownpublic MapboxMapOptions compassGravity(int gravity)
gravity
- Android SDK Gravity.public MapboxMapOptions compassMargins(int[] margins)
margins
- 4 long array for LTRB marginspublic MapboxMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth)
By default this value is true.
compassFadeWhenFacingNorth
- true is mapbox_compass_icon fades to invisblepublic MapboxMapOptions compassImage(Drawable compass)
By default this value is R.drawable.mapbox_compass_icon.
compass
- the drawable to show as image compasspublic MapboxMapOptions logoEnabled(boolean enabled)
enabled
- True and logo is shownpublic MapboxMapOptions logoGravity(int gravity)
gravity
- Android SDK Gravity.public MapboxMapOptions logoMargins(int[] margins)
margins
- 4 long array for LTRB marginspublic MapboxMapOptions attributionEnabled(boolean enabled)
enabled
- True and attribution is shownpublic MapboxMapOptions attributionGravity(int gravity)
gravity
- Android SDK Gravity.public MapboxMapOptions attributionMargins(int[] margins)
margins
- 4 long array for LTRB marginspublic MapboxMapOptions attributionTintColor(int color)
color
- integer resembling a colorpublic MapboxMapOptions rotateGesturesEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions scrollGesturesEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions tiltGesturesEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions zoomControlsEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions zoomGesturesEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions doubleTapGesturesEnabled(boolean enabled)
enabled
- True and gesture will be enabledpublic MapboxMapOptions locationEnabled(boolean locationEnabled)
locationEnabled
- True and gesture will be enabledpublic MapboxMapOptions myLocationForegroundDrawables(Drawable myLocationForegroundDrawable, Drawable myLocationBearingDrawable)
myLocationForegroundDrawable
- the drawable to show as foreground without bearingmyLocationBearingDrawable
- the drawable to show as foreground when bearing is disabledpublic MapboxMapOptions myLocationForegroundDrawable(Drawable myLocationForegroundDrawable)
The same drawable will be used for both bearing as non bearing modes.
myLocationForegroundDrawable
- the drawable to show as foregroundpublic MapboxMapOptions myLocationBackgroundDrawable(Drawable myLocationBackgroundDrawable)
Padding can be added to provide an offset to the background.
myLocationBackgroundDrawable
- the drawable to show as backgroundpublic MapboxMapOptions myLocationForegroundTintColor(int myLocationForegroundTintColor)
The color will tint both the foreground and the bearing foreground drawable.
myLocationForegroundTintColor
- the color to tint the foreground drawablepublic MapboxMapOptions myLocationBackgroundTintColor(int myLocationBackgroundTintColor)
myLocationBackgroundTintColor
- the color to tint the background drawablepublic MapboxMapOptions myLocationBackgroundPadding(int[] myLocationBackgroundPadding)
myLocationBackgroundPadding
- the color to tint the backgroundpublic MapboxMapOptions myLocationAccuracyTint(int myLocationAccuracyTintColor)
myLocationAccuracyTintColor
- the color to tint the accuracy circlepublic MapboxMapOptions myLocationAccuracyAlpha(int alpha)
alpha
- the alpha valuepublic MapboxMapOptions myLocationAccuracyThreshold(float myLocationAccuracyThreshold)
myLocationAccuracyThreshold
- Value of accuracy (in meters), below which circle won't be displayedpublic MapboxMapOptions textureMode(boolean textureMode)
TextureView
as rendered surface.
Since the 5.2.0 release we replaced our TextureView with an GLSurfaceView
implementation. Enabling this option will use the TextureView
instead.
TextureView
can be useful in situations where you need to animate, scale
or transform the view. This comes at a siginficant performance penalty and should not be considered
unless absolutely needed.
textureMode
- True to enable texture modepublic MapboxMapOptions translucentTextureSurface(boolean translucentTextureSurface)
public MapboxMapOptions setPrefetchesTiles(boolean enable)
enable
- true to enablepublic MapboxMapOptions localIdeographFontFamily(String fontFamily)
Typeface.create(String, int)
.
Default system fonts are defined in '/system/etc/fonts.xml'fontFamily
- font family for local ideograph generation.public boolean getPrefetchesTiles()
public void renderSurfaceOnTop(boolean renderOnTop)
renderOnTop
- true if this map is shown on top of another one, false if bottom.public boolean getRenderSurfaceOnTop()
public String getApiBaseUrl()
public CameraPosition getCamera()
public double getMinZoomPreference()
public double getMaxZoomPreference()
public boolean getCompassEnabled()
public int getCompassGravity()
public int[] getCompassMargins()
public boolean getCompassFadeFacingNorth()
public Drawable getCompassImage()
public boolean getLogoEnabled()
public int getLogoGravity()
public int[] getLogoMargins()
public String getStyle()
public boolean getRotateGesturesEnabled()
public boolean getScrollGesturesEnabled()
public boolean getTiltGesturesEnabled()
public boolean getZoomControlsEnabled()
public boolean getZoomGesturesEnabled()
public boolean getDoubleTapGesturesEnabled()
public boolean getAttributionEnabled()
public int getAttributionGravity()
public int[] getAttributionMargins()
public int getAttributionTintColor()
public boolean getLocationEnabled()
public Drawable getMyLocationForegroundDrawable()
public Drawable getMyLocationForegroundBearingDrawable()
public Drawable getMyLocationBackgroundDrawable()
public int getMyLocationForegroundTintColor()
public int getMyLocationBackgroundTintColor()
public int[] getMyLocationBackgroundPadding()
public int getMyLocationAccuracyTintColor()
public int getMyLocationAccuracyAlpha()
public float getMyLocationAccuracyThreshold()
public boolean getDebugActive()
public boolean getTextureMode()
public boolean getTranslucentTextureSurface()
public String getLocalIdeographFontFamily()
public int describeContents()
describeContents
in interface Parcelable
public void writeToParcel(Parcel dest, int flags)
writeToParcel
in interface Parcelable
© 2015–2018 Mapbox. All rights reserved.