mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
724 stars 210 forks source link

Non-English Windows User(s) cannot see the Mapbox map system #1883

Open liquidbuddha opened 2 years ago

liquidbuddha commented 2 years ago

Note: If this is a bug or support ticket, please provide the following information:

Here is the player log file for one user.. bold added.

Mono path[0] = 'C:/Program Files (x86)/SkyGlass/SkyGlass_Data/Managed' Mono config path = 'C:/Program Files (x86)/SkyGlass/MonoBleedingEdge/etc' Initialize engine version: 2020.3.34f1 (9a4c9c70452b) [Subsystems] Discovering subsystems at path C:/Program Files (x86)/SkyGlass/SkyGlass_Data/UnitySubsystems GfxDevice: creating device client; threaded=1 Direct3D: Version: Direct3D 11.0 [level 11.1] Renderer: NVIDIA GeForce GTX 1050 Ti (ID=0x1c82) Vendor:
VRAM: 4018 MB Driver: 27.21.14.6660 Begin MonoManager ReloadAssembly

liquidbuddha commented 2 years ago

I have now 8 confirmed cases of Non-English versions of Windows failing the Mapbox map system. German (4 users), Brazilian (1), French (1, Canada), Swedish (1), Netherlands (1)

liquidbuddha commented 2 years ago

One latest German user's windows details... (not the same as the original crash report), tested on two systems...

System 1: Edition Windows 11 Pro Version 21H2 Installiert am ‎23.‎08.‎2022 Betriebssystembuild 22000.978 Leistung Windows Feature Experience Pack 1000.22000.978.0

System 2: Edition Windows 10 Pro Version 21H2 Installiert am ‎18.‎11.‎2020 Betriebssystembuild 19044.1766 Leistung Windows Feature Experience Pack 120.2212.4180.0

liquidbuddha commented 2 years ago

@brnkhy any help on this?

brnkhy commented 2 years ago

Hey @liquidbuddha! Sorry I just had a chance to look into this. Looks like an issue with Mapbox.Unity.Utilities.Conversions.StringToLatLon and of course localization of float/double on different devices. If I remember correct, it's not a very commonly used method and as the logs show, main usage is reading the starting latlng from map object ui/data. so this is probably all about parsing the string you enter via UI OR procedurally.

Now first question is, is it a fixed starting location or are you passing a value to map in runtime? If you are using a value stored somewhere, it's highly likely system stores it with , instead of . for floating point.

liquidbuddha commented 2 years ago

Thanks for responding @brnkhy!! Allow me to walk you through the process.. sorry for the extra detail but I figured it would be useful.

On startup, the map loads from a default location... (playerSettings.playerLat = 37.09024; playerSettings.playerLon = -95.712891;) If the player chooses a new home while using the app, that's stored and loaded on startup. The startup process is the same as below, loaded from the playerSettings and passed to Conversions.StringToLatLon after a string conversion.

In my UI, the user can change their "home location" a couple ways.. one is double clicking on the map.. I pass a vector3 ray and use the GetGeoPosition to start things off...

        Vector2d geoloc = hitInfo.GetGeoPosition(gameController.goMap.CenterMercator, gameController.goMap.WorldRelativeScale);

That vector2d is stored, I do a reverse Geocode lookup and show that to the user and another button click lets the user home there. The lat/lon is converted from the vector2d and stored as doubles and then passed to the map like this..

       string newLatLong = dataController.playerSettings.playerLat.ToString() + "," + dataController.playerSettings.playerLon.ToString();
       var vector2D = Conversions.StringToLatLon(newLatLong);

Then I update the map ...

        goMap.UpdateMap(vector2D, dataController.playerSettings.mapzoom);

The other way a player can change the home location is from a natural language input field, which is processed by a google geoCode lookup / translation, read from a json web result and converted from a double to a string and stored, then with a button click is processed like above.

So I'm guessing I should do a quick change of "," to "." after I create the newLatLong string before I pass it to the Conversions.StringToLatLon(newLatLong) ? That sound right?

Thanks again.