load a google map from this information in iphone? - iphone

hello guys i have a UITableCell which has some details like this "550 Ashbury St., San Francisco, CA, 94117".the details are coming from database.now i want that when i click on the cell a new view should be loaded with google map with this address. any idea how to achieve this???

Use iPhone OS 3.0 which includes the MapKit framework using Google Maps. You don't need to do the browser way anymore since with MapKit you can embed your own map in the application.

The way I have done this to create a simple webpage on my server that sets up google maps and contains a javascript function which takes a location as a string argument. This function is responsible for setting up google maps to show the address.
I then load the page inside a UIWebView and I construct javascript which executes my javascript function with the argument, something like:
NSString* js = [NSString stringWithFormat:#"setup('%#')", location];
Then I execute it using:
[googleMapView stringByEvaluatingJavascriptFromString:js];

You'll need to geocode the address, to turn it into GPS coordinates, i.e. latitude and longitude. Google is not the only web service to provide this, but you'll likely use some web service for this purpose.
Once you have your coordinates, you can feed them to the MapKit component in the iPhone 3.0 SDK, which you can read more about at Apple Developer Connection.

Related

google maps in UIWebView passing data from core

I want to use to UIWebView to display google maps mobile website for my app. However; I need the current user location to be passed into the webview so that it may show a route. What steps must I take in order to not only pass the current location to the google maps url but also pass what I want it to route(for example, Costco)?
Second, my app is going to be a paid app and I was wondering if it is even possible to use google maps due to this? The app does not only have gps but other sections as well that I created myself.
Thank you so much
I think you dont want to show google-maps in an UIWebView. You should use either the MapKit-Framework or any other maps-framework like for instance route-me.
In both framework it is possible to draw polylines (links: MapKit, route-me) (which represents a route) and any other stuff like pins and a bubble with a circle around it which indicates the current location (links: MapKit, route-me (should be somewhere in the sample-programs)).

Can we use google Maps street view in ipad programming With annotations and other features of mapkit?

i was unable to implement google maps street view in my ipad.I was wondering if there is any way to implement google street view in ipad with all the features of mapkit .
i already tried it with java script but no success.
thanks in advance ...
Street view uses Flash in the browser (not available on iOS) and is a custom job in the Maps app. It's not available for use. Send your users to the location in the Maps app using a maps URL and let them get Street View themselves.
Edit
But... Here's a URL that will help you get images from Street View, but in the process probably violate the ToS for using Google Maps (and get any app rejected).
http://jamiethompson.co.uk/web/2010/05/15/google-streetview-static-api/

iPhone Mapkit: How can I get a real business name/address from a longitude/latitude?

I'm writing an iPhone application and trying to determine how to find a business name/address from a user's current GPS location (longitude/latitude). For example, if someone if using the application from inside a Starbucks, how can I find this out from their location? Is there a way to do this using mapkit or any API/Webservice?
You can do this with MKReverseGeocoder by providing a MKReverseGeocoderDelegate. It's actually quite simple.
The delegate will give you all sorts of information as an MKPlacemark.
You can get an address (MKReverseGeocoder), but you can't get a business name using the iPhone native SDK. I believe that both Google and Bing provide APIs for this, but one that I like to use (and it may have the most momentum) is Foursquare's.

Calling StreetView in IPhone Maps App from External Application

I'm trying to make an external call to the google maps application on the iphone from my application and send it straight to "streetview" mode from two lat, lon coordinates. I've tried a variety of combinations, but each one just sends me to the safari browser on the iPhone and not to the maps application.
Here is one of those tries:
NSString * latlonString = [[NSString alloc] initWithFormat:#"http://maps.google.com/maps?f=q&source=s_q&hl=en&layer=c&cbll=%#,%#&cbp=12,261.11,,0,5", lat, long];
For the record, I've successfully been able to call the external maps application to get driving directions.
Has anyone been successful in calling street view mode from an external app?
I don't think you can. Check the Apple's documentation for all available options for map links.

Is there a way to place a pin into the google maps iphone app using openURL?

I would like to create an iPhone app that can open the google maps app and place a pin on the map.
I have the exact location of the pin, specified by its longitude and latitude.
I also have a name for the pin e.g. 'location 1' that should be displayed along with the pin.
I know that UIApplication:openURL can be used for this but I don't know the exact url format.
So, is there a way to do what I described above? If, yes, what is the correct url format?
You can use a URL of the format: http://maps.google.com/maps?q=Your+Location+name#latitude,longitude
http://maps.google.com/maps?q=This+is+near+Lake+Shore+Drive#41.9288,-87.6315
You can drop up to 100 pins using KML. There is an example of this on http://appsamuck.com look at the example for day 8 (http://appsamuck.com/day8.html)
Why should your user have to exit your app to see a map. You can embed a Google map in your application easily. You can even drop multiple pins for which you have lat & long information.
In fact, in my opinion your user should never have to leave your application to view a google map.
An example of how to do this is included as an example application at https://sourceforge.net/projects/quickconnect/.
Download the QuickConnectiPhone zip file and you will find it in the Examples directory.