I have read the longitude & latitude of the current location in obj-c. Now, how can I view the current location in the Google map, using that locations's longitude and latitude?
Can anyone give me some example code which helps me to do this?
I have read the longitude & latitude of the current location in obj-c. Now, how can I view the current location in the Google map, using that locations's longitude and latitude?
Can anyone give me some example code which helps me to do this?
You don't need to use longitude & latitude of the current location to show user location. The following line will do so.
mapView.showsUserLocation = YES;
Here is an example of the method you can use with the map view:
[googleMap setRegion:MKCoordinateRegionMake(location, coordSpan];
googleMap will be you MKMapView object and the location would be a CLLocationCoordinate2D (The lat. & lon. values) struct and coordSpan would be a MKCoordinateSpan struct (Specifies how large the viewing area is).
Update: This can be used for custom latitude and longitude valuesThe suggestion of using
mapView.showsUserLocation = YES;
Would be the easiest direct way if your just concerned with the users exact location.