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));
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public static BitmapDescriptor DefaultMarker(Color color)
 {
     return(BitmapDescriptor.DefaultMarker(color, color.GetHashCode().ToString()));
 }
Ejemplo n.º 5
0
 public static BitmapDescriptor FromView(View view, string id = null)
 {
     return(BitmapDescriptor.FromView(view, id));
 }
Ejemplo n.º 6
0
 public static BitmapDescriptor FromStream(Stream stream, string id = null)
 {
     return(BitmapDescriptor.FromStream(stream, id));
 }
Ejemplo n.º 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));
 }