예제 #1
0
        public async void Should_SetOptionsAsync()
        {
            var id        = "id";
            var animation = new MoveAlongPathAnimation(id, _jsRuntime.Object);
            var options   = new MoveAlongPathAnimationOptions();
            await animation.SetOptionsAsync(options);

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), id, options), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
        public async ValueTask <IMoveAlongPathAnimation> MoveAlongPathAsync(IEnumerable <Position> path, HtmlMarker pin, MoveAlongPathAnimationOptions options = default)
        {
            _logger?.LogAzureMapsControlInfo(AzureMapLogEvent.AnimationService_MoveAlongPath, "Calling MoveAlongPath");

            Require.NotNull(path, nameof(path));
            Require.NotNull(pin, nameof(pin));

            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_MoveAlongPath, "Path", path);
            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_MoveAlongPath, "PinId", pin.Id);
            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_MoveAlongPath, "Options", options);

            var animation = new MoveAlongPathAnimation(Guid.NewGuid().ToString(), _jsRuntime);
            await _jsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.MoveAlongPath.ToAnimationNamespace(), animation.Id, path, null, pin.Id, null, options);

            animation.Disposed = options.DisposeOnComplete.GetValueOrDefault();
            return(animation);
        }