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);
}
}
Aggregations