示例#1
0
        /// <summary>
        /// Create a rectangle using the passed RectangleOptions, which specify the bounds and style.
        /// </summary>
        /// <param name="opts"></param>
        public static async Task <Rectangle> CreateAsync(IJSRuntime jsRuntime, RectangleOptions opts = null)
        {
            var jsObjectRef = await JsObjectRef.CreateAsync(jsRuntime, "google.maps.Rectangle", opts);

            var obj = new Rectangle(jsObjectRef, opts);

            return(obj);
        }
示例#2
0
 public Task SetOptions(RectangleOptions options)
 {
     return(_jsRuntime.InvokeWithDefinedGuidAndMethodAsync <bool>(
                "googleMapRectangleJsFunctions.invoke",
                _guid.ToString(),
                "setOptions",
                options));
 }
示例#3
0
        /// <summary>
        /// Create a rectangle using the passed RectangleOptions, which specify the bounds and style.
        /// </summary>
        /// <param name="opts"></param>
        public Rectangle(IJSRuntime jsRuntime, RectangleOptions opts = null)
            : base(jsRuntime)
        {
            if (opts != null)
            {
                _map = opts.Map;

                _jsRuntime.InvokeWithDefinedGuidAsync <bool>(
                    "googleMapRectangleJsFunctions.init",
                    _guid.ToString(),
                    opts);
            }
            else
            {
                _jsRuntime.InvokeWithDefinedGuidAsync <bool>(
                    "googleMapRectangleJsFunctions.init",
                    _guid.ToString());
            }
        }
示例#4
0
 /// <summary>
 /// Create a rectangle using the passed RectangleOptions, which specify the bounds and style.
 /// </summary>
 /// <param name="opts"></param>
 internal Rectangle(JsObjectRef jsObjectRef, RectangleOptions opts = null)
 {
     _jsObjetRef = jsObjectRef;
     _map        = opts?.Map;
 }
示例#5
0
 public Task SetOptions(RectangleOptions options)
 {
     return(_jsObjetRef.InvokeAsync(
                "setOptions",
                options));
 }