Home > Back-end >  Hey are coordinates from Apple Maps incorrect when used as a CLLocation in mapkit?
Hey are coordinates from Apple Maps incorrect when used as a CLLocation in mapkit?

Time:06-09

I’m working on an app that shows various places on a map (SwiftUI using mkmapkit in a uiViewRepresentable) and have found that coordinates are being placed off target for some reason. I have the data listed in Firebase as a map - Latitude value and Longitude value that is then transferred into a CLLocation in app.

Example of the problem is that Big Ben in London should be (according to Apple Maps) be at 51.50070N and 0.12455W doesn’t appear there in app (see image) but the app reports coordinates of 51.500702, 0.124610 - when tapped just below the annotation.clearly NOT Big Ben

CodePudding user response:

The sign on the longitude is incorrect. According to my MKLocalSearch (and confirmed by dropping an annotation there), Big Ben is at a latitude of 51.5006854 and a longitude of -0.1245698. Note, that's -0.1245698 (aka, 0.1245698W) and not 0.1245698 (aka 0.1245698E).

A enter image description here

And zooming in on that incorrect coordinate to the east, that's obviously where your map is pointing:

enter image description here

But Big Ben is to the west of the meridian:

enter image description here

  • Related