LeafletForBlazor-NuGet
LeafletForBlazor-NuGet copied to clipboard
Issue with Maps in Dialog boxes (MudBlazor)
Hi,
i'm displaying a map in a closable dialog (MudBlazor / https://mudblazor.com/components/dialog#usage).
The first time everything works fine:
The blue and the yellow polyline are visible and the map can be zoomed and moved around.
After close the dialog and open it again, the yellow track is missing:
The other issue is that somtimes the line are not "glued" to the map. if i zoom in or out or move the map around, the lines stay where they are:
it's supposed to look this way:
the tracks get added this way:
public async Task OnAfterMapLoaded(RealTimeMap.MapEventArgs args) { await args.sender.Geometric.DataFromGeoJSON.addObject(_track); await args.sender.Geometric.DataFromGeoJSON.addObject(_originalTrack); }
<RealTimeMap @ref="_map" height="660px" width="820px" Parameters="_parameters" OnAfterMapLoaded="@OnAfterMapLoaded"></RealTimeMap>
_parameters = new RealTimeMap.LoadParameters { location = new RealTimeMap.Location() { latitude = _trip.RawPositions.OrderBy(p => p.Timestamp).First().Latitude, longitude = _trip.RawPositions.OrderBy(p => p.Timestamp).First().Longitude }, zoomLevel = 11, };
Best, Alain