lolochristen / OpenLayers.Blazor

An Map component for Blazor based on OpenLayers with support for swisstopo swiss maps.
MIT License
37 stars 13 forks source link

Markers not being rendered #42

Closed artemfomin closed 7 months ago

artemfomin commented 7 months ago

When adding a marker to the map using

private void OnMapClick(Coordinate coordinate)
{
    _map.MarkersList.Add(new Marker(MarkerType.MarkerFlag, coordinate, "Marker friendly name"));
    StateHasChanged();
}

Marker is added to _map.MarkersList but isn't rendered. Also tried

private void OnMapClick(Coordinate coordinate)
    {
        _map.MarkersList.Add(new Marker(MarkerType.MarkerFlag, coordinate, DateTime.Now.ToShortTimeString()));
        StateHasChanged();
        _map.SetMarkers(_map.MarkersList);
        _map.UpdateLayer(_mainLayer);
    }

Still nothing.

Package version 1.5.3 from 02.02.2024 Package is great and intuitive if only it will be stable)

UPD: Might be related to this issue as failure of base JS object might block the following calls.

lolochristen commented 7 months ago

Please see comment in #37. Hope it is fixed now.

artemfomin commented 7 months ago

@lolochristen I confirm both issues are fixed in 1.5.4. Thank you. BLAZing fast)