From 4a769077af23daac2e54db7b1897a9dcea9e742c Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 6 Dec 2018 15:13:44 +0200 Subject: [android] - add missing javadoc on public API methods around Style --- .../java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 49 ++++++++++++++++++++++ .../main/java/com/mapbox/mapboxsdk/maps/Style.java | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) 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 3d5aa217eb..c20007481b 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 @@ -736,18 +736,67 @@ public final class MapboxMap { // Styling // + /** + * Loads a new map style from the specified bundled style. + *

+ * This method is asynchronous and will return before the style finishes loading. + * If you wish to wait for the map to finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener} + * callback or use the {@link #setStyle(String, Style.OnStyleLoaded)} method instead. + *

+ * If the style fails to load or an invalid style URL is set, the map view will become blank. + * An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback + * will be triggered. + * + * @param style The bundled style + * @see Style + */ public void setStyle(@Style.StyleUrl String style) { this.setStyle(style, null); } + /** + * Loads a new map style from the specified bundled style. + *

+ * If the style fails to load or an invalid style URL is set, the map view will become blank. + * An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback + * will be triggered. + *

+ * + * @param style The bundled style + * @param callback The callback to be invoked when the style has loaded + * @see Style + */ public void setStyle(@Style.StyleUrl String style, final Style.OnStyleLoaded callback) { this.setStyle(new Style.Builder().fromUrl(style), callback); } + /** + * Loads a new map style from the specified builder. + *

+ * If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat + * and {@link MapView.OnDidFailLoadingMapListener} callback will be triggered. If you wish to wait for the map to + * finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener} callback or use the + * {@link #setStyle(String, Style.OnStyleLoaded)} instead. + *

+ * + * @param builder The style builder + * @see Style + */ public void setStyle(Style.Builder builder) { this.setStyle(builder, null); } + /** + * Loads a new map style from the specified builder. + *

+ * If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat + * and {@link MapView.OnDidFailLoadingMapListener} callback will be triggered. + *

+ * + * @param builder The style builder + * @param callback The callback to be invoked when the style has loaded + * @see Style + */ public void setStyle(Style.Builder builder, final Style.OnStyleLoaded callback) { locationComponent.onStartLoadingMap(); if (style != null) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java index d9561aa778..04153916eb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java @@ -433,7 +433,7 @@ public class Style { // /** - * TODO + * Builder for composing a style object. */ public static class Builder { -- cgit v1.2.1