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.java31
1 files changed, 30 insertions, 1 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 02c50c9f18..0075199b1e 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
@@ -30,6 +30,7 @@ import java.util.Arrays;
*/
public class MapboxMapOptions implements Parcelable {
+ private static final int LIGHT_GRAY = 0xFFF0E9E1; // RGB(240, 233, 225))
private static final float FOUR_DP = 4f;
private static final float NINETY_TWO_DP = 92f;
private static final int UNDEFINED_COLOR = -1;
@@ -73,6 +74,9 @@ public class MapboxMapOptions implements Parcelable {
private boolean textureMode;
private boolean translucentTextureSurface;
+ @ColorInt
+ private int foregroundLoadColor;
+
private String style;
private float pixelRatio;
@@ -124,6 +128,7 @@ public class MapboxMapOptions implements Parcelable {
zMediaOverlay = in.readByte() != 0;
localIdeographFontFamily = in.readString();
pixelRatio = in.readFloat();
+ foregroundLoadColor = in.readInt();
}
/**
@@ -209,7 +214,6 @@ public class MapboxMapOptions implements Parcelable {
FOUR_DP * pxlRatio)),
(int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginBottom,
FOUR_DP * pxlRatio))});
-
mapboxMapOptions.textureMode(
typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_renderTextureMode, false));
mapboxMapOptions.translucentTextureSurface(
@@ -222,6 +226,9 @@ public class MapboxMapOptions implements Parcelable {
typedArray.getString(R.styleable.mapbox_MapView_mapbox_localIdeographFontFamily));
mapboxMapOptions.pixelRatio(
typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_pixelRatio, 0));
+ mapboxMapOptions.foregroundLoadColor(
+ typedArray.getInt(R.styleable.mapbox_MapView_mapbox_foregroundLoadColor, LIGHT_GRAY)
+ );
} finally {
typedArray.recycle();
}
@@ -522,6 +529,17 @@ public class MapboxMapOptions implements Parcelable {
}
/**
+ * Set the MapView foreground color that is used when the map surface is being created.
+ *
+ * @param loadColor the color to show during map creation
+ * @return This
+ */
+ public MapboxMapOptions foregroundLoadColor(@ColorInt int loadColor) {
+ this.foregroundLoadColor = loadColor;
+ return this;
+ }
+
+ /**
* Enable tile pre-fetching. Loads tiles at a lower zoom-level to pre-render
* a low resolution preview while more detailed tiles are loaded.
* Enabled by default
@@ -820,6 +838,16 @@ public class MapboxMapOptions implements Parcelable {
}
/**
+ * Returns the current configured foreground color that is used during map creation.
+ *
+ * @return the load color
+ */
+ @ColorInt
+ public int getForegroundLoadColor() {
+ return foregroundLoadColor;
+ }
+
+ /**
* Returns the font-family for locally overriding generation of glyphs in the
* 'CJK Unified Ideographs' and 'Hangul Syllables' ranges.
*
@@ -892,6 +920,7 @@ public class MapboxMapOptions implements Parcelable {
dest.writeByte((byte) (zMediaOverlay ? 1 : 0));
dest.writeString(localIdeographFontFamily);
dest.writeFloat(pixelRatio);
+ dest.writeInt(foregroundLoadColor);
}
@Override