Example #1
0
 /// <summary>
 /// Sets the DrawingManager's options.
 /// </summary>
 /// <param name="options"></param>
 public Task SetOptions(DrawingManagerOptions options)
 {
     return(_jsRuntime.InvokeWithDefinedGuidAndMethodAsync <object>(
                "googleMapDrawingManagerJsFunctions.invoke",
                _guid.ToString(),
                "setOptions",
                options));
 }
        /// <summary>
        /// Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.
        /// </summary>
        public async static Task <DrawingManager> CreateAsync(IJSRuntime jsRuntime, DrawingManagerOptions opts = null)
        {
            var jsObjectRef = await JsObjectRef.CreateAsync(jsRuntime, "google.maps.drawing.DrawingManager", opts);

            var obj = new DrawingManager(jsObjectRef, opts);

            return(obj);
        }
        /// <summary>
        /// Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.
        /// </summary>
        private DrawingManager(JsObjectRef jsObjectRef, DrawingManagerOptions opt = null)
        {
            _jsObjectRef = jsObjectRef;

            if (opt?.Map != null)
            {
                _map = opt.Map;
            }
        }
Example #4
0
        /// <summary>
        /// Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.
        /// </summary>
        public DrawingManager(IJSRuntime jsRuntime, DrawingManagerOptions opt = null)
            : base(jsRuntime)
        {
            if (opt?.Map != null)
            {
                _map = opt.Map;
            }

            _jsRuntime.JsonNetInvokeAsync <bool>(
                "googleMapDrawingManagerJsFunctions.init",
                _guid,
                opt);
        }
 /// <summary>
 /// Sets the DrawingManager's options.
 /// </summary>
 /// <param name="options"></param>
 public Task SetOptions(DrawingManagerOptions options)
 {
     return(_jsObjectRef.InvokeAsync(
                "setOptions",
                options));
 }