问题
I want to show the exact route path between the more that two points.
I do have some example but all are having example which show the route between two points.
Exmaple :- this, also this even i had also gone through the example of regexlite. But all have the logic for the route between two points. Through polyline i can just draw the straight line.I am not able to see the route.
EDITED QUESTION:-
There are 5 points:-
1)points is :-"lat": -35.29987329273559, "lng": 149.13395404815674,
2)Point is:- "lat": -35.2984416380826, "lng": 149.13144886493683,
3)point is:- "lat": -35.302576234486935, "lng": 149.13335928744252,
4)point is:- "lat": -35.301081642089805, "lng": 149.13073539733887,
5)point is :-"lat": -35.29991644393122, "lng": 149.13659454104746,
Now i want to draw a route from point 1 to point 5.And route must contain all the points. I know i can find the route between two points but how do i fire the one and same method again and again so find the route Please help me. Thank in advance
回答1:
Apple integrate new feature to show route.
Requirement -> OS version should be IOS6
or later.
Show route from current location to YourCoordinate
in iOS6
-(void)showMapRouteFromCurrentLocation
{
CLLocationCoordinate2D currentUserCoordinate = YourCoordinate;
//currentUserCoordinate.latitude= +53.509980;
//currentUserCoordinate.longitude = -0.133700;
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:currentUserCoordinate
addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
NSDictionary *routeOption = [[NSDictionary alloc] initWithObjectsAndKeys:MKLaunchOptionsDirectionsModeDriving,MKLaunchOptionsDirectionsModeKey, nil];
[mapItem openInMapsWithLaunchOptions:routeOption];
}
Here is the link of this.
来源:https://stackoverflow.com/questions/13742305/to-show-the-route-between-mutliple-points-in-iphone-sdk