Open luciantin opened 3 weeks ago
Hello sir, i understood. I think this mistake is from .NET - cultureInfo/Globalization. Thanks for the report, sir!
Hello again,
I need more information!
I changed my windows settings so that the decimal separator is ",". The application works correctly. Use data stored in GeoJSON files or use Geometric.Points with StreamPoint collection??
Hi, you are right that it works correctly even with wrong windows localization settings. I couldn't get the right format in dotnet by changing it in windows, it did not seem to affect CultureInfo.
This morning I got it working everywhere correctly, the way I fixed it globally was to set DefaultThreadCurrentCulture in Program.cs above builder.
public static void Main(string[] args)
{
var cultureInfo = new CultureInfo("en-us");
cultureInfo.NumberFormat.CurrencyDecimalSeparator = "."; // prob not needed
cultureInfo.NumberFormat.NumberDecimalSeparator = "."; // prob not needed
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
var builder = WebApplication.CreateBuilder(args);
....
}
I used data fetched from a database as a decimal converted to a double in DisplayPointsFromArray.addPoint.
I cant change the code inside the .cs file but I'm sure that if you set the culture, just inside the thread that invokes js code, you could get it to behave in the same way.
A problem ex. would be : The culture of the thread is "Croatian", the decimal separator is a comma and because of that the string.Join(",", coordinates2)
will use a comma and output coords to js in the format [14,234352,27,3463456].
I hope this was helpful.
Yes sir, i will be change/add and I make a new release!
Hello sir,
In a few minutes version 2.2.0.8 will be available
Thanks!
Hi Ichim, your map is amazing and thank you for all the hard work.
During development I noticed that points wouldn't show on some computers. I found that the array containing lat and lon coords was in the wrong format on the problematic computers it probably has to do with the local computers localization settings.
It uses a comma as the decimal separator
Correctly formats the decimal separator