how to get Region using Specified string in GoogleMaps in Iphone? - iphone

In my iphone application i am using MKMapView to display any region(i.e Australia) and it is working fine using coordinates(latitude and longitude).But i want to display the region based on the string (i.e Australia) instead of the coordinates.
Lets say i click on the TableView with named string as "Australia" and in the next view it should display Australia with some pinpoints on that.
how to display any region based on the String instead of the given coordinates?
provide any solution with any code snippet or any useful link or any other ,which would be appreciated.
Thanks,
Mishal Shah

You need Geocoding. Querying the server for "Australia" should return the coordinates you need.

Related

Showing a given location on a map in XCode (iPhone)

I am developing an app that will take in two locations from the user, one of which can be the standard 'current location', the second will be a location of the user's choosing. First of all, I simply want to plot these two locations on a map view.
Can anyone help me take a place name (e.g. Boston MA) from the user via a textfield and get the decimal coordinates as well as dropping a pin on the map?
Read the Location Awareness guide, especially chapter
UsingGeocoders
This will deliver a coordinate for given free text.
Further search in the Apple Developper Center for Demo code for that Geocoder.
Further there is a LocateMe demo code from Apple, which uses the map (MkMapKit)

Driving Directions in the map

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.

How to draw route in map in iphone

I want to draw route in map, for this I am storing latitude and longitude in my server. when this view opens it fetches all lat and long from server and plots it in mapView. Suppose server gets new lat and long this should show in mapView without closing this view, means map has plotted route if it gets new lat and long this route should continue from last point.
Apple supplied a demo application called Breadcrumb with the 2010 WWDC Developer videos that does exactly this. You can get the sample code from here: http://developer.apple.com/videos/wwdc/2010/
We wrote a category to mapKit that allow you to show route over the map :
http://code.google.com/p/octomapkit/
Very easy to use :
[youMap addRouteFrom:startCoord to:endCoord zommed:shouldZoom]
Hope this helps,
Vincent

getting lat long from mapView iphone?

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.

Get Place Location

I need put information about place, where is iPhone now, to UILable in my screen. [Country][City][Street] and maybe coordinates [lat][lng]. For example in my UILable should be:
Your location is German, Berlin, Tiergarten
Can someone show me really simple code how can i get such information that put in my UILable?
The MapKit framework (part of iPhone OS 3.0) provides this for you. Specifically the MKPlacemark object, which you can obtain for a set of co-ordinates using an MKReverseGeocoder.
You need access to a reverse geocoding service, which will take your lat/lon coordinates as input and return some kind of structured address of that location.
Google's is available here: http://code.google.com/apis/maps/documentation/geocoding/index.html#ReverseGeocoding