Display coordinates in MGRS format with MapKit

Everything is in the title, I manage to display the user's coordinates in latitude / longitude format, but I can't find any way to convert them to MGRS format, is this possible?

Answered by MaathCoding in 746122022

Thank's ! So no (native) swift library exists for this?

I recommend GeographicLib for this sort of thing.

https://geographiclib.sourceforge.io/C++/doc/classGeographicLib_1_1MGRS.html#details

Accepted Answer

Thank's ! So no (native) swift library exists for this?

Even if there were a Swift library, I'd still encourage you to use GeographicLib because I trust the author's maths. Learning how to bridge between Swift and C++ is something that you'll inevitably need to do eventually, and this is a nice easy API to do that for.

Display coordinates in MGRS format with MapKit
 
 
Q