don’t throw error if location is not set
This commit is contained in:
parent
df839b4c03
commit
eefd8134c3
1 changed files with 3 additions and 2 deletions
|
@ -103,7 +103,8 @@ public class MapFragment extends FragmentBase<FragmentMapBinding> {
|
|||
var map = this.getBinding().map;
|
||||
map.getOverlays().clear();
|
||||
this.subscribe(this.getClient().toObservable()
|
||||
.flatMap(client -> client.streamObjects().toObservable()),
|
||||
.flatMap(client -> client.streamObjects().toObservable())
|
||||
.filter(item -> item.lastKnownLocation().isPresent()),
|
||||
this::addMarker);
|
||||
}
|
||||
|
||||
|
@ -117,7 +118,7 @@ public class MapFragment extends FragmentBase<FragmentMapBinding> {
|
|||
config.setUserAgentValue(this.requireActivity().getPackageName()); // Set the user agent for mapnik
|
||||
config.setOsmdroidBasePath(this.requireActivity().getFilesDir()); // Technically not necessary, but recommended
|
||||
config.setOsmdroidTileCache(this.requireActivity().getCacheDir()); // Set the cache directory
|
||||
map.setMultiTouchControls(true);
|
||||
map.setMultiTouchControls(true);
|
||||
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this.requireActivity()); // Initialize the fused location provider
|
||||
this.tryRestoreState(); // Restore state if possible
|
||||
this.getBinding().fab.setOnClickListener(__ -> this.navigate(R.id.action_mapFragment_to_QRScanFragment));
|
||||
|
|
Loading…
Reference in a new issue