Example #1
0
        private void RenderMap(object sender, System.EventArgs e)
        {
            SetContentView(Resource.Layout.Map);

            //Get MapView from the view and assign map from view-model
            _mapView     = FindViewById <MapView>(Resource.Id.MyMapView);
            _mapView.Map = _mapViewModel.Map;

            _sketchOverlay = new GraphicsOverlay();

            _mapView.GraphicsOverlays.Add(_sketchOverlay);

            var btn_RegisterIssue = FindViewById <Button>(Resource.Id.RegisterIssue);

            btn_RegisterIssue.Click += (sender2, e2) => {
                _locationDisplay = _mapView.LocationDisplay;
                Btn_RegisterProblemTest_Click(sender2, e2);
            };

            foreach (var geometry in GeometryHelper.GetAll())
            {
                _sketchOverlay.Graphics.Add(new Graphic(geometry, GeometryHelper.GetMarker()));
            }

            _mapViewModel.PropertyChanged       += MapViewModel_PropertyChanged;
            _mapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Recenter;
            _mapView.LocationDisplay.IsEnabled   = true;
        }
        public MapViewModel()
        {
            // the map controller is used to avoid using/passing the map control as a property to the MapViewModel
            Controller      = new MapViewController();
            Editor          = new MeasureEditor();
            PortalItem      = ArcGISPortalViewer.ViewModel.AppViewModel.CurrentAppViewModel.SelectedPortalItem;
            IsSidePaneOpen  = false;
            LocationDisplay = new LocationDisplay();
            if (IsInDesignMode)
            {
                IsLoadingWebMap = false;
                IsSidePaneOpen  = true;
                IsAppBarOpen    = true;
            }

            OnBasemapPickedCommand        = new RelayCommand <object>(OnBasemapPicked);
            OnQuerySubmittedCommand       = new RelayCommand <object>(OnQuerySubmitted);
            OnCollapsibleTabOpenedCommand = new RelayCommand <object>(OnCollapsibleTabOpened);
            OnMapTappedCommand            = new RelayCommand <object>(OnMapTapped);

            #region Identify

            OnPopupTappedCommand  = new RelayCommand <object>(OnPopupTapped);
            OnSetViewCommand      = new RelayCommand <object>(OnSetView);
            OnSelectedItemCommand = new RelayCommand <object>(OnSelectedItem);
            OnBackClickCommand    = new RelayCommand <object>(OnBackClick);

            #endregion Identify
        }
 public MainPageVM()
 {
     LocationDisplay           = new LocationDisplay();
     Editor                    = new Editor();
     AddPointBarrierCommand    = new DelegateCommand(() => { DrawBarrier(DrawShape.Point); });
     AddPolylineBarrierCommand = new DelegateCommand(() => { DrawBarrier(DrawShape.Polyline); });
     AddPolygonBarrierCommand  = new DelegateCommand(() => { DrawBarrier(DrawShape.Polygon); });
     ClearBarriersCommand      = new DelegateCommand(() => { ClearBarriers(); });
 }
		public MainPageVM()
		{
			LocationDisplay = new LocationDisplay();
			Editor = new Editor();
			AddPointBarrierCommand = new DelegateCommand(() => { DrawBarrier(DrawShape.Point); });
			AddPolylineBarrierCommand = new DelegateCommand(() => { DrawBarrier(DrawShape.Polyline); });
			AddPolygonBarrierCommand = new DelegateCommand(() => { DrawBarrier(DrawShape.Polygon); });
			ClearBarriersCommand = new DelegateCommand(() => { ClearBarriers(); });
		}
        public MapViewModel()
        {
            // the map controller is used to avoid using/passing the map control as a property to the MapViewModel
            Controller = new MapViewController();
			Editor = new MeasureEditor();
            PortalItem = ArcGISPortalViewer.ViewModel.AppViewModel.CurrentAppViewModel.SelectedPortalItem;
            IsSidePaneOpen = false;
            LocationDisplay = new LocationDisplay();
            if (IsInDesignMode)
            {
                IsLoadingWebMap = false;
                IsSidePaneOpen = true;
                IsAppBarOpen = true;
            }

            OnBasemapPickedCommand = new RelayCommand<object>(OnBasemapPicked);
            OnQuerySubmittedCommand = new RelayCommand<object>(OnQuerySubmitted);
            OnCollapsibleTabOpenedCommand = new RelayCommand<object>(OnCollapsibleTabOpened);
            OnMapTappedCommand = new RelayCommand<object>(OnMapTapped);

            #region Identify

            OnPopupTappedCommand = new RelayCommand<object>(OnPopupTapped);
            OnSetViewCommand = new RelayCommand<object>(OnSetView);
            OnSelectedItemCommand = new RelayCommand<object>(OnSelectedItem);
            OnBackClickCommand = new RelayCommand<object>(OnBackClick);

            #endregion Identify
        }