How I can get coordinates (lat,lon) of route from url generated by google (like: http://goo.gl/maps/1gpxk).
Is there an API for that or anything else?
Thanks.
See the documentation. Make sure you read the Terms of Service.
Directions Web service
Google Maps Javascript API v3 Directions Service
Related
I currently have an application which takes a a start and end point from a user and sends a request to the google maps directions API, for example: https://maps.googleapis.com/maps/api/directions/xml?key=my_key8&origin=M460PU&destination=NN36NW&sensor=false&mode=driving&units=imperial&departure_time=1501752779
We then display the estimated journey time for a given route. The user has asked if it's possible for us to include a link directly to Google maps so that they can see the route on the maps and make sure it looks ok.
I've seen previous questions such as this one: Link to Google Maps but that seems to be a solution for a simple Google Maps search, where as in my case I want to see a route from the directions API.
I'm trying to figure out if I there's a way I can take the data from the Directions API response and plug that in to a http://maps.google.com/maps URL that the user can click on. Has anyone ever had any success doing this?
As mentioned #geocodezip you should use Google Maps JavaScript API or Google Static Maps API in order to show exactly the same route as the output of Directions API.
There is also an option to open Google Maps web site or native app using the Google Maps URLs. You can have a look at the documentation to figure out how to create the URL:
https://developers.google.com/maps/documentation/urls/guide#directions-action
The only issue is that the Google Maps URLs doesn't provide any parameter for departure time, so you will always get routes for "Leave now" that might have discrepancies comparing to a web service that was requested for a different departure time.
Based on your question I think the Google Maps URL might be
https://www.google.com/maps/dir/?api=1&origin=M460PU&destination=NN36NW&travelmode=driving
I have an application with a Google map. I traced the routes with address history to follow to go from one point to another. I would like to implement GPS service on my map, like Google Maps application mobile, which will go running for both voice and by visualization. My APP is in HTML5 and in javascript, not in native.
Basically, I would like to do this with Google Maps Api or something like that:
Thank you and sorry about my english.
Please check the Google Maps API for the recommended use of directions https://developers.google.com/maps/documentation/directions/
Alternatively if you have a Android / iOS App and want to open google directions through an intent, check the documentation for Google Maps Intents for Android or Google Maps URL Scheme for iOS respectively
We have been using a Google Maps URL in order to get a route from two different sets of GPS coordinates.
URL:
http://maps.google.com/maps?output=dragdir&saddr=34.019283,-118.494286&daddr=34.021564,-118.490112
[Link]
We have been using this URL for months and this morning this URL is returning a 404 error. Is this URL the wrong way to retrieve a route from Google Maps?
That URL is the "classic" google maps. It might have been turned off. You will need to replace it using the Google Maps Embed API (or one of the other Google Maps APIs).
I notice you can enable sign-in with the Google Maps V3 API. I wondered, is it possible to display a map created under a users My Maps service on a map configured through the V3 API?
I'm not so sure it is possible having had a hunt around on the web, so thought I'd ask here.
Thanks
According to the KML files on Google Maps, you can upload a KML file to my maps and at the same time, Google Maps v3 API.
but there is no mention about displaying my maps directly on v3.
However you can try figure out how to get mid and lid programmatically and regenerate the share url.
I have read your answer on this.
Maps API keys for geocoding not working anymore?
Currently I am trying this:
https://maps.google.com/maps/api/geocode/json?address=n&sensor=true&key=apikeygoeshere
Giving me error:
This API project is not authorized to use this API.
Please suggest how can I complete my app. I am searching locations for my App.I can buy business plan later but for now I need to test for development.
I have following services on:
Google Maps Coordinate API, Google Maps Engine API, Google Maps Geolocation API, Google Maps JavaScript API v3, Google Maps SDK for iOS, Places API.
What you are referring to is not the Geolocation API. It is the Geocoding API. You need to enable the Geocoding API in your console. Please see the documentation.
Visit the APIs console at https://code.google.com/apis/console and log in with your Google Account.
Click the Services link from the left-hand menu in the APIs Console, then activate the Geocoding API service.
Hope this helps.
Try this URL,
You Don't have to enter API Key in URL
Just pass lat,lng in URL through a variable
http://maps.google.com/maps/api/geocode/json?latlng=-34.78,138.519&sensor=false
When you put your location (Capital Area Soccer League) in google map search, google plots the location in the map if it finds a correct geocodes but if it does not finds proper geocodes for the searched location then it shows suggestions of corrects locations in the dropdown. When you choose any of the locations from the dropdown - it has the correct lat long (geocodes) so it plots that in the map correctly.
So you should not use geocodes in the search rather open up a suggestions dropdown and when click on any of the suggested location then you have correct geocodes to plot in the map.