mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Fix multiple current location marker issue (#3243)
This commit is contained in:
		
							parent
							
								
									21503fc786
								
							
						
					
					
						commit
						1c470241e3
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		|  | @ -315,6 +315,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment | |||
|      */ | ||||
|     @Override | ||||
|     public void addCurrentLocationMarker(LatLng curLatLng) { | ||||
|         removeCurrentLocationMarker(); | ||||
|         Timber.d("Adds current location marker"); | ||||
| 
 | ||||
|         Icon icon = IconFactory.getInstance(getContext()).fromResource(R.drawable.current_location_marker); | ||||
|  | @ -336,8 +337,10 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment | |||
| 
 | ||||
|     @Override | ||||
|     public void removeCurrentLocationMarker() { | ||||
|         mapboxMap.removeMarker(currentLocationMarker); | ||||
|         mapboxMap.removePolygon(currentLocationPolygon); | ||||
|         if (currentLocationMarker != null) { | ||||
|             mapboxMap.removeMarker(currentLocationMarker); | ||||
|             mapboxMap.removePolygon(currentLocationPolygon); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
|  | @ -842,7 +842,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | |||
| 
 | ||||
|     @Override | ||||
|     public void recenterMap(fr.free.nrw.commons.location.LatLng curLatLng) { | ||||
|         nearbyMapFragment.removeCurrentLocationMarker(); | ||||
|         nearbyMapFragment.addCurrentLocationMarker(curLatLng); | ||||
|         CameraPosition position; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan