public override MKOverlayView GetViewForOverlay(MKMapView mapView, NSObject overlay)
            {
                MKOverlayView overlayView = null;

                if (overlay is MKPolygon)
                {
                    MKPolygon polygon     = overlay as MKPolygon;
                    var       polygonView = new MKPolygonView(polygon);
                    polygonView.FillColor = UIColor.Purple;
                    polygonView.Alpha     = 0.7f;
                    overlayView           = polygonView;
                }
                else if (overlay is MKCircle)
                {
                    MKCircle circle     = overlay as MKCircle;
                    var      circleView = new MKCircleView(circle);
                    circleView.FillColor = UIColor.Green;
                    overlayView          = circleView;
                }
                else if (overlay is MKPolyline)
                {
                    MKPolyline polyline     = overlay as MKPolyline;
                    var        polylineView = new MKPolylineView(polyline);
                    polylineView.StrokeColor = UIColor.Black;
                    overlayView = polylineView;
                }
                else if (overlay is CustomOverlay)
                {
                    CustomOverlay co = overlay as CustomOverlay;
                    var           v  = new CustomOverlayView(co);
                    overlayView = v;
                }

                return(overlayView);
            }
Esempio n. 2
0
        public void InitWithFrame()
        {
            RectangleF frame = new RectangleF(10, 10, 100, 100);

            using (MKPolygonView pv = new MKPolygonView(frame)) {
                Assert.That(pv.Frame, Is.EqualTo(frame), "Frame");
            }
        }
Esempio n. 3
0
 public override MKOverlayView GetViewForOverlay(MKMapView mapView, IMKOverlay overlay)
 {
     // return a view for the polygon
     MKPolygon polygon = overlay as MKPolygon;
     MKPolygonView polygonView = new MKPolygonView (polygon);
     polygonView.FillColor = UIColor.Blue;
     polygonView.StrokeColor = UIColor.Red;
     return polygonView;
 }
Esempio n. 4
0
        public override MKOverlayView GetViewForOverlay(MKMapView mapView, IMKOverlay overlay)
        {
            MKPolygon     polygon       = overlay as MKPolygon;
            MKPolygonView mKPolygonView = new MKPolygonView(polygon);

            mKPolygonView.FillColor   = UIColor.Red;
            mKPolygonView.StrokeColor = UIColor.Blue;
            return(mKPolygonView);
        }
Esempio n. 5
0
        public override MKOverlayView GetViewForOverlay(MKMapView mapView, IMKOverlay overlay)
        {
            // return a view for the polygon
            MKPolygon     polygon     = overlay as MKPolygon;
            MKPolygonView polygonView = new MKPolygonView(polygon);

            polygonView.FillColor   = UIColor.Blue;
            polygonView.StrokeColor = UIColor.Red;
            return(polygonView);
        }
Esempio n. 6
0
        public override MKOverlayView GetViewForOverlay(MKMapView mapView, IMKOverlay overlay)
        {
            if (overlay is MKCircle)
            {
                MKCircleView cv = new MKCircleView(overlay as MKCircle);
                cv.FillColor = UIColor.Purple;
                cv.Alpha     = 0.5f;
                return(cv);
            }
            if (overlay is MKPolygon)
            {
                // return a view for the polygon
                MKPolygon     polygon     = overlay as MKPolygon;
                MKPolygonView polygonView = new MKPolygonView(polygon);
                polygonView.FillColor   = UIColor.Blue;
                polygonView.StrokeColor = UIColor.Red;
                return(polygonView);
            }

            return(null);
        }
Esempio n. 7
0
        public override MKOverlayView GetViewForOverlay(MKMapView mapView, IMKOverlay overlay)
        {
            MKPolygon polygon = overlay as MKPolygon;
            MKCircle  circle  = overlay as MKCircle;

            if (polygon != null)
            {
                MKPolygonView mkPolygonView = new MKPolygonView(polygon);

                mkPolygonView.FillColor   = UIColor.Red;
                mkPolygonView.StrokeColor = UIColor.Blue;

                return(mkPolygonView);
            }

            if (circle != null)
            {
                MKCircleView mKCircleView = new MKCircleView(circle);
                mKCircleView.FillColor = UIColor.FromRGBA(255, 0, 0, 60);
                return(mKCircleView);
            }
            return(null);
        }
 public override MKOverlayView GetViewForOverlay (MKMapView mapView, NSObject overlay)
 {
     MKOverlayView overlayView = null;
     
     if(overlay is MKPolygon){
         MKPolygon polygon = overlay as MKPolygon;
         var polygonView = new MKPolygonView(polygon);
         polygonView.FillColor = UIColor.Purple;
         polygonView.Alpha = 0.7f;
         overlayView = polygonView;
     }
     else if(overlay is MKCircle){
         MKCircle circle = overlay as MKCircle;
         var circleView = new MKCircleView (circle);
         circleView.FillColor = UIColor.Green;
         overlayView = circleView;
     }
     else if(overlay is MKPolyline){
         MKPolyline polyline = overlay as MKPolyline;
         var polylineView = new MKPolylineView (polyline);
         polylineView.StrokeColor = UIColor.Black;
         overlayView = polylineView;
     }   
     else if(overlay is CustomOverlay)
     {
         CustomOverlay co = overlay as CustomOverlay;
         var v = new CustomOverlayView(co);
         overlayView = v;
     }
     
     return overlayView;
 }