Prerequisites
Package Version
1.4.0-pre2
.NET Version
10
Browser
No response
What happened?
When the event OnClick is triggered the STJ deserializer fails with:
Error: System.NotSupportedException: DeserializationMustSpecifyTypeDiscriminator, Community.Blazor.MapLibre.Models.Feature.IGeometry Path: $.features[0].geometry | LineNumber: 0 | BytePositionInLine: 209.
Expected behavior
The data is deserialized correctly from the map.
Reproduction steps
1. Register callback on the map for clicks `await _map.OnClick("resource_marker", OnMapClick);`
2. Click on the map with an element that contains a `IGeometry`
Code Sample
private async Task OnMapClick(MapMouseEvent @event)
{
if (@event.Features.FirstOrDefault() is not {} feature)
{
return;
}
var id = feature.Properties["id"].GetGuid();
var result = await resourceService.LookupResourcesAsync([id], CancelToken);
if (!result.IsSuccessful)
{
Snacks.Add("Failed to load resource details", Severity.Error);
return;
}
_selectedResource = result.Value[id];
StateHasChanged();
}
Additional Information
No response
Prerequisites
Package Version
1.4.0-pre2
.NET Version
10
Browser
No response
What happened?
When the event
OnClickis triggered the STJ deserializer fails with:Error: System.NotSupportedException: DeserializationMustSpecifyTypeDiscriminator, Community.Blazor.MapLibre.Models.Feature.IGeometry Path: $.features[0].geometry | LineNumber: 0 | BytePositionInLine: 209.Expected behavior
The data is deserialized correctly from the map.
Reproduction steps
Code Sample
Additional Information
No response