private void Render(Android.Gms.Maps.Model.Marker marker, View view) { int id_Imagen = 0; foreach (Ciudad_Marca ciudad in Ciudades) { if (marker.Equals(ciudad.Marcador)) { id_Imagen = parent.Resources.GetIdentifier(ciudad.Imagen, "drawable", parent.PackageName); } } ((ImageView)view.FindViewById(Resource.Id.badge)).SetImageResource(id_Imagen); System.String titulo = marker.Title; TextView txtTitulo = ((TextView)view.FindViewById(Resource.Id.title)); if (titulo != null) { txtTitulo.Text = titulo; } else { txtTitulo.Text = (""); } System.String descripcion = marker.Snippet; TextView txtDescripcion = ((TextView)view.FindViewById(Resource.Id.snippet)); if (descripcion != null) { txtDescripcion.Text = descripcion; } else { txtDescripcion.Text = ""; } }
public Android.Views.View GetInfoContents(Android.Gms.Maps.Model.Marker marker) { View v = inflater.Inflate(Resource.Layout.ParksListView_row, null); TextView textName = v.FindViewById <TextView> (Resource.Id.textName); textName.Text = Services.getName(int.Parse(marker.Title)); TextView textCompany = v.FindViewById <TextView> (Resource.Id.textCompany); textCompany.Text = Services.getCompany(int.Parse(marker.Title)); TextView textTimetable = v.FindViewById <TextView> (Resource.Id.textTimetable); textTimetable.Text = (Services.getPark(int.Parse(marker.Title)).StockingRate *100).ToString() + "% of empty spaces"; //String.Format(context.Resources.GetString(Resource.String.ParkData_Timetable), "7h", "19h"); TextView textPrice = v.FindViewById <TextView> (Resource.Id.textPrice); textPrice.Text = Services.getPricePerHour(int.Parse(marker.Title)) + " € per hour"; //String.Format(context.Resources.GetString(Resource.String.ParkData_Price), "6$"); return(v); }
Android.Views.View Android.Gms.Maps.GoogleMap.IInfoWindowAdapter.GetInfoWindow(Android.Gms.Maps.Model.Marker marker) { return(null); }
Android.Views.View Android.Gms.Maps.GoogleMap.IInfoWindowAdapter.GetInfoContents(Android.Gms.Maps.Model.Marker marker) { var pin = this.GetPinByMarker(marker); if (pin == null) { return(null); } var image = new ImageView(this.Context); image.SetImageResource(Resource.Drawable.icon); return(image); }
Android.Views.View Android.Gms.Maps.GoogleMap.IInfoWindowAdapter.GetInfoWindow(Android.Gms.Maps.Model.Marker marker) { System.Diagnostics.Debug.WriteLine("===========GetInfoWindow=============="); return(null); }
Android.Views.View Android.Gms.Maps.GoogleMap.IInfoWindowAdapter.GetInfoContents(Android.Gms.Maps.Model.Marker marker) { System.Diagnostics.Debug.WriteLine("===========GetInfoContents=============="); var pin = GetPinByMarker(marker); if (pin == null) { return(null); } var image = new ImageView(Context); image.SetImageResource(Resource.Drawable.icon); return(image); }
public View GetInfoWindow(Android.Gms.Maps.Model.Marker marker) { Render(marker, mWindow); return(mWindow); }
public View GetInfoContents(Android.Gms.Maps.Model.Marker p0) { throw new NotImplementedException(); }
public Android.Views.View GetInfoWindow(Android.Gms.Maps.Model.Marker marker) { return(null); }
Android.Views.View Android.Gms.Maps.GoogleMap.IInfoWindowAdapter.GetInfoContents(Android.Gms.Maps.Model.Marker marker) { var pin = this.GetPinByMarker(marker) as DriverPin; if (pin == null || pin.DriverInfo == null) { return(null); } var layout = new LinearLayout(Context); layout.Orientation = Orientation.Horizontal; var image = new ImageView(Context); layout.AddView(image); if (!_cacheBitmaps.ContainsKey(pin.DriverInfo.DriverPhoto)) { var bitmap = GetImageBitmapFromUrl("http://jaimayakali.com/" + pin.DriverInfo.DriverPhoto); _cacheBitmaps.Add(pin.DriverInfo.DriverPhoto, bitmap); } image.SetImageBitmap(_cacheBitmaps[pin.DriverInfo.DriverPhoto]); var textLayout = new LinearLayout(Context); textLayout.Orientation = Orientation.Vertical; var lp = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent); var textName = new TextView(Context) { Text = "Driver Name:" + pin.DriverInfo.DriverName, LayoutParameters = lp }; textName.SetTextColor(Android.Graphics.Color.Black); textLayout.AddView(textName); var textNumber = new TextView(Context) { Text = "Vehicle No:" + pin.DriverInfo.VehicleNo, LayoutParameters = lp }; textNumber.SetTextColor(Android.Graphics.Color.Black); textLayout.AddView(textNumber); layout.AddView(textLayout); return(layout); }