private void MClient_DownloadDataCompleted(object sender, System.Net.DownloadDataCompletedEventArgs e) { try { string json = Encoding.UTF8.GetString(e.Result); mParkinglots = JsonConvert.DeserializeObject <List <Parkinglot> >(json); if (mParkinglots.Count == 0) { RunOnUiThread(() => { // Levanto el mensaje de que no encontro ningun establecimiento mProgressBar.Visibility = ViewStates.Invisible; trans = FragmentManager.BeginTransaction(); dialog = new DialogParkingSearch(); dialog.Show(trans, "Dialog Parking Search"); }); } else { RunOnUiThread(() => { //Levanto el Dialog aca, asi me aseguro que siempre haya mapa donde mostrar los marcadores mProgressBar.Visibility = ViewStates.Invisible; trans = FragmentManager.BeginTransaction(); dialog = new DialogParkingSearch(mParkinglots[mPosition], mPosition); dialog.Show(trans, "Dialog Parking Search"); dialog.mGo += Dialog_mGo; dialog.mNext += Dialog_mNext; }); } } catch (Exception ex) { Managment.ActivityManager.ShowError(this, new Error(errCode, errMsg)); } }
public void ClearLocation() { if (dialog != null) { dialog.Dismiss(); } if (dialogInstructions != null) { dialogInstructions.Dismiss(); } if (dialogEnter != null) { dialogEnter.Dismiss(); } dialog = null; dialogInstructions = null; dialogEnter = null; if (mMap != null) { // Elimino la lista de Establecimientos mPosition = 0; mParkinglots.Clear(); // Limipio el Mapa yCargo el Marcador que va a servir de centro y la posicion global mMap.Clear(); mMarkerCenter = MarkerManager.CreateUserDragable(); LatLng latlng = mMarkerCenter.Position; CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, ConfigManager.DefaultDraggZoomMap); mMap.MoveCamera(camera); mCenterPosition = mMarkerCenter.Position; mMap.AddMarker(mMarkerCenter); mMap.MarkerDragEnd += MMap_MarkerDragEnd; } }