Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix _map.SetCenterLatitudeLongitude and _map.UpdateMap() with CultureInfo #1913

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

izabala033
Copy link

When using _map.SetCenterLatitudeLongitude(), this function saves the current latitude and longitude as string. It uses stringFormat to cast Vector2d x and y to string, but doesn't use InvariantCulture like it does at line 319, inside Initialize().
Decimal separator depends on the culture but InvariantCulture uses . which is what you want. In some cases , is used.
The problem is that it was saving Vector2d(1.2, 3.4) as "1,2, 3,4" instead of "1.2, 3.4. This raises an error when using _map.UpdateMap(), when using Conversion.StringToLatLon(). A split is made with "," as separator, raising an ArgumentException("Wrong number of arguments") because the number of arguments are 4 instead of 2.

@izabala033 izabala033 changed the title string.Format but with CultureInfo bugfix _map.SetCenterLatitudeLongitude and _map.UpdateMap() Oct 6, 2023
@izabala033 izabala033 changed the title bugfix _map.SetCenterLatitudeLongitude and _map.UpdateMap() bugfix _map.SetCenterLatitudeLongitude and _map.UpdateMap() with CultureInfo Oct 6, 2023
@theolagendijk
Copy link

I came to this same fix when a client run into an issue with my app on an iPhone running with Dutch language settings.

Perfect bug fix for a nasty problem. I would highly recommend that this fix get's pulled in to the main repository. Small change huge improvement for international audience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants