summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java38
1 files changed, 35 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
index eb745fdec5..a5a6ede1dd 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
@@ -142,6 +142,7 @@ public class MapboxMapOptions implements Parcelable {
* @param attrs Attributeset containing configuration
* @return the MapboxMapOptions created from attributes
*/
+ @NonNull
public static MapboxMapOptions createFromAttributes(@NonNull Context context, @Nullable AttributeSet attrs) {
MapboxMapOptions mapboxMapOptions = new MapboxMapOptions();
float pxlRatio = context.getResources().getDisplayMetrics().density;
@@ -247,6 +248,7 @@ public class MapboxMapOptions implements Parcelable {
* @param apiBaseUrl The base of our API endpoint
* @return This
*/
+ @NonNull
public MapboxMapOptions apiBaseUrl(String apiBaseUrl) {
this.apiBaseUrl = apiBaseUrl;
return this;
@@ -258,6 +260,7 @@ public class MapboxMapOptions implements Parcelable {
* @param cameraPosition Inital camera position
* @return This
*/
+ @NonNull
public MapboxMapOptions camera(CameraPosition cameraPosition) {
this.cameraPosition = cameraPosition;
return this;
@@ -269,6 +272,7 @@ public class MapboxMapOptions implements Parcelable {
* @param styleUrl Url to be used to load a styleUrl
* @return This
*/
+ @NonNull
public MapboxMapOptions styleUrl(String styleUrl) {
this.styleUrl = styleUrl;
return this;
@@ -280,6 +284,7 @@ public class MapboxMapOptions implements Parcelable {
* @param styleJson json to used as style
* @return This
*/
+ @NonNull
public MapboxMapOptions styleJson(String styleJson) {
this.styleJson = styleJson;
return this;
@@ -291,6 +296,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True is debug is enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions debugActive(boolean enabled) {
debugActive = enabled;
return this;
@@ -302,6 +308,7 @@ public class MapboxMapOptions implements Parcelable {
* @param minZoom Zoom level to be used
* @return This
*/
+ @NonNull
public MapboxMapOptions minZoomPreference(double minZoom) {
this.minZoom = minZoom;
return this;
@@ -313,6 +320,7 @@ public class MapboxMapOptions implements Parcelable {
* @param maxZoom Zoom level to be used
* @return This
*/
+ @NonNull
public MapboxMapOptions maxZoomPreference(double maxZoom) {
this.maxZoom = maxZoom;
return this;
@@ -324,6 +332,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and mapbox_compass_icon is shown
* @return This
*/
+ @NonNull
public MapboxMapOptions compassEnabled(boolean enabled) {
compassEnabled = enabled;
return this;
@@ -335,6 +344,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions compassGravity(int gravity) {
compassGravity = gravity;
return this;
@@ -346,6 +356,7 @@ public class MapboxMapOptions implements Parcelable {
* @param margins 4 long array for LTRB margins
* @return This
*/
+ @NonNull
public MapboxMapOptions compassMargins(int[] margins) {
compassMargins = margins;
return this;
@@ -360,6 +371,7 @@ public class MapboxMapOptions implements Parcelable {
* @param compassFadeWhenFacingNorth true is mapbox_compass_icon fades to invisble
* @return This
*/
+ @NonNull
public MapboxMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth) {
this.fadeCompassFacingNorth = compassFadeWhenFacingNorth;
return this;
@@ -374,6 +386,7 @@ public class MapboxMapOptions implements Parcelable {
* @param compass the drawable to show as image compass
* @return This
*/
+ @NonNull
public MapboxMapOptions compassImage(Drawable compass) {
this.compassImage = compass;
return this;
@@ -385,6 +398,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and logo is shown
* @return This
*/
+ @NonNull
public MapboxMapOptions logoEnabled(boolean enabled) {
logoEnabled = enabled;
return this;
@@ -396,6 +410,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions logoGravity(int gravity) {
logoGravity = gravity;
return this;
@@ -407,6 +422,7 @@ public class MapboxMapOptions implements Parcelable {
* @param margins 4 long array for LTRB margins
* @return This
*/
+ @NonNull
public MapboxMapOptions logoMargins(int[] margins) {
logoMargins = margins;
return this;
@@ -418,6 +434,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and attribution is shown
* @return This
*/
+ @NonNull
public MapboxMapOptions attributionEnabled(boolean enabled) {
attributionEnabled = enabled;
return this;
@@ -429,6 +446,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions attributionGravity(int gravity) {
attributionGravity = gravity;
return this;
@@ -440,6 +458,7 @@ public class MapboxMapOptions implements Parcelable {
* @param margins 4 long array for LTRB margins
* @return This
*/
+ @NonNull
public MapboxMapOptions attributionMargins(int[] margins) {
attributionMargins = margins;
return this;
@@ -451,6 +470,7 @@ public class MapboxMapOptions implements Parcelable {
* @param color integer resembling a color
* @return This
*/
+ @NonNull
public MapboxMapOptions attributionTintColor(@ColorInt int color) {
attributionTintColor = color;
return this;
@@ -462,6 +482,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions rotateGesturesEnabled(boolean enabled) {
rotateGesturesEnabled = enabled;
return this;
@@ -473,6 +494,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions scrollGesturesEnabled(boolean enabled) {
scrollGesturesEnabled = enabled;
return this;
@@ -484,6 +506,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions tiltGesturesEnabled(boolean enabled) {
tiltGesturesEnabled = enabled;
return this;
@@ -495,6 +518,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions zoomGesturesEnabled(boolean enabled) {
zoomGesturesEnabled = enabled;
return this;
@@ -506,6 +530,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions doubleTapGesturesEnabled(boolean enabled) {
doubleTapGesturesEnabled = enabled;
return this;
@@ -524,11 +549,13 @@ public class MapboxMapOptions implements Parcelable {
* @param textureMode True to enable texture mode
* @return This
*/
+ @NonNull
public MapboxMapOptions textureMode(boolean textureMode) {
this.textureMode = textureMode;
return this;
}
+ @NonNull
public MapboxMapOptions translucentTextureSurface(boolean translucentTextureSurface) {
this.translucentTextureSurface = translucentTextureSurface;
return this;
@@ -540,6 +567,7 @@ public class MapboxMapOptions implements Parcelable {
* @param loadColor the color to show during map creation
* @return This
*/
+ @NonNull
public MapboxMapOptions foregroundLoadColor(@ColorInt int loadColor) {
this.foregroundLoadColor = loadColor;
return this;
@@ -553,6 +581,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enable true to enable
* @return This
*/
+ @NonNull
public MapboxMapOptions setPrefetchesTiles(boolean enable) {
this.prefetchesTiles = enable;
return this;
@@ -568,6 +597,7 @@ public class MapboxMapOptions implements Parcelable {
* @param crossSourceCollisions true to enable, false to disable
* @return This
*/
+ @NonNull
public MapboxMapOptions crossSourceCollisions(boolean crossSourceCollisions) {
this.crossSourceCollisions = crossSourceCollisions;
return this;
@@ -583,6 +613,7 @@ public class MapboxMapOptions implements Parcelable {
* @param fontFamily font family for local ideograph generation.
* @return This
*/
+ @NonNull
public MapboxMapOptions localIdeographFontFamily(String fontFamily) {
this.localIdeographFontFamily = fontFamily;
return this;
@@ -595,6 +626,7 @@ public class MapboxMapOptions implements Parcelable {
* @param pixelRatio the custom pixel ratio of the map under construction
* @return This
*/
+ @NonNull
public MapboxMapOptions pixelRatio(float pixelRatio) {
this.pixelRatio = pixelRatio;
return this;
@@ -896,7 +928,7 @@ public class MapboxMapOptions implements Parcelable {
}
public static final Parcelable.Creator<MapboxMapOptions> CREATOR = new Parcelable.Creator<MapboxMapOptions>() {
- public MapboxMapOptions createFromParcel(Parcel in) {
+ public MapboxMapOptions createFromParcel(@NonNull Parcel in) {
return new MapboxMapOptions(in);
}
@@ -911,7 +943,7 @@ public class MapboxMapOptions implements Parcelable {
}
@Override
- public void writeToParcel(Parcel dest, int flags) {
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeParcelable(cameraPosition, flags);
dest.writeByte((byte) (debugActive ? 1 : 0));
@@ -954,7 +986,7 @@ public class MapboxMapOptions implements Parcelable {
}
@Override
- public boolean equals(Object o) {
+ public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}