(Mapsui1.48)
Hi @pauldendulk and team, I came across this today on a production build. I'm attaching an StackTrace screenshot.
On a testing machine, we determined that this issue is reproducible when, at the System Settings level, you swap the Decimal Symbol period ('.') and Digit Grouping Symbol comma ('.')
For us, we were crashing while navigating to a bounding box on startup.



_Originally posted by @blwhttngtn in https://github.com/Mapsui/Mapsui/issues/97#issuecomment-528131678_
I am not aware of Mapsui doing any string parsing so I assume the change is settings affects your code and my guess is that as a consequence some extreme value is set in Mapsui. How does the change in setting affect the value of DistanceBetweenCorners?
_Note that we're using BruTile and BruTile.MbTiles 2.0.2, which is outside of the dependency of Mapsui 1.48, but I've been able to reproduce this 1:1 with BruTile and BruTile.MbTiles 1.0.3._
Somehow, setting the BoundingBoxBottomLeft Point in the image below results in a NaN Latitude value despite the X Y values passed-in to the SphericalMercator.FromLonLat being valid.

Navigating to a bounding box (in the original post) with this invalid point as its MinPoint results in this:

Then, attempting to zoom-out from the resultant position using the mouse wheel produces this:

Is it possible to provide the _xLeft and _yBottom values? Could it be, that you interchanged lat and lon?
Did you solved the problem? If yes, please close the issue.
... and BruTile.MbTiles
ah, the problem might be the parsing of fields in the MbTiles file.
When I adjust my system settings as you describe and run the BruTile MbTiles unit tests they still read the extend correctly.
Now I think a more likely explanation is that you use incorrect values as input to FromLonLat which causes an overflow. Could they be SphericalMercator coordinates instead of LonLat? What are the values of _xLeft and _yBottom?
Valid input values:
I will close this for now. Please reopen if you have a sample with which we can reproduce this problem.
@pauldendulk @charlenni thank you for your interest and your help. I'm going to disappoint you by including this image... the test machine which had the decimal/digit-grouping symbol switched was interpreting our sample data lat/lon values as very large or very small values because of the switch. I'm sorry!
Obviously at the object, I've gone ahead and added range validation tests so that no lat/lon values could be saved outside of the valid ranges: -90 < lat < 90 and -180 < lon < 180.'
Thanks guys! Sorry

Okay, let's investigate further. We will need some way to reproduce this though. Could you somehow create a sample for this? Perhaps fork the Mapsui repo and adjust some of the samples to reproduce this.
@pauldendulk I assume, that you misunderstand it. For me, the data was wrong, Mapsui is ok and the issue could be closed. Isn鈥檛 that right?
Ohhhhh! You are right. Did not have my glasses on.
@pauldendulk @charlenni exactly. Thanks again! @pauldendulk your valid-values-range comment actually led to me to the conclusion. Much appreciated.