public override void SetDragState(MKAnnotationViewDragState newDragState, bool animated)
 {
     if (newDragState == MKAnnotationViewDragState.Starting)
     {
         DragState = MKAnnotationViewDragState.Dragging;
     }
     else if (newDragState == MKAnnotationViewDragState.Ending || newDragState == MKAnnotationViewDragState.Canceling)
     {
         DragState = MKAnnotationViewDragState.None;
     }
 }
		public override void SetDragState(MKAnnotationViewDragState newDragState, bool animated)
		{
			if (newDragState == MKAnnotationViewDragState.Starting) 
			{
				DragState = MKAnnotationViewDragState.Dragging;
			}
			else if (newDragState == MKAnnotationViewDragState.Ending || newDragState == MKAnnotationViewDragState.Canceling)
			{
				DragState = MKAnnotationViewDragState.None;
			}
		}
Exemple #3
0
        public override void ChangedDragState(
            MKMapView mapView,
            MKAnnotationView annotationView,
            MKAnnotationViewDragState newState,
            MKAnnotationViewDragState oldState)
        {
            if (newState == MKAnnotationViewDragState.Ending)
            {
                isDragging = false;

                if (mapView.Overlays != null)
                {
                    mapView.RemoveOverlays(mapView.Overlays);
                }

                var annotation = (PolylinePointAnnotation)annotationView.Annotation;
                annotation.Polyline.Value.Points [annotation.Index] = new GeoLocation(
                    annotation.Coordinate.Latitude,
                    annotation.Coordinate.Longitude);
                var newPolyline = annotation.Polyline.Value.ToMKPolyline();
                mapView.AddOverlay(newPolyline);

                annotation.Polyline.RaisePropertyChanged();

                return;
            }
            else if (newState == MKAnnotationViewDragState.Starting ||
                     newState == MKAnnotationViewDragState.Dragging)
            {
                isDragging = true;
            }
            else
            {
                isDragging = false;
                if (editPolyline != null)
                {
                    mapView.RemoveOverlay(editPolyline);
                }
            }
        }
Exemple #4
0
        public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
        {
            if (annotationView.Annotation is BindingMKAnnotation annotation)
            {
                switch (newState)
                {
                case MKAnnotationViewDragState.Starting:
                    if (MarkerDragStart?.CanExecute(annotation.Annotation) ?? false)
                    {
                        MarkerDragStart.Execute(annotation.Annotation);
                    }
                    break;

                case MKAnnotationViewDragState.Ending:
                    if (MarkerDragEnd?.CanExecute(annotation.Annotation) ?? false)
                    {
                        MarkerDragEnd.Execute(annotation.Annotation);
                    }
                    break;

                case MKAnnotationViewDragState.Dragging:
                    if (MarkerDrag?.CanExecute(annotation.Annotation) ?? false)
                    {
                        MarkerDrag.Execute(annotation.Annotation);
                    }
                    break;
                }
            }
        }
		public override void ChangedDragState (MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
		{
			if(newState == MKAnnotationViewDragState.Ending){
				_controller.Latitude = _controller.locationManagerDelegate.CurrentAnnotation.Coordinate.Latitude.ToString();
				_controller.Longitude = _controller.locationManagerDelegate.CurrentAnnotation.Coordinate.Longitude.ToString();
			}
		}
Exemple #6
0
 public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
 {
     base.ChangedDragState(mapView, annotationView, newState, oldState);
     if (newState == MKAnnotationViewDragState.Starting)
     {
         annotationView.DragState = MKAnnotationViewDragState.Dragging;
     }
     else if (newState == MKAnnotationViewDragState.Ending || newState == MKAnnotationViewDragState.Canceling)
     {
         annotationView.DragState = MKAnnotationViewDragState.None;
     }
 }
		/// Because we set anView.Draggable = true; we need to also handle the Ending drag event, or else our annotation will forever be "floating" over the map
		public override void ChangedDragState (MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
		{
			switch (newState) {
			case MKAnnotationViewDragState.Ending:
				annotationView.SetDragState (MKAnnotationViewDragState.None, false);
				break;
			}
		}
 public override void ChangedDragState (MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
 {
     Console.WriteLine ("drag state changed");
 }
 public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
 {
     if (newState == MKAnnotationViewDragState.Ending)
     {
         //((TaqueriaMapAnnotation)annotationView).SetCoordinate()
     }
 }
        public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
        {
            if (annotationView?.Annotation is UnifiedPointAnnotation unifiedPoint)
            {
                switch (newState)
                {
                case MKAnnotationViewDragState.Starting:
                    _renderer.Map.SendPinDragStart(unifiedPoint.Data);
                    break;

                case MKAnnotationViewDragState.Dragging:
                    _renderer.Map.SendPinDragging(unifiedPoint.Data);
                    break;

                case MKAnnotationViewDragState.Ending:
                    _renderer.Map.SendPinDragEnd(unifiedPoint.Data);
                    annotationView.SetDragState(MKAnnotationViewDragState.None, false);
                    break;

                case MKAnnotationViewDragState.Canceling:
                    annotationView.SetDragState(MKAnnotationViewDragState.None, false);
                    break;

                default:
                    break;
                }
                unifiedPoint.Data.Location = new Position(unifiedPoint.Coordinate.Latitude, unifiedPoint.Coordinate.Longitude);
            }
        }
 /// Because we set anView.Draggable = true; we need to also handle the Ending drag event, or else our annotation will forever be "floating" over the map
 public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
 {
     switch (newState)
     {
     case MKAnnotationViewDragState.Ending:
         annotationView.SetDragState(MKAnnotationViewDragState.None, false);
         break;
     }
 }
 public override void ChangedDragState(MKMapView mapView, MKAnnotationView annotationView, MKAnnotationViewDragState newState, MKAnnotationViewDragState oldState)
 {
     Console.WriteLine("drag state changed");
 }