コード例 #1
0
        /// <summary>
        /// Gets the polygon.
        /// </summary>
        /// <returns>The polygon.</returns>
        /// <param name="coordinates">Cordinates iterable.</param>
        /// <param name="fillColor">Fill color.</param>
        /// <param name="boundaryColor">Boundary color.</param>
        private static PolygonOptions GetPolygon(Java.Lang.IIterable coordinates, Android.Graphics.Color fillColor, Android.Graphics.Color boundaryColor)
        {
            var polygonOptions = new PolygonOptions();

            polygonOptions.InvokeFillColor(fillColor);
            polygonOptions.InvokeStrokeWidth(4);
            polygonOptions.InvokeStrokeColor(boundaryColor);
            polygonOptions.AddAll(coordinates);

            return(polygonOptions);
        }
コード例 #2
0
        /// <summary>
        /// Gets the polygon.
        /// </summary>
        /// <returns>The polygon.</returns>
        /// <param name="coordinates">Coordinates iterable.</param>
        /// <param name="color">Android Color.</param>
        private static PolygonOptions GetPolygon(Java.Lang.IIterable coordinates, Android.Graphics.Color color)
        {
            var polygonOptions = new PolygonOptions();

            polygonOptions.InvokeFillColor(color);
            polygonOptions.InvokeStrokeWidth(1);
            polygonOptions.InvokeStrokeColor(Color.Black.ToAndroid());
            polygonOptions.AddAll(coordinates);

            return(polygonOptions);
        }
コード例 #3
0
        /// <summary>
        /// Get a polygon that covers the entire world.<br />
        /// <br />
        /// Adapted from https://stackoverflow.com/a/15958458
        /// </summary>
        /// <returns></returns>
        public static PolygonOptions GetWorldPolygon()
        {
            float delta = 0.1f;

            List <LatLng> worldCoords = new List <LatLng>()
            {
                new LatLng(-90 + delta, -180 + delta),
                new LatLng(-90 + delta, 0),
                new LatLng(-90 + delta, 180 - delta),
                new LatLng(0, 180 - delta),
                new LatLng(90 - delta, 180 - delta),
                new LatLng(90 - delta, 0),
                new LatLng(90 - delta, -180 + delta),
                new LatLng(0, -180 + delta)
            };

            PolygonOptions options = new PolygonOptions();

            options.AddAll(new Java.Util.ArrayList(worldCoords));

            return(options);
        }