diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-11-08 14:11:12 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-12-10 16:59:50 +0100 |
commit | 470bc66f0fdadb2eb862953998a1ee433b49bc14 (patch) | |
tree | 688cc93d09572d7ffff46fc1b6a925b5794dd08e /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | |
parent | d68dfe0551d75fde860f97a94f57fea487afd55e (diff) | |
download | qtlocation-mapboxgl-470bc66f0fdadb2eb862953998a1ee433b49bc14.tar.gz |
[android] - remove style loaded listener
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 | 79 |
1 files changed, 4 insertions, 75 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 c0c870c2c3..6d68302c61 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 @@ -61,7 +61,6 @@ public final class MapboxMap { private final Transform transform; private final AnnotationManager annotationManager; private final CameraChangeDispatcher cameraChangeDispatcher; - private final MapChangeReceiver mapChangeReceiver; private final OnGesturesManagerInteractionListener onGesturesManagerInteractionListener; @@ -73,7 +72,7 @@ public final class MapboxMap { MapboxMap(NativeMapView map, Transform transform, UiSettings ui, Projection projection, OnGesturesManagerInteractionListener listener, AnnotationManager annotations, - CameraChangeDispatcher cameraChangeDispatcher, MapChangeReceiver mapChangeReceiver) { + CameraChangeDispatcher cameraChangeDispatcher) { this.nativeMapView = map; this.style = new Style(nativeMapView); this.uiSettings = ui; @@ -82,7 +81,6 @@ public final class MapboxMap { this.transform = transform; this.onGesturesManagerInteractionListener = listener; this.cameraChangeDispatcher = cameraChangeDispatcher; - this.mapChangeReceiver = mapChangeReceiver; } void initialise(@NonNull Context context, @NonNull MapboxMapOptions options) { @@ -702,7 +700,7 @@ public final class MapboxMap { * <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 #setStyleUrl(String, OnStyleLoadedListener)} method instead. + * 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 @@ -712,47 +710,6 @@ public final class MapboxMap { * @see Style */ public void setStyleUrl(@NonNull String url) { - setStyleUrl(url, null); - } - - /** - * <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> - * 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 url The URL of the map style - * @param callback The callback that is invoked when the style has loaded. - * @see Style - */ - public void setStyleUrl(@NonNull final String url, @Nullable final OnStyleLoadedListener callback) { - if (callback != null) { - mapChangeReceiver.addOnDidFinishLoadingStyleListener(new MapView.OnDidFinishLoadingStyleListener() { - @Override - public void onDidFinishLoadingStyle() { - callback.onStyleLoaded(url); - mapChangeReceiver.removeOnDidFinishLoadingStyleListener(this); - } - }); - } nativeMapView.setStyleUrl(url); } @@ -763,7 +720,7 @@ public final class MapboxMap { * <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, OnStyleLoadedListener)} method instead. + * 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 @@ -777,22 +734,6 @@ public final class MapboxMap { } /** - * <p> - * 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. - * - * @param style The bundled style. - * @param callback The callback to be invoked when the style has finished loading - * @see Style - */ - public void setStyle(@NonNull @Style.StyleUrl String style, @Nullable OnStyleLoadedListener callback) { - setStyleUrl(style, callback); - } - - /** * Loads a new map style from MapboxMapOptions if available. * * @param options the object containing the style url @@ -800,7 +741,7 @@ public final class MapboxMap { private void setStyleUrl(@NonNull MapboxMapOptions options) { String style = options.getStyleUrl(); if (!TextUtils.isEmpty(style)) { - setStyleUrl(style, null); + setStyleUrl(style); } } @@ -2178,18 +2119,6 @@ public final class MapboxMap { void onSnapshotReady(@NonNull Bitmap snapshot); } - /** - * Interface definition for a callback to be invoked when the style has finished loading. - */ - public interface OnStyleLoadedListener { - /** - * Invoked when the style has finished loading - * - * @param style the style that has been loaded - */ - void onStyleLoaded(@NonNull String style); - } - // // Used for instrumentation testing // |