mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Bug fix- current location marker (#4580)
This commit is contained in:
parent
e8556a8ecd
commit
e666e768c2
1 changed files with 6 additions and 4 deletions
|
|
@ -1184,7 +1184,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
public void addCurrentLocationMarker(final fr.free.nrw.commons.location.LatLng curLatLng) {
|
public void addCurrentLocationMarker(final fr.free.nrw.commons.location.LatLng curLatLng) {
|
||||||
if (null != curLatLng && !isPermissionDenied) {
|
if (null != curLatLng && !isPermissionDenied) {
|
||||||
ExecutorUtils.get().submit(() -> {
|
ExecutorUtils.get().submit(() -> {
|
||||||
removeCurrentLocationMarker();
|
mapView.post(() -> removeCurrentLocationMarker());
|
||||||
Timber.d("Adds current location marker");
|
Timber.d("Adds current location marker");
|
||||||
|
|
||||||
final Icon icon = IconFactory.getInstance(getContext())
|
final Icon icon = IconFactory.getInstance(getContext())
|
||||||
|
|
@ -1194,7 +1194,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
.position(new LatLng(curLatLng.getLatitude(),
|
.position(new LatLng(curLatLng.getLatitude(),
|
||||||
curLatLng.getLongitude()));
|
curLatLng.getLongitude()));
|
||||||
currentLocationMarkerOptions.setIcon(icon); // Set custom icon
|
currentLocationMarkerOptions.setIcon(icon); // Set custom icon
|
||||||
currentLocationMarker = mapBox.addMarker(currentLocationMarkerOptions);
|
mapView.post(
|
||||||
|
() -> currentLocationMarker = mapBox.addMarker(currentLocationMarkerOptions));
|
||||||
|
|
||||||
final List<LatLng> circle = UiUtils
|
final List<LatLng> circle = UiUtils
|
||||||
.createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(),
|
.createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(),
|
||||||
|
|
@ -1204,8 +1205,9 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
.addAll(circle)
|
.addAll(circle)
|
||||||
.strokeColor(getResources().getColor(R.color.current_marker_stroke))
|
.strokeColor(getResources().getColor(R.color.current_marker_stroke))
|
||||||
.fillColor(getResources().getColor(R.color.current_marker_fill));
|
.fillColor(getResources().getColor(R.color.current_marker_fill));
|
||||||
currentLocationPolygon = mapBox.addPolygon(currentLocationPolygonOptions);
|
mapView.post(
|
||||||
|
() -> currentLocationPolygon = mapBox
|
||||||
|
.addPolygon(currentLocationPolygonOptions));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Timber.d("not adding current location marker..current location is null");
|
Timber.d("not adding current location marker..current location is null");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue