Why does a pin placed at the same latitude and longitude in MKMapView differ from one in Google Maps?

StackOverflow https://stackoverflow.com/questions/2400923

  •  18-09-2019
  •  | 
  •  

Question

I drop a pin in an MKMapView with longitude and latitude. When I place same longitude and latitude on google map the pin on both are slightly different.

Was it helpful?

Solution

I have a web/iPhone app that renders a map for positions sourced from the same database and haven't seen this issue. I would check your assumptions:

  • Are you truncating your values over the wire?
  • Are you rounding the position values differently on the two platforms?
  • Check the values you are passing into Google Maps and MapKit by logging them and comparing.

You can see from the following screenshots that the same latitude/longitude are rendered on the same position on the map:

alt text alt text

Update

I tried the coordinates you mentioned in the comments and got the same position for both. You need to check your assumptions. The values that you are using on the web or on the device are not the values you think they are:

alt text

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top