summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-12-06 15:13:44 +0200
committerTobrun <tobrun@mapbox.com>2018-12-10 16:59:50 +0100
commit4a769077af23daac2e54db7b1897a9dcea9e742c (patch)
tree82b96b837cf9877473ced975f73c1db2123b1a0e
parent8e067868e70db4d2865dbce00d38b221794185d5 (diff)
downloadqtlocation-mapboxgl-4a769077af23daac2e54db7b1897a9dcea9e742c.tar.gz
[android] - add missing javadoc on public API methods around Style
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java49
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java2
2 files changed, 50 insertions, 1 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 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.
+ * <p>
+ * 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.
+ * </p>
+ * 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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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 {