I am developeing an app , that scans certain distance and displays the all the users with that application on radar like map .
I am getting a list of latitudes and longitudes from an api , now i need the user tp apperar on center of radar and others in respective direction and distance .
Can i achieve this using mapview ?
Or is there any better way ?
Please suggest me a good to handle this issue .
I have not started coding yet so , could not provide any starup .
Plz help thanks !
MKMapView has the cunningly named method:
setUserTrackingMode:animated:
As the documentation states:
Setting the tracking mode to MKUserTrackingModeFollow or MKUserTrackingModeFollowWithHeading causes the map view to center the map on that location and begin tracking the user’s location
Related
I am implementing map based application in iPhone sdk. I want to give functionality in map view like Google maps directoins. means is at some location from that he selects one pin from multiple pins from MKPinAnnotationView. is it possible that user can get direction from his current location to selected pin location in MapView? user can select any aanonations from that he can get directions in some way of line to his current location to pin location. i have get some idea from here
but this all was some static data you can download this example.
here also apple example. but this example is only for track & draw line for user movement.
is it possible that user can get direction from his current location to selected pin location in MapView?
Yes. You can send a query to google maps api using your current location and the selected annotation location. When google responds with the route, you will use that polyline decoder method to decode the data and draw the route on your map view.
I have got all side idea from here
this can be useful for other developers also.
i have found some other examples also that can be also useful for other developers just google. you will find this is polyline link for user current location use this apple code
Here is Google direction api. Read it and use it.
For test purpose you can check this request
http://maps.googleapis.com/maps/api/directions/json?origin=28.459497,77.026638&destination=28.435600,77.009997&sensor=true
And use JSON Viewer to see the json response.
I want to locate if I/friend have entered in a certain region on map using mapkit. this region could be a town or city or a place of any radius. i have not found any help regarding, any help or even a way towards the goal would be highly appreciated.
PEACE
There is a method on CLLocationManager which will let you do this: startMonitoringForRegion:, you pass a CLRegion which is basically just a point and a radius and it will call CLLocationManagerDelegate methods when the user enters or exits this region
Its just an idea. Refresh the app constantly at a distance and pass the current lat/long value to the server using webservice. And if current lat/long value is same as some specific lat/long then show UIAlertView. Hope that helps.
I have a view based application and in that I want to show driving directions on map.
I searched for it on google, I got the google maps driving directions api but I didn't got how to use it in program directly webview or is there any other way to use that api programmatically. Any help appreciated.
If you want my advice (and this is the way I do things), use an UIWebView and use a Javascript-based sample to to ask Google to draw directions for you.
It's easy!
Use this link:
http://maps.google.com/maps?f=q&saddr=25.612524,85.128281&daddr=28.574815,77.236545&output=kml
or
http://maps.google.com/maps?f=q&saddr=patna&daddr=new+delhi&output=kml
You can use both web services, one with lat and long ,where second one is with saddr(source address) and daddr(destination address). It gives you xml file parse it and make array of intermediately lat-long points . I think u know how to draw route on MKMapView with the help of Overlay class.
**If you need to finding lat long of given name of location ,use this link:
http://maps.google.co.in/maps?t=h&z=10&hl=en&format=p&q=new+delhi&output=kml
**Keep in mind that ,if location name have two or more then two words then it combines with + operator.
You should take a look at MKMapViewController for displaying maps. Take a look at this tutorial on how to draw routes with MKPolyline.
all , iam developing an ipad app that uses mapview to display google maps, my problem was how to get lat long of a perticular region, some how i manged to get by putting an overlay on the map view and getting point of that view , then converted to lat long. now my problem is i want to show an movable pointpin on the view so that user easily point the required region.
If any idea please send me .
Thanks
Kumar Y R
Use DDAnnotation in map view
here is the link to download
it has a sample where you can drag the pin and drop it where you need.
I want to know how to find nearest restaurant using mapkit in iphone sdk?
I want to display current location of user and then want to display restaurant near tht location...
if neone have idea please help me in this
Thanks
nir
This should help
http://blog.objectgraph.com/index.php/2009/04/02/iphone-sdk-30-playing-with-map-kit/
Should help you get started. There is a series of map tutorials.