diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 0719412b4c..45e54a3d14 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -95,6 +95,7 @@ public final class MapboxMap { setDebugActive(options.getDebugActive()); setApiBaseUrl(options); setStyleUrl(options); + setStyleJson(options); setPrefetchesTiles(options); } @@ -433,7 +434,7 @@ public final class MapboxMap { } /** - * Removes the source, preserving the reverence for re-use + * Removes the source, preserving the reference for re-use * * @param source the source to remove * @return the source @@ -1058,7 +1059,7 @@ public final class MapboxMap { * @param options the object containing the style url */ private void setStyleUrl(@NonNull MapboxMapOptions options) { - String style = options.getStyle(); + String style = options.getStyleUrl(); if (!TextUtils.isEmpty(style)) { setStyleUrl(style, null); } @@ -1087,6 +1088,18 @@ public final class MapboxMap { } /** + * Loads a new map style json from MapboxMapOptions if available. + * + * @param options the object containing the style json + */ + private void setStyleJson(@NonNull MapboxMapOptions options) { + String styleJson = options.getStyleJson(); + if (!TextUtils.isEmpty(styleJson)) { + setStyleJson(styleJson); + } + } + + /** * Returns the map style json currently displayed in the map view. * * @return The json of the map style @@ -1601,7 +1614,7 @@ public final class MapboxMap { public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, @NonNull @Size(value = 4) int[] padding) { // we use current camera tilt/bearing value to provide expected transformations as #11993 - return getCameraForLatLngBounds(latLngBounds, padding, transform.getBearing(), transform.getTilt()); + return getCameraForLatLngBounds(latLngBounds, padding, transform.getRawBearing(), transform.getTilt()); } |