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 | 100 |
1 files changed, 4 insertions, 96 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 2211d4bd1d..0c4cbe92d1 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 @@ -679,63 +679,8 @@ public final class MapboxMap { // Styling // - public void setStyle(Style.Builder builder) { - - } - - - /** - * <p> - * Loads a new map style asynchronous from the specified URL. - * </p> - * {@code url} can take the following forms: - * <ul> - * <li>{@code Style.*}: load one of the bundled styles in {@link Style}.</li> - * <li>{@code mapbox://styles/<user>/<style>}: - * loads the style from a <a href="https://www.mapbox.com/account/">Mapbox account.</a> - * {@code user} is your username. {@code style} is the ID of your custom - * style created in <a href="https://www.mapbox.com/studio">Mapbox Studio</a>.</li> - * <li>{@code http://...} or {@code https://...}: - * loads the style over the Internet from any web server.</li> - * <li>{@code asset://...}: - * loads the style from the APK {@code assets/} directory. - * This is used to load a style bundled with your app.</li> - * <li>{@code null}: loads the default {@link Style#MAPBOX_STREETS} style.</li> - * </ul> - * <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. - * </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 url The URL of the map style - * @see Style - */ - public void setStyleUrl(@NonNull String url) { - nativeMapView.setStyleUrl(url); - } - - /** - * <p> - * Loads a new map style from the specified bundled style. - * </p> - * <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. - * </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(@NonNull @Style.StyleUrl String style) { - setStyleUrl(style); + public Style setStyle(Style.Builder builder) { + return style = builder.build(nativeMapView); } /** @@ -746,54 +691,17 @@ public final class MapboxMap { private void setStyleUrl(@NonNull MapboxMapOptions options) { String style = options.getStyleUrl(); if (!TextUtils.isEmpty(style)) { - setStyleUrl(style); + setStyle(new Style.Builder().withStyleUrl(style)); } } - /** - * Returns the map style url currently displayed in the map view. - * - * @return The URL of the map style - */ - @Nullable - public String getStyleUrl() { - return nativeMapView.getStyleUrl(); - } - - /** - * Loads a new map style from a json string. - * <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> - */ - public void setStyleJson(@NonNull String styleJson) { - nativeMapView.setStyleJson(styleJson); - } - - /** - * 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); + setStyle(new Style.Builder().withStyleJson(styleJson)); } } - /** - * Returns the map style json currently displayed in the map view. - * - * @return The json of the map style - */ - @NonNull - public String getStyleJson() { - return nativeMapView.getStyleJson(); - } - // // Annotations // |