I have a latitude and longitude that is fixed, so I used that and got the point in mapview with pin. Now I want the current location and draw route, so I think using gps I get the latitude and longitude. Using this location(latitude & longitude) I have to draw a route with my fixed value (latitude & longitude). How is it possible..? Is this is the right way to do it? ?How to draw the route with two point..?
I have used the delegate method but it doesn't call,
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
[manager stopUpdatingHeading];
NSLog(@"latitude=%f",newLocation.coordinate.latitude);
NSLog(@"longitude=%f",newLocation.coordinate.longitude);
}
I think the best way is using web service from google and draw the points as poly lines to the mapview. I am using http://maps.google.com/maps?f=d&hl=en&saddr=%lf,%lf&daddr=%lf,%lf&ie=UTF8&0&om=0&output=kml web service and draw the routes over mapView as poly lines.You will find an example here to draw polyline over some coordinates.
ReplyDelete