Example #1
0
        protected override void AddRiderToMap(CustomRider rider)
        {
            var responderIcon = new ResponderIcon(rider);

            _mapItems.Items.Add(responderIcon);
            SetMapIconPosition(responderIcon, rider.Position, new Point(0.5, 0.5));
        }
Example #2
0
        protected override void AddRiderToMap(CustomRider rider)
        {
            var riderIcon = new RiderIcon(rider);

            var markerOptions = riderIcon.MarkerOptions;

            markerOptions.SetPosition(new LatLng(rider.Latitude, rider.Longitude));

            Marker marker = _nativeMap.AddMarker(riderIcon.MarkerOptions);

            _ridersMappings.Add(rider.Id, marker);
        }
        protected override void AddRiderToMap(CustomRider rider)
        {
            var annotation = new RiderAnnotation(new
                                                 CLLocationCoordinate2D
            {
                Latitude  = rider.Latitude,
                Longitude = rider.Longitude
            },
                                                 rider);

            _nativeMap.AddAnnotation(annotation);
        }
Example #4
0
        public ResponderIcon(CustomRider rider)
        {
            InitializeComponent();

            Rider = rider;

            var color = Rider.Color.ToMediaColor();

            StatusColor.Fill = new SolidColorBrush(color);

            ResponderType.Text = Rider.Acronym;
        }
        public RiderIcon(CustomRider rider)
            : base()
        {
            Rider = rider;

            _inflater      = LayoutInflater.From(Xamarin.Forms.Forms.Context);
            _riderIconView = _inflater.Inflate(Resource.Layout.rider_icon_content, null);

            var responderType = _riderIconView.FindViewById <TextView>(Resource.Id.responder_type);

            responderType.Text = Rider.Acronym;
            GradientDrawable drawable = (GradientDrawable)responderType.Background;

            drawable.SetColor(Rider.Color.ToAndroid());

            MarkerOptions.SetTitle(Rider.Acronym);
            MarkerOptions.SetSnippet(Rider.Address);

            Bitmap icon = _riderIconView.AsBitmap(Xamarin.Forms.Forms.Context, 60, 60);

            MarkerOptions.SetIcon(BitmapDescriptorFactory.FromBitmap(icon));
        }
        public CustomRider CreateRidePin()
        {
            var pin = new CustomRider()
            {
                Id          = string.IsNullOrEmpty(Id) ? UserPrincipalName : Id,
                Title       = GivenName,
                Description = GivenName
            };

            if (HasLocation())
            {
                pin.Longitude = Longitude.Value;
                pin.Latitude  = Latitude.Value;
            }

            pin.Color = ProfileColor;

            if (!string.IsNullOrEmpty(DisplayName))
            {
                var split = DisplayName.Split(' ');
                if (split.Any())
                {
                    pin.Acronym = string.Format("{0}{1}",
                                                split.First().Substring(0, 1),
                                                split.Last().Substring(0, 1));
                }
            }
            else
            {
                pin.Acronym = string.Format("{0}{1}",
                                            UserPrincipalName.Substring(0, 1),
                                            UserPrincipalName.Substring(1, 2));
            }


            return(pin);
        }
Example #7
0
 protected abstract void AddRiderToMap(CustomRider rider);
 public RiderAnnotationView(IMKAnnotation annotation, CustomRider rider)
     : base(annotation, CustomReuseIdentifier)
 {
     Rider = rider;
 }
 public RiderAnnotation(CLLocationCoordinate2D coordinate, CustomRider rider)
     : base(coordinate)
 {
     Rider = rider;
 }
 public void LoadResponderData(CustomRider rider)
 {
     NameLabel.Text = rider.Acronym;
 }