public AddEditEIMACirclePage (MapModel model, Position pos, bool editMode, EIMACircle edit) { toEdit = edit; position = pos; myModel = model; createCircle (editMode); }
public AddAssetToMapPage (EIMAPin pin, bool editPin, MapModel model) { myModel = model; editAsset = editPin; hasCanceled = true; toEdit = pin; buildUI (); }
public FilterPage(List<FilterObject> inAssetFilterData, List<FilterObject> inDZFilterData, MapModel mapModel){ myModel = mapModel; assetFilterData = inAssetFilterData; dzFilterData = inDZFilterData; Title = "Filter"; switchList = new List<SwitchCell>(); dzSwitchList = new List<SwitchCell>(); buildUI (); }
public void startAndBindMap(){ //var data = DataManager.getInstance (); const int miles = 5; Position locationDef = defaultLocation; MapSpan ms; if (locationDef != default(Position)) ms = MapSpan.FromCenterAndRadius (locationDef, Distance.FromMiles (miles)); else { ms = MapSpan.FromCenterAndRadius (defaultLocation, Distance.FromMiles (miles)); getAndSetLocation (miles); } map = new TKCustomMap(ms); map.IsShowingUser = true; var stack = new StackLayout { Spacing = 0 }; stack.Children.Add(map); Content = stack; Title = "Maps"; Icon = "Map.png"; map.SetBinding(TKCustomMap.CustomPinsProperty, "Pins"); map.SetBinding(TKCustomMap.MapClickedCommandProperty, "MapClickedCommand"); map.SetBinding(TKCustomMap.MapLongPressCommandProperty, "MapLongPressCommand"); map.SetBinding(TKCustomMap.MapCenterProperty, "MapCenter"); map.SetBinding(TKCustomMap.PinSelectedCommandProperty, "PinSelectedCommand"); map.SetBinding(TKCustomMap.SelectedPinProperty, "SelectedPin"); map.SetBinding(TKCustomMap.RoutesProperty, "Routes"); map.SetBinding(TKCustomMap.PinDragEndCommandProperty, "DragEndCommand"); map.SetBinding(TKCustomMap.CirclesProperty, "Circles"); map.SetBinding(TKCustomMap.CalloutClickedCommandProperty, "CalloutClickedCommand"); map.SetBinding(TKCustomMap.PolylinesProperty, "Lines"); map.SetBinding(TKCustomMap.PolygonsProperty, "Polygons"); map.SetBinding(TKCustomMap.MapRegionProperty, "MapRegion"); map.SetBinding(TKCustomMap.RouteClickedCommandProperty, "RouteClickedCommand"); map.SetBinding(TKCustomMap.RouteCalculationFinishedCommandProperty, "RouteCalculationFinishedCommand"); map.SetBinding(TKCustomMap.TilesUrlOptionsProperty, "TilesUrlOptions"); map.AnimateMapCenterChange = true; myModel = new MapModel (); BindingContext = myModel; }
public AddEditEIMAPolygonPage (MapModel myModel, bool editMode, EIMAPolygon toEdit) { var header = new Label { Text = "Specify DangerZone", FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Start }; var info = new Entry { Placeholder = "Info", VerticalOptions = LayoutOptions.Center }; var typePicker = new Picker { Title = "Danger Zone Type", VerticalOptions = LayoutOptions.Center }; foreach (string s in CONSTANTS.dzTypeOptions) { typePicker.Items.Add (s); } var EnterButton = new Button { Text = "Enter", VerticalOptions = LayoutOptions.Center }; var CancelButton = new Button { Text = "Cancel", VerticalOptions = LayoutOptions.Center }; var stackLayout = new StackLayout (){ VerticalOptions = LayoutOptions.Center }; if (editMode) { header.Text = "Edit DangerZone"; EnterButton.Text = "Confirm Edit"; info.Text = toEdit.note; typePicker.SelectedIndex = Array.IndexOf (CONSTANTS.dzTypeOptions, toEdit.type); } stackLayout.Children.Add (header); stackLayout.Children.Add (typePicker); stackLayout.Children.Add (info); var stackLayout2 = new StackLayout (); stackLayout2.HorizontalOptions = LayoutOptions.Center; stackLayout2.Orientation = StackOrientation.Horizontal; stackLayout2.Children.Add (EnterButton); stackLayout2.Children.Add (CancelButton); stackLayout.Children.Add (stackLayout2); Content = stackLayout; EnterButton.Clicked += (sender, e) => { if(typePicker.SelectedIndex < 0){ DisplayAlert("Must Select a Danger Zone Type","","Cancel"); return; } if(!editMode){ //start process of selecting points. would need to set vars myModel.creatingPolygon = true; myModel.polyNote = info.Text; myModel.polyType = CONSTANTS.dzTypeOptions[typePicker.SelectedIndex]; myModel.startProcedural(); goBack (); } else{ toEdit.type = CONSTANTS.dzTypeOptions[typePicker.SelectedIndex]; toEdit.note = info.Text; toEdit.Color = CONSTANTS.colorOptions[typePicker.SelectedIndex]; myModel.saveData (); goBack (); } }; CancelButton.Clicked += (sender, e) => goBack (); }