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.
views:
281answers:
1
+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:
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:
Cannonade
2010-03-08 23:19:22
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
2010-03-09 04:21:47
Is google map manipulate the coordinates? and show the pin only nearest road of that coordinates.
Sunita
2010-03-09 07:17:38
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
2010-03-09 09:31:35
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
2010-03-09 09:55:53
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
2010-03-09 22:08:49
@Alpana I tried out those coordinates and got the same results on both platforms. See my update.
Cannonade
2010-03-09 23:30:15
Thanks for help me
Sunita
2010-03-10 03:48:59
No problems ... You can accept my answer and vote it up if it was useful ;)
Cannonade
2010-03-10 04:25:45