Ejemplo n.º 1
0
        public static UIColor ToUIColor(this MapPinColor color)
        {
            // TODO: support all of the MapPinColors
            switch (color)
            {
            case MapPinColor.Azure:
                throw new NotSupportedException();

//                    return UIColor.HueAzure;
            case MapPinColor.Blue:
                return(UIColor.Blue);

            case MapPinColor.Cyan:
                return(UIColor.Cyan);

            case MapPinColor.Green:
                return(UIColor.Green);

            case MapPinColor.Red:
                return(UIColor.Red);

            case MapPinColor.Magenta:
                return(UIColor.Magenta);

            case MapPinColor.Orange:
                return(UIColor.Orange);

            case MapPinColor.Rose:
                throw new NotSupportedException();

//                    return UIColor.HueRose;
            case MapPinColor.Violet:
                throw new NotSupportedException();

//                    return UIColor.HueViolet;
            case MapPinColor.Yellow:
                return(UIColor.Yellow);

            default:
                throw new NotSupportedException(string.Format("Unknown pin color: {0}", color));
            }
        }
Ejemplo n.º 2
0
        public static float ToAndroidMarkerHue(this MapPinColor color)
        {
            switch (color)
            {
            case MapPinColor.Azure:
                return(BitmapDescriptorFactory.HueAzure);

            case MapPinColor.Blue:
                return(BitmapDescriptorFactory.HueBlue);

            case MapPinColor.Cyan:
                return(BitmapDescriptorFactory.HueCyan);

            case MapPinColor.Green:
                return(BitmapDescriptorFactory.HueGreen);

            case MapPinColor.Red:
                return(BitmapDescriptorFactory.HueRed);

            case MapPinColor.Magenta:
                return(BitmapDescriptorFactory.HueMagenta);

            case MapPinColor.Orange:
                return(BitmapDescriptorFactory.HueOrange);

            case MapPinColor.Rose:
                return(BitmapDescriptorFactory.HueRose);

            case MapPinColor.Violet:
                return(BitmapDescriptorFactory.HueViolet);

            case MapPinColor.Yellow:
                return(BitmapDescriptorFactory.HueYellow);

            default:
                throw new NotSupportedException(string.Format("Unknown pin color: {0}", color));
            }
        }