LeafletForBlazor-NuGet icon indicating copy to clipboard operation
LeafletForBlazor-NuGet copied to clipboard

Issue with Maps in Dialog boxes (MudBlazor)

Open alainstucki opened this issue 5 months ago • 4 comments

Hi,

i'm displaying a map in a closable dialog (MudBlazor / https://mudblazor.com/components/dialog#usage). The first time everything works fine: image 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: image

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: image

it's supposed to look this way: image

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

alainstucki avatar Sep 26 '24 08:09 alainstucki