diff options
author | langsmith <langstonlmcs@gmail.com> | 2019-01-29 16:44:18 -0800 |
---|---|---|
committer | langsmith <langstonlmcs@gmail.com> | 2019-01-29 16:44:18 -0800 |
commit | cffb1e319a453257c442eb045da89ae2f1682f9c (patch) | |
tree | 90f2e849f2adff462c55496264b8d44292c14267 | |
parent | 2d5ae838821f351b654b23a5773da858dcb64e2f (diff) | |
download | qtlocation-mapboxgl-cffb1e319a453257c442eb045da89ae2f1682f9c.tar.gz |
[android] added new activateLocationComponent method
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java index 92b4288c3b..538fce7192 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java @@ -263,6 +263,30 @@ public final class LocationComponent { /** * This method initializes the component and needs to be called before any other operations are performed. * Afterwards, you can manage component's visibility by {@link #setLocationComponentEnabled(boolean)}. + * + * @param context the context + * @param style the proxy object for current map style. More info at {@link Style} + * @param useDefaultLocationEngine true if you want to initialize and use the built-in location engine or false if + * there should be no location engine initialized + * @param locationEngineRequest the location request + * @param options the options + */ + @RequiresPermission(anyOf = {ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION}) + public void activateLocationComponent(@NonNull Context context, @NonNull Style style, + boolean useDefaultLocationEngine, + @NonNull LocationEngineRequest locationEngineRequest, + @NonNull LocationComponentOptions options) { + setLocationEngineRequest(locationEngineRequest); + if (useDefaultLocationEngine) { + activateLocationComponent(context, style, options); + } else { + activateLocationComponent(context, style, null, options); + } + } + + /** + * This method initializes the component and needs to be called before any other operations are performed. + * Afterwards, you can manage component's visibility by {@link #setLocationComponentEnabled(boolean)}. * <p> * <strong>Note</strong>: This method will initialize and use an internal {@link LocationEngine} when enabled. * |