views:

281

answers:

1

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.

+1  A: 

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

Cannonade
i used this coordinates(latitude and longitude)latitude=34.871 and longitude=-111.75 in my application and in google map.when i zoomin in my application then i see that it is slightly place in diffenet location.
Sunita
Is google map manipulate the coordinates? and show the pin only nearest road of that coordinates.
Sunita
Google maps doesn't snap markers to nearby roads. You should be able to create markers in a GMap2 or a MapView at arbitrary lat/lng coordinates. There must be a maximum precision for coordinates, but I would be surprised if they were very different on the two platforms. I'll look into that.
Cannonade
use this coordinate 35.1143850622 ,-111.697634282 in both(mapkit and google map).Now zoom it you see that pin drop in both case is different.in google map it show on the road but in mapkit it show slightly away from that road.
Sunita
According to the Google Maps API reference (http://code.google.com/apis/maps/documentation/reference.html#GLatLng.toUrlValue) 6 decimal places in a coordinate corresponds to an accuracy of 11 centimeters. Try rounding your values to 6 decimal places and then compare the results.
Cannonade
@Alpana I tried out those coordinates and got the same results on both platforms. See my update.
Cannonade
Thanks for help me
Sunita
No problems ... You can accept my answer and vote it up if it was useful ;)
Cannonade