public AndroidBitmapDescriptor ToNative(Xamarin.Forms.GoogleMaps.BitmapDescriptor descriptor)
        {
            var defaultFactory = DefaultBitmapDescriptorFactory.Instance;

            if (!string.IsNullOrEmpty(descriptor.Id))
            {
                var cacheEntry = _cache.GetOrAdd(descriptor.Id, _ => defaultFactory.ToNative(descriptor));
                return(cacheEntry);
            }

            return(defaultFactory.ToNative(descriptor));
        }
示例#2
0
 /// <summary>
 /// Sets the rendering method to use custom bitmap image.
 /// </summary>
 /// <param name="image">The BitmapDescriptor image. The number of items will be drawn automatically on top of this image.</param>
 /// <param name="textColor">The text color.</param>
 public void SetRenderUsingImage(BitmapDescriptor image, Color textColor)
 {
     this.RendererTextColor = textColor;
     this.RendererImage     = image;
     this.RendererCallback  = null;
 }
示例#3
0
 /// <summary>
 /// Sets the rendering method to use custom bitmap image.
 /// </summary>
 /// <param name="image">The BitmapDescriptor image. The number of items will be drawn automatically on top of this image.</param>
 public void SetRenderUsingImage(BitmapDescriptor image)
 {
     this.SetRenderUsingImage(image, Color.White);
 }
示例#4
0
 public static BitmapDescriptor DefaultMarker(Color color)
 {
     return(BitmapDescriptor.DefaultMarker(color, color.GetHashCode().ToString()));
 }
示例#5
0
 public static BitmapDescriptor FromView(View view, string id = null)
 {
     return(BitmapDescriptor.FromView(view, id));
 }
示例#6
0
 public static BitmapDescriptor FromStream(Stream stream, string id = null)
 {
     return(BitmapDescriptor.FromStream(stream, id));
 }
示例#7
0
 public static BitmapDescriptor FromBundle(string bundleName)
 {
     return(BitmapDescriptor.FromBundle(bundleName, bundleName));
 }
 public static BitmapDescriptor DefaultMarker(Color color)
 {
     return(BitmapDescriptor.DefaultMarker(color));
 }
 public static BitmapDescriptor FromView(View view)
 {
     return(BitmapDescriptor.FromView(view));
 }
 public static BitmapDescriptor FromStream(Stream stream)
 {
     return(BitmapDescriptor.FromStream(stream));
 }