Search in sources :

Example 1 with LocationComponentOptions

use of com.mapbox.mapboxsdk.location.LocationComponentOptions in project apps-android-wikipedia by wikimedia.

the class NearbyFragment method enableUserLocationMarker.

@SuppressWarnings("MissingPermission")
private void enableUserLocationMarker() {
    if (mapboxMap != null && locationPermitted()) {
        LocationComponentOptions options = LocationComponentOptions.builder(requireActivity()).trackingGesturesManagement(true).build();
        LocationComponent locationComponent = mapboxMap.getLocationComponent();
        locationComponent.activateLocationComponent(requireActivity(), mapboxMap.getStyle(), options);
        locationComponent.setLocationComponentEnabled(true);
        locationComponent.setCameraMode(CameraMode.TRACKING);
        locationComponent.setRenderMode(RenderMode.COMPASS);
    }
}
Also used : LocationComponentOptions(com.mapbox.mapboxsdk.location.LocationComponentOptions) LocationComponent(com.mapbox.mapboxsdk.location.LocationComponent)

Aggregations

LocationComponent (com.mapbox.mapboxsdk.location.LocationComponent)1 LocationComponentOptions (com.mapbox.mapboxsdk.location.LocationComponentOptions)1