Google Maps sdk with voice navigation direction in IOS? - ios

I´ve been reading the documentation of the Google Maps SDK for iOS and I didn't see anything about voice navigation direction and route on the map.
Do anyone know about this?

I correct my previous answer this is possible. You use the google directions API as outlined in this link:
You send your direction request and it returns the directions either as json or xml as per your preference. Gives you coordinates of each point on the route.
You send a request to http://maps.googleapis.com/maps/api/directions/outputformat?parameters
So if you want to return the directions as json the request would be:
http://maps.googleapis.com/maps/api/directions/json?origin=ORIGIN_LOCATION&destination=DESTINATION_LOCATION&sensor=FALSE
the ORIGIN_LOCATION and DESTINATION_LOCATION can either be a latitude and longitude seperated by a comma e.g. latitude,longitude or a location search string e.g Eiffel+Tower+,+Paris+France (The search string has to be url encoded).
The sensor parameter is another compulsory parameter and asks whether the device sending the request can detect its own location.
For example for the directions from the eiffel tower to the louvre museum are given on the following link as json:
http://maps.googleapis.com/maps/api/directions/json?origin=Louver+museum+Paris&destination=Eiffel+Tower+Paris+France&sensor=false
And to return it as XML:
http://maps.googleapis.com/maps/api/directions/xml?origin=Louver+museum+Paris&destination=Eiffel+Tower+Paris+France&sensor=false

Related

How can I search the channel in a specific country using the YouTube API 3.0?

I use the url to search channels in a specific country like this https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=8&order=viewCount&q=news&type=channel&regionCode=US&key=API-Key.
But when i changed the regionCode parameter to IT(italy) or any other one,the search result is always identical.So the search result is not changed with the regionCode.
How can I search the channel by country using the YouTube API 3.0,thanks.
I also try to search channel with the optional parameter regionCode, and it seems that this parameter is not to filter the results base on the country code of a Country. I found in this related SO question that the region parameter only applies to movie charts, and is not something that works as a parameter for general searches.
So the only possible parameter that I think you can use to filter the results of YouTube API in a specific country or place is by using the parameter location.
The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).
Hope it helps you.
There is no way to solve this problem. I tried location with locationRadius, but second parameter is limited to 1000km, so, I cant find all videos from Russian Federation or USA using that option and 1 api request.
Also, that api request performs slow for understandable reason.

Get short Google Map URL to share in iOS

I have latitude, longitude of the center of map view and zoom of the view. How can I generate the URL like this https://goo.gl/maps/twqcy in iOS? So that I can send my friend message like this: "Please go to this place: https://goo.gl/maps/twqcy".
I searched for the answer, and here is what I got: I can build a string like:
https://www.google.com/maps/place/#20.982375,105.7903495,17z to send to my friends.
However, there are 2 issues:
1) When user tap/click in the link, I want to show a marker. Currently it only center at the point with certain zoom degree that I put in. How can I generate a link, so that when my friend click on the link, he will see a marker?
2) How to change the form of the url to shortened one i.e from https://www.google.com/maps/place/#20.982375,105.7903495,17z to https://goo.gl/maps/twqcy.
Please answer with code in iOS, preferably in Swift.
UPDATE: This answer my question: Get url shortened with Google API, AFNetworking in Swift
returns directly a shortened NSURL
https://github.com/H2CO3/Shortener/blob/master/NSURL+Shortener.m

twitter search api no place returned

I am having a bit of trouble sifting through the twitter API. I am trying to search for tweets near a certain location and then see their exact (or approximate) geo coordinates. I understand the geo field is deprecated and now we are supposed to use the "place" field. Unfortunately when I use the following url: http://search.twitter.com/search.json?q=&geocode=30.1829,-97.832,10mi I get a bunch of responses with a location that matches the city of the geo coordinates, but geo: is null and there is no place field. Am I stuck with only having an accuracy up to city coordinates, or am I using the wrong search call?
Thanks in advance!
Remember, tweeting with a geo location is an opt-in process. Twitter will supply a feed from the area for all tweeters in that area, but only those who have opted to tweet their coordinates will show up with "geo" info.
Using q=here with your url it did return 1 tweet for me with "geo" info in this form (though likely it will have moved on down the timeline by the time you try...):
"geo":{"coordinates":[-33.9769,18.5080],"type":"Point"}
Every user has a user defined location set in their profile settings. Use this when users don't use geo-encoding.
You can obtain a list of all countries / states by country and do a simple clean-up operation on the dataset.
This gave me what I needed for location data and greatly enriched my output.

Google Map API only returns one result?

I am using the google maps api to develop an iOS app. I need to find the nearest gas station on the map. When I call an http request: http://maps.googleapis.com/maps/api/geocode/json?address=%gas%20station&sensor=true, it returns one result. But it is the only one. There should be many results. No matter what keywords I submit, it only returns one result. Does anyone know how to deal with this?
I opened the URL in a browser and got this response :
{
"results" : [],
"status" : "ZERO_RESULTS"
}
According to Google Maps documentation here
"ZERO_RESULTS" indicates that the geocode was successful but returned no results. This may occur if the geocode was passed a non-existent address or a latlng in a remote location.
Gas station is a vague address. Try entering a valid address with a name of the area or city or the street. And you will get results. e.g. http://maps.googleapis.com/maps/api/geocode/json?address=250%20King%20St%20SF&sensor=true
You need to use the Places API to search for places like establishments(restaurants, gas stations,etc)
I don't know why, but when I printed the result to the console, it always was showing only one result. But in a debug mode with a breakpoint there were 5 results.
Please check it out using a debug mode.

how to get latitude and longitude for particular landmark?

how to get latitude and longitude for particular landmark/business, i would like to get lat/long for specific address how to i do that? shall i use gps device to get the lat/long?
Very recently, two or three weeks ago, Google released a new API that lets you do just what you want.
This is how it works:
http://maps.google.com/maps/api/geocode/format?address=some_address&sensor=true_or_false
And here is an example:
http://maps.google.com/maps/api/geocode/xml?address=Lenox+Hill&sensor=false
The format can be JSON or XML.
You will need to use a Geolocation API (such as Google or Bing or Yahoo), and there might be others as well. But those are the "free" (with caveats) ones that come to mind.
Just remember they have rather strict Terms-of-use of how you can use their API, so be sure you are on the right side of the law.
http://msdn.microsoft.com/en-us/library/cc981067.aspx
http://code.google.com/apis/maps/documentation/
Can you elaborate a bit more on that? What type of application is that? What is the format of the landmark/business? Basically there are geo web services out there that do this kind of stuff...
Have a look at this for example:
http://www.geonames.org/maps/us-reverse-geocoder.html
http://www.geonames.org/export/ws-overview.html
Yahoo http://developer.yahoo.com/geo/geoplanet/guide/concepts.html
You can query for a free-form name such as address, etc, and it will return what is called a WOEID, then query the WOEID for its lat long.

Resources