Issue in google maps embed API with time - javascript

I trying to implement search for places at particular time with transit mode in google maps with print option. So i used google maps EMBED API. What i achieved is i can search for places with origin and destination parameters in transit mode. What i cannot be able to do is search with specific time. There is no parameter in official documentation given regarding time . For reference https://developers.google.com/maps/documentation/embed/start
I have used JS Fiddle http://jsfiddle.net/pravinkumar/t5kg4gc2/ to replicate this problem. Please someone help me find a solution.

I think both Embed API and Static Maps API does not provide that function.
You can either use the server side Google Directions API, which has a similar format, to get that info, in additional to your embed api,
https://maps.googleapis.com/maps/api/directions/json?origin=Brooklyn&destination=Queens&departure_time=1343641500&mode=transit&key=API_KEY
or else you should switch to the Javascript API. You should able to do that with the Transit Options

As you note from its absence in the documentation, time-of-travel routing is not a supported feature.

Related

How to notify on upcoming turn google maps API v3

This may be very obvious to others but I am struggling with how to achieve this and can't seem to find it in the docs or using Google, this may be down to a badly worded query.
What I am trying to do is create a Route on a map and track my progress on it as I navigate and like the navigate function in google maps send a notification of the turn when within a x number of meters, similar to voice in google maps but I just want to get the text.
Is this possible with the Javascript API v3 out of the box? If so can someone point me to the relevant documentation or tutorials
if not out of the box, can someone suggest a design pattern or some pseudo code to do this.
What I am trying to do at the moment is.
Get my routes in Steps ( gps & text )
Get the next Step ( gps & text )
When current location is within 10m notify
when current location is past notify to update to next step & repeat
This feels like I am oversimplifying it and I am also struggling with how to correctly get the distance to next step. I know I can get the distance between 2 coordinates but is the a more accurate way to do so as to avoid getting an "as the crow fly's" distance?
I am trying to do this with Google maps api v3 in an Ionic AP using the Cordova GeoLocation plugin
Again Apologies if this is obvious to anyone else but I am struggling to find any relevant examples. If for some reason this is not easily done with google maps I am open to other open source or free frameworks that I can access via javascript
There is no out of the box solution. You would have to use both the Maps API and the Directions API. Directions returns routes in legs so you can use that to determine each step and get the user's location via Geolocation.
However, this might be against Terms of Service
No Navigation, Autonomous Vehicle Control, or Enterprise
Applications. You must not use the Service or Content with any
products, systems, or applications for or in connection with any of
the following:
(i) real-time navigation or route guidance, including but not limited
to turn-by-turn route guidance that is synchronized to the position of
a user's sensor-enabled device.

Alternate routes based on construction with Google Maps API Directions Service

Is it possible to use Google Directions API in conjunction with construction data? For instance, if I had a map that I entered a bunch of construction areas, can Google Directions then be made aware of these and to avoid them, providing a better route?
There is no way (currently) to input "roadblocks". See this feature request (star it if you want to support it):
http://code.google.com/p/gmaps-api-issues/issues/detail?id=214

Add get directions link to InfoWindow Google maps V3

Back with another google maps V3 question.
Here’s the background; I now have a map populated by a number of markers with info windows and what I want to do is add a link in the info Window that when pressed opens another browser window with google maps directions info in it.
I'v read a number of tutorials including the one by Mike Williams but most of them are either written for V2 of the API or just plain don’t seem to work, so do any of you good people know of a good noob tutorial that can give me some idea how to do this?
Thanks in advance
If you're just trying to send folks to http://maps.google.com for a directions query, a URL like http://maps.google.com/maps?saddr=Start&daddr=end might work, but I don't think there's any official documentation on those URLs.
If you want to have directions as part of your application, you should probably take a look at some examples of the Direction Service in the JS API.

Using Google Maps API to dynamically embed a map based on an address - Need to use Google's data for the markers/bubbles

I am trying to embed a Google Map into a dynamic webpage. The only variable the map depends on is the address of a business. That address comes from the website's database. I cannot just statically generate embed code for each dynamic page using the same set up. Is there a way I can embed a map based on that address and show a marker/bubble showing Google's information on that business?
So far, I have explored a few options including using the Google Map API and the Google Data API or just messing with the embed code given by Google. If I use the APIs it seems I have to design my own types of markers and maybe even supply my own data.
It doesn't look like there is an easy solution.
Any ideas?
Thanks.
EDIT: I'm not hung up on going from an address to a longitude and a latitude. I want the info window or "bubble" for a marker to show Google's information of a business.
EDIT: On Roy's suggestion I have been trying to use the map and search API together to achieve what I want. However, the only way I can execute a search with searchControl.execute('business name here'); is if the SearchControl is drawn. Thing is though I don't want to show any search controls. I have been able to hide it, but that just seems like an inefficient hack way of solving this.
Don't just use the embed code. Write a bit of Javascript that will draw a map for you and pass it the address.
Loads of examples here:
http://code.google.com/apis/maps/documentation/examples/index.html
I'm not sure which bit you're stuck on, but you don't need to design your own markers. Google can also create a marker from an address and it can find local business information if it has it (using local search API I think).

What is the most straightforward GWT workaround for same origin policy restriction (trying to query google maps api)?

I am trying to do some basic geocoding using the google maps API and a GWT dyanmic web project in Eclipse. For example, query the following URL:
http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&sensor=false
and get back the data for parsing. I am running into some confusion about whether it is better to set up a proxy or somehow use JSON with javascript (the 2 answers that I've come across to tutorials for). I have not been able to get either method working -- so I'm looking for some guidance. Thanks for your help in advance --
-Andrew
Why not just use the GWT Maps API? I think you can use the Geocoder class to do what you want.

Categories