Open Alexbits opened 1 year ago
Adding a layer via overload with before: string.Empty
parameter fixes the issue.
await args.Map.AddLayerAsync(lineLayer, string.Empty);
It looks like the following public async ValueTask AddLayerAsync<T>(T layer) where T : Layer => await AddLayerAsync(layer, null);
in the Map.cs
should be changed to public async ValueTask AddLayerAsync<T>(T layer) where T : Layer => await AddLayerAsync(layer, string.Empty);
When before
is null in the call below, it creates an issue.
await _jsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Core.AddLayer.ToCoreNamespace(),
layer.Id,
before,
layer.Type.ToString(),
layer.GetLayerOptions(),
layer.EventActivationFlags.EnabledEvents,
DotNetObjectReference.Create(_layerEventInvokeHelper));
Switching between styles is impossible after adding controls to the map on the /Layers/LineLayerOnReady samples page. It looks like there is a problem with data sources/layers when map controls are added.
To reproduce, add the following to the AzureMap control: