bugfix _map.SetCenterLatitudeLongitude and _map.UpdateMap() with CultureInfo #1913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.