You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returncities.Select(c =>{varfeature=newPointFeature(SphericalMercator.FromLonLat(c.Lng,c.Lat).ToMPoint());feature["name"]=c.Name;feature["country"]=c.Country;Console.WriteLine("Name={0}",c.Name);// FOR DEBUG LOGGINGreturnfeature;}).ToList();
I see we have three versions of the method, and perhaps other methods with a different name but the same problem.
The annoying thing of the 'possible multiple enumerations' warning is that you get it in every method that receives a IEnumerable<> even if the providing method already turned it into a List. The guideline I use is that the source is responsible to do a .ToList(). So, in this case the GetCitiesFromEmbeddedResource() method has a bug.
The advantage of the IEnumerable over List is that you can not modify it. An alternative can sometimes be to use the new .NET Span or Memory types.
By adding .ToList(), the issue was perfectly resolved.
Since I'm not very familiar with the behavior of .NET, I couldn't figure out the cause until I received your reply.
It was a great learning experience.
Thank you very much.
Mapsui Version
5.0.0-beta.6
Mapsui Platform
WindowsForms
Device
Windows 11
Describe the bug
I have a question about using Mapsui.Samples.WindowsForms.
When running Geometries -> Points in the app, it continuously enumerates the contents of
forever at the part
in method
in file
Is this the intended behavior?
To Reproduce
I also added
AllocConsole();
at the main program.
Start application, select "Geometries" and click "Points" radio button.
Log shows enumerates forever.
The text was updated successfully, but these errors were encountered: