I am trying to integrate Google Places API into my iOS app. I am referring to this blog :
http://iphonebyradix.blogspot.com/2011/07/working-with-google-places-api.html
Now I am finding out my current location of the iPhone, how do I embed the longitude and latitude which I have got into the following URL instead of "location=34.0522222,-118.2427778" :
#define PlacesURL #"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=restaurants&sensor=false&key=Your_API_Key"
So that I get the restaurants locations near my current location and not near the hard coded location given in the code.
Thanks and Regards.
CLLocation *location = [[AppHelper appDelegate] mLatestLocation];//custom code to get latestPosition of user
NSString *url=[NSString stringWithFormat:#"https://maps.googleapis.com/maps/api/place/search/xml?location=%f,%f&radius=500&types=restaurants&sensor=false&key=Your_API_Key"
,location.coordinate.longitude,location.coordinate.latitude]];
Related
I am using the uber sdk for iOS. And i see I have to specify the
button.setProductID("abc123-productID")
button.setPickupLocation(latitude: "37.770", longitude: "-122.466", nickname: "California Academy of Sciences")
button.setDropoffLocation(latitude: "37.791", longitude: "-122.405", nickname: "Pier 39")
How can I get the coordinate information based on the location's nickname.
The iOS Uber SDK doesn't provide this functionality. However, Apple's CoreLocation framework has the CLGeocoder class that provides both forward-geocoding and reverse-geocoding. To convert an address into coordinates to pass to the request button, you can use the function geocodeAddressString:completionHandler:.
1)I want to fetch the venues for the nearby location by passing the latitude and longitude of to the API in foursquare.
I got this url:-thisand i got peroper response.
But for this latitude and longitude:- 32.3456,141.4346
(url)
I did not get any data.
Same for Facebook.I use this :- facebook API
But i want the list of generalized category listing from this API.And this API only gives me data of hotels only.Because i pass q=hotel.
2)How to get oauth_token for foursquare?
Please help me.
The reason you did not get any data for that location is because there are no venues in that area. If you follow this link you will see that location is in a remote area of Australia.
For help with connecting users to Foursquare, you can use these instructions
I have a mobile website that I've had a link to open Google maps app from within my website. Now however with the new version of ios6, the native version of google maps is no more and now the link opens to a safari based google maps. I'd rather have this open in a native Apple maps app. How can I do this?
Thanks for all help!
Instead of using the previous Google domain maps.google.com you use maps.apple.com. This will remain compatible with older devices running 5.x and below.
It looks like this:
http://maps.apple.com/maps?q=cupertino
Most of the parameters are the same, but see the Apple docs for more details:
Apple URL Scheme Reference: Map Links
what do you want ?
open maps web safari or open maps app ?
try this
CLLocation * currentLocation;
NSURL *requestUrl;
CLLocationCoordinate2D storedLocation;
CLLocationCoordinate2D start = { (storedLocation.latitude), (storedLocation.longitude) };
//Bitiş Yeri
CLLocationCoordinate2D end = { ([koordinatX floatValue]), ([koordinatY floatValue]) };
NSString *googleMapsURLString = [NSString stringWithFormat:#"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude, end.latitude, end.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];
i can get current latitude and longitude from iphone sdk. but is there any google map URL
if i send current location and some text to give latitude & longitude value for that text .
Please check with following URL to get latitude and longitude values;
http://code.google.com/apis/maps/documentation/geocoding/#GeocodingRequests
From this url:
http://ws.geonames.org/findNearbyPostalCodes?lat=19.0176560&lng=72.8561780
I want is city name that is mumbai can somebody help me?
Once you have parsed out the latitude and longitude, you can use the MKReverseGeocoder to translate that location to meta data about that location. In that meta data, you will find the city name that you are after.
Update
Have a look at the Apple CurrentAddress sample app, this has an example of how you use the MKReverseGeocoder.