コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (DestinationMapView != null)
            {
                DestinationMapView.Dispose();
                DestinationMapView = null;
            }

            if (PackageNameTextField != null)
            {
                PackageNameTextField.Dispose();
                PackageNameTextField = null;
            }

            if (SaveBarButtonItem != null)
            {
                SaveBarButtonItem.Dispose();
                SaveBarButtonItem = null;
            }

            if (SourceMapView != null)
            {
                SourceMapView.Dispose();
                SourceMapView = null;
            }
        }
コード例 #2
0
        private void DestinationMapView_DidUpdateUserLocation(object sender, MapKit.MKUserLocationEventArgs e)
        {
            if (DestinationMapView.UserLocation == null)
            {
                return;
            }

            var coordinates = DestinationMapView.UserLocation.Coordinate;
            var span        = new MKCoordinateSpan(0.15, 0.15);

            DestinationMapView.Region = new MKCoordinateRegion(coordinates, span);

            DestinationMapView.RemoveAnnotations();
            DestinationMapView.AddAnnotation(new MKPointAnnotation
            {
                Coordinate = coordinates,
                Title      = "Your location"
            });
        }