コード例 #1
0
        public override void DidSelectAnnotationView(MKMapView mapView, MKAnnotationView view)
        {
            var pinAnnotationView = view;

            if (pinAnnotationView == null)
            {
                return;
            }

            if (_previouslySelectedNativePin != null)
            {
                ResetPrevioslySelectedPin();
            }

            view.Image = UIImage.FromFile("defaultPin.png").Scale(new CGSize(40, 50));
            var extendedMapAnnotation = pinAnnotationView.Annotation as ExtendedMapAnnotation;

            if (extendedMapAnnotation != null)
            {
                extendedMapAnnotation.AnnotationClicked(mapView);
            }

            _previouslySelectedPin       = extendedMapAnnotation;
            _previouslySelectedNativePin = view;
        }
コード例 #2
0
	  public override void DidSelectAnnotationView (MKMapView mapView, MKAnnotationView view)
		{
			var pinAnnotationView = view;

		  if (pinAnnotationView == null) return;

      if(_previouslySelectedNativePin != null)
        ResetPrevioslySelectedPin();
			
      view.Image = UIImage.FromFile("defaultPin.png").Scale(new CGSize(40,50));
      var extendedMapAnnotation = pinAnnotationView.Annotation as ExtendedMapAnnotation;

		  if (extendedMapAnnotation != null) {
		    extendedMapAnnotation.AnnotationClicked (mapView);
		  }

      _previouslySelectedPin = extendedMapAnnotation;
      _previouslySelectedNativePin = view;
		}
コード例 #3
0
    private void AddPin(ExtendedPin formsPin)
    {
      var nativePin =
        new ExtendedMapAnnotation(new CLLocationCoordinate2D(formsPin.Position.Latitude, formsPin.Position.Longitude),
          formsPin.Label, formsPin.Address, formsPin.PinIcon);

      nativePin.Clicked += HandleAnnotationClick;

      _nativeMapView.AddAnnotation(nativePin);
    }
コード例 #4
0
    private void HandleAnnotationClick(object sender, ExtendedMapAnnotation e)
    {
      _customMap.SelectedPinAddress = e.Subtitle;

      if (_customMapContentView.Footer.FooterMode == FooterMode.Hidden)
      {
        _customMapContentView.Footer.FooterMode = FooterMode.Minimized;
      }
    }