/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="location">Coordinate.</param> /// <param name="image">Bitmap.</param> /// <param name="alignment">Alignment.</param> public MapMarker(GeoCoordinate location, MapControlAlignmentType alignment, UIImage image) : base(new UIButton(UIButtonType.Custom), location, alignment, (int)image.Size.Width, (int)image.Size.Height) { _image = image; this.View.SetImage(image, UIControlState.Normal); this.View.SetImage(image, UIControlState.Highlighted); this.View.SetImage(image, UIControlState.Disabled); }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="point">Point.</param> /// <param name="image">Bitmap.</param> /// <param name="alignment">Alignment.</param> public MapMarker(CGPoint point, MapControlAlignmentType alignment, UIImage image) : base(new UIButton(UIButtonType.Custom), point, alignment, (int)image.Size.Width, (int)image.Size.Height) { _image = image; this.View.SetImage(image, UIControlState.Normal); this.View.SetImage(image, UIControlState.Highlighted); this.View.SetImage(image, UIControlState.Disabled); this.View.TouchUpInside += view_TouchUpInside; this.TogglePopupOnClick = true; }
/// <summary> /// Initializes a new instance of the <see cref="OsmSharp.Android.UI.MapMarker"/> class. /// </summary> /// <param name="context">Context.</param> /// <param name="location">Coordinate.</param> /// <param name="image">Bitmap.</param> /// <param name="alignment">The alignment.</param> public MapMarker(Context context, GeoCoordinate location, MapControlAlignmentType alignment, global::Android.Graphics.Bitmap image) : base(new ImageButton(context), location, alignment, image.Width, image.Height) { this.View.SetBackgroundColor(global::Android.Graphics.Color.Transparent); this.View.SetPadding(1, 1, 1, 1); _image = image; this.View.SetImageBitmap(image); this.View.SetScaleType(global::Android.Widget.ImageView.ScaleType.FitCenter); }
/// <summary> /// Initializes a new instance of the <see cref="OsmSharp.Android.UI.MapMarker"/> class. /// </summary> /// <param name="context">Context.</param> /// <param name="location">Coordinate.</param> /// <param name="image">Bitmap.</param> /// <param name="alignment">The alignment.</param> public MapMarker(Context context, GeoCoordinate location, MapControlAlignmentType alignment, global::Android.Graphics.Bitmap image) : base(new ImageButton(context), location, alignment, ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { _context = context; this.View.SetBackgroundColor(global::Android.Graphics.Color.Transparent); this.View.SetPadding(1, 1, 1, 1); _image = image; this.View.SetImageBitmap(image); this.View.SetScaleType(global::Android.Widget.ImageView.ScaleType.FitCenter); this.View.Click += View_Click; this.TogglePopupOnClick = true; }
/// <summary> /// Initializes a new instance of the <see cref="OsmSharp.Android.UI.MapMarker"/> class. /// </summary> /// <param name="context"></param> /// <param name="location"></param> /// <param name="alignment"></param> /// <param name="res"></param> /// <param name="id"></param> public MapMarker(Context context, GeoCoordinate location, MapControlAlignmentType alignment, Resources res, int id) : base(new ImageButton(context), location, alignment) { _image = BitmapFactory.DecodeResource(res, id); _context = context; this.SetSize(_image.Width, _image.Height); this.View.SetBackgroundColor(global::Android.Graphics.Color.Transparent); this.View.SetPadding(1, 1, 1, 1); this.View.SetImageBitmap(_image); this.View.SetScaleType(global::Android.Widget.ImageView.ScaleType.FitCenter); this.View.Click += View_Click; this.TogglePopupOnClick = true; }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="location">Coordinate.</param> /// <param name="marker">Alignment.</param> public MapMarker(GeoCoordinate location, MapControlAlignmentType alignment) : this(location, alignment, MapMarker.GetDefaultImage()) { }
/// <summary> /// Initializes a new instance of the <see cref="SomeTestProject.MapMarker"/> class. /// </summary> /// <param name="point">Point.</param> /// <param name="marker">Alignment.</param> public MapMarker(CGPoint point, MapControlAlignmentType alignment) : this(point, alignment, MapMarker.GetDefaultImage()) { }