Load google map from this information to iphone?

Hi guys, I have a UITableCell that has some details like "550 Ashbury St., San Francisco, CA, 94117". Details come from the database. Now I want that when a cell is clicked the new view will load the google map with that url. any idea how to achieve this ???

0


a source to share


3 answers


Use iPhone OS 3.0, which includes a MapKit map using Google Maps. You don't need to make a browser anymore as with MapKit you can embed your own map into the app.



+1


a source


The way I did this is to create a simple web page on my server that configures google maps and contains a javascript function that takes a location as a string argument. This feature is responsible for configuring Google Maps to display the address.

Then I load the page inside UIWebView

and I create a javascript that executes my javascript function with an argument, something like:

NSString* js = [NSString stringWithFormat:@"setup('%@')", location];

      



Then I execute it using:

[googleMapView stringByEvaluatingJavascriptFromString:js];

      

0


a source


You will need a geocode for an address to turn it into GPS coordinates, i.e. latitude and longitude. Google isn't the only web service for this, but you'll probably use some web services for this purpose.

Once you have the coordinates, you can send them to the MapKit component in the iPhone 3.0 SDK, which you can learn more about in the Apple Developer Connection .

0


a source







All Articles