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.java39
1 files changed, 36 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 3fac981fe5..f1d1c1715d 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
@@ -143,6 +143,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;
@@ -250,6 +251,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;
@@ -261,6 +263,7 @@ public class MapboxMapOptions implements Parcelable {
* @param cameraPosition Inital camera position
* @return This
*/
+ @NonNull
public MapboxMapOptions camera(CameraPosition cameraPosition) {
this.cameraPosition = cameraPosition;
return this;
@@ -272,6 +275,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;
@@ -283,6 +287,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;
@@ -294,6 +299,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;
@@ -305,6 +311,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;
@@ -316,6 +323,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;
@@ -327,6 +335,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;
@@ -338,6 +347,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions compassGravity(int gravity) {
compassGravity = gravity;
return this;
@@ -349,6 +359,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;
@@ -363,6 +374,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;
@@ -377,6 +389,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;
@@ -388,6 +401,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;
@@ -399,6 +413,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions logoGravity(int gravity) {
logoGravity = gravity;
return this;
@@ -410,6 +425,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;
@@ -421,6 +437,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;
@@ -432,6 +449,7 @@ public class MapboxMapOptions implements Parcelable {
* @param gravity Android SDK Gravity.
* @return This
*/
+ @NonNull
public MapboxMapOptions attributionGravity(int gravity) {
attributionGravity = gravity;
return this;
@@ -443,6 +461,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;
@@ -454,6 +473,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;
@@ -465,6 +485,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;
@@ -476,6 +497,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;
@@ -487,6 +509,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;
@@ -498,6 +521,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enabled True and gesture will be enabled
* @return This
*/
+ @NonNull
public MapboxMapOptions zoomControlsEnabled(boolean enabled) {
zoomControlsEnabled = enabled;
return this;
@@ -509,6 +533,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;
@@ -520,6 +545,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;
@@ -538,11 +564,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;
@@ -554,6 +582,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;
@@ -567,6 +596,7 @@ public class MapboxMapOptions implements Parcelable {
* @param enable true to enable
* @return This
*/
+ @NonNull
public MapboxMapOptions setPrefetchesTiles(boolean enable) {
this.prefetchesTiles = enable;
return this;
@@ -582,6 +612,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;
@@ -597,6 +628,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;
@@ -609,6 +641,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;
@@ -919,7 +952,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);
}
@@ -934,7 +967,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));
@@ -978,7 +1011,7 @@ public class MapboxMapOptions implements Parcelable {
}
@Override
- public boolean equals(Object o) {
+ public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}