views:

76

answers:

1

Hii Frnz,

I am developing an app which computes the distance travelled by the person and shows a map view which draws a line showing the user path from initial position to final position.

Now I am stuck as to how to trace a line on the user path...Should I try a custom annotations(or overlays) or is it possible to draw line on user path...a sample code would be very helpful if not possible then please provide some suggestion as to how to proceed.

A: 

you can take reference from

Craig Spitzkoff's MapLinesAndAnnotations

raaz
hii raaz is there any other ref available?
Siddharth
hii all...please help me out ..i am badly stuck at this point
Siddharth
@siddharth : In which area are you facing problem give details.
raaz
i have used the code suggested by you....I have included the following classes in my code..CSRouteView,CSRouteAnnotation,CSMapAnnotation as i need to draw annotation at starting ,end location and annotation to trace user path b/w these points.Craig has user a static location array to trace the path.In my app whenever - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocationabove method is called i strore the new location in points array.
Siddharth
now..when the user presses the stop button then in its action method i have crates the start ,end and route annotation objects.the problem is start and end annoation (pins) are dropped in my mapView...but the route is not made in the mapView.
Siddharth
also i have tried this code "http://spitzkoff.com/craig/?p=65" but the problem here is that the line is drawn on a view placed above the mapView so the user cant scroll the mapView.
Siddharth
so is there any easy approach available...I have also heard about overlays but they are present in sdk4.0
Siddharth
@siddharth : hi,officially it is not possible to achieve what you want to do.You can just draw the route above mapview.But may some private framework /api can do this but as far my knowledge they are not stable.They make the application crash.Good News :Apple has officially included this feature in its iOS4.So don't worry.
raaz