Created
February 11, 2019 12:47
-
-
Save dev-aritra/1a2665464aaca6eb727f4114da50f857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xamarin.Forms.GoogleMaps; | |
using Xamarin.Forms.GoogleMaps.Android.Factories; | |
using AndroidBitmapDescriptor = Android.Gms.Maps.Model.BitmapDescriptor; | |
using AndroidBitmapDescriptorFactory = Android.Gms.Maps.Model.BitmapDescriptorFactory; | |
public sealed class AccessNativeBitmapConfig : IBitmapDescriptorFactory | |
{ | |
public AndroidBitmapDescriptor ToNative(BitmapDescriptor descriptor) | |
{ | |
int resId = 0; | |
switch (descriptor.Id) | |
{ | |
case "type2": | |
resId = Resource.Drawable.type2; | |
break; | |
case "type1": | |
resId = Resource.Drawable.type1; | |
break; | |
} | |
return AndroidBitmapDescriptorFactory.FromResource(resId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment