mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Merge pull request #1320 from commons-app/changeCurrentLocationMarkerIcon
Change current location marker icon
This commit is contained in:
		
						commit
						499591d0ca
					
				
					 3 changed files with 7 additions and 5 deletions
				
			
		|  | @ -32,6 +32,8 @@ import com.google.gson.Gson; | |||
| import com.google.gson.GsonBuilder; | ||||
| import com.google.gson.reflect.TypeToken; | ||||
| import com.mapbox.mapboxsdk.Mapbox; | ||||
| import com.mapbox.mapboxsdk.annotations.Icon; | ||||
| import com.mapbox.mapboxsdk.annotations.IconFactory; | ||||
| import com.mapbox.mapboxsdk.annotations.Marker; | ||||
| import com.mapbox.mapboxsdk.annotations.MarkerOptions; | ||||
| import com.mapbox.mapboxsdk.annotations.PolygonOptions; | ||||
|  | @ -423,10 +425,14 @@ public class NearbyMapFragment extends DaggerFragment { | |||
|         if (currentLocationMarker != null) { | ||||
|             currentLocationMarker.remove(); // Remove previous marker, we are not Hansel and Gretel | ||||
|         } | ||||
| 
 | ||||
|         Icon icon = IconFactory.getInstance(getContext()).fromResource(R.drawable.current_location_marker); | ||||
| 
 | ||||
|         MarkerOptions currentLocationMarkerOptions = new MarkerOptions() | ||||
|                 .position(new LatLng(curLatLng.getLatitude(), curLatLng.getLongitude())); | ||||
|         currentLocationMarker = mapboxMap.addMarker(currentLocationMarkerOptions); | ||||
|         currentLocationMarkerOptions.setIcon(icon); // Set custom icon | ||||
| 
 | ||||
|         currentLocationMarker = mapboxMap.addMarker(currentLocationMarkerOptions); | ||||
| 
 | ||||
|         List<LatLng> circle = createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(), | ||||
|                 curLatLng.getAccuracy() * 2, 100); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Josephine Lim
						Josephine Lim