diff options
author | Pablo Guardiola <guardiola31337@gmail.com> | 2017-04-20 20:10:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 20:10:29 +0200 |
commit | c6be40b71b2f81f07e24c14f0b9624b0fcf85798 (patch) | |
tree | 276e05bd8c40a6852dfbfacf6345fb7d3bd0be09 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | |
parent | 97f2a448594d7f904f298c61ab7ba673418d36e5 (diff) | |
download | qtlocation-mapboxgl-c6be40b71b2f81f07e24c14f0b9624b0fcf85798.tar.gz |
[android] Add a way to use a custom location source (#8710)
* add a way to use a custom location source
* add custom location engine example to test app
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 | 14 |
1 files changed, 14 insertions, 0 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 be301839eb..79d36667ff 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 @@ -37,10 +37,12 @@ import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; +import com.mapbox.mapboxsdk.location.LocationSource; import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; import com.mapbox.mapboxsdk.style.layers.Filter; import com.mapbox.mapboxsdk.style.layers.Layer; import com.mapbox.mapboxsdk.style.sources.Source; +import com.mapbox.services.android.telemetry.location.LocationEngine; import com.mapbox.services.commons.geojson.Feature; import java.lang.reflect.ParameterizedType; @@ -1773,6 +1775,18 @@ public final class MapboxMap { } /** + * Replaces the location source of the my-location layer. + * + * @param locationSource A {@link LocationEngine} location source to use in the my-location layer. + * Set to null to use the default {@link LocationSource} + * location source. + */ + @UiThread + public void setLocationSource(@Nullable LocationEngine locationSource) { + trackingSettings.setLocationSource(locationSource); + } + + /** * Sets a callback that's invoked when the location tracking mode changes. * * @param listener The callback that's invoked when the location tracking mode changes. |