Get Directions from Fusion Table InfoWindow

906 views
Skip to first unread message

Satpack Travel

unread,
Sep 6, 2011, 10:26:57 AM9/6/11
to Google Maps JavaScript API v3
Hello.

I've built a map using Fusion Tables for content and with directions
calculations for double clicked points on the map or based on a text
search query (not a little thanks owed to many of you!):

http://www.satpacktravel.com/API/api_a24.html

The problem:
I want users to be able to click on a 'get directions' box in the
Fusion Table-generated infowindow to get directions to my FT markers.
If they click, or double click, on the marker, it just pulls up the
infowindow. Here's an example that almost does it:

http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/infowindow_driving_directions.html

But this seems to work by suppressing the Fusion Table infowindows,
which I don't want t do (I'd like there to be a 'Get Directions' box
in the actual Fusion Tables window). From my admittedly limited
knowledge of how all this works I think it should be logically
possible (to pass info back from a FT infowindow as an event to
calcdirections.

So, does anyone know if:
a) there are any examples out there of a calcdirections function
coming from a FT infowindow.
b) if it is possible
c) how to do it?!!

Thanks for any assistance.





geoco...@gmail.com

unread,
Sep 6, 2011, 11:49:04 AM9/6/11
to Google Maps JavaScript API v3


On Sep 6, 7:26 am, Satpack Travel <robmacl...@gmail.com> wrote:
> Hello.
>
> I've built a map using Fusion Tables for content and with directions
> calculations for double clicked points on the map or based on a text
> search query (not a little thanks owed to many of you!):
>
> http://www.satpacktravel.com/API/api_a24.html
>
> The problem:
> I want users to be able to click on a 'get directions' box in the
> Fusion Table-generated infowindow to get directions to my FT markers.
> If they click, or double click, on the marker, it just pulls up the
> infowindow. Here's an example that almost does it:
>
> http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/infowindow...
Message has been deleted

Satpack Travel

unread,
Sep 7, 2011, 10:40:38 AM9/7/11
to Google Maps JavaScript API v3
Hello,

[I posted the below question to this group yesterday and apparently
someone tried to answer but something went wrong with their reply so I
never saw it].

By way of an update I think the only way to do this is to suppress the
FT infowindow and build my own with the get directions function in a
form within the new infowindow. I haven't successfully done that yet
and would much prefer to use the FT infowindow because it's working
nicely and I know it works across multiple platforms.

So any help still really appreciated!

Thank you,

Satpack Travel

unread,
Sep 8, 2011, 5:23:03 AM9/8/11
to Google Maps JavaScript API v3
Hello,

To answer my own post (and for future use should anyone search for a
good solution):

[Credit is very much due to Kathryn from Google via the Fusion Tables
API Group]

My solution: http://www.satpacktravel.com/API/api_a29.html

Basically you can add a calcroute query to a Fusion Tables infoWindow
to get directions from anywhere (in my example, current location) to
that place's location. Works very nicely.

Thanks for help.

Kevin Set

unread,
Jan 9, 2012, 1:50:12 PM1/9/12
to google-map...@googlegroups.com
Hey Rob, for some reason when I click on your solution  http://www.satpacktravel.com/API/api_a29.html , it says that it's 


Not Found

The requested URL /API/api_a29.html was not found on this server.

Can you double check to make sure that your link is working? I would definitely like to see your solution as I'm having to figure out how to put directions into my infoWindows. Thanks!

-Kevin

Satpack Travel

unread,
Jan 10, 2012, 2:50:50 AM1/10/12
to Google Maps JavaScript API v3
Hello Kevin,

Apologies - I think that page was deleted.

I've done another version at: http://www.mukaranga.com/map.html. The
way it works to the user (might explain the code a bit) - Click on
"Layers" (top left) and check a box to pull up some markers (these are
all in the South Africa area so you may need to zoom out to see them).
Click on a marker and then the "Directions" tab then "Route Me".
Hopefully the code makes sense - just ask if it doesn't.

If you're only wanting one simple map with an infowindow with
directions I've actually built a simple template where we do this (via
Fusion Tables) for free as it's all automated. You can build it
yourself at: www.satpacktravel.com/build-your-own-map.html. We use the
contents to populate a template which is then emailed to you.

Best of luck.

Rob



On Jan 9, 8:50 pm, Kevin Set <kevin.j....@gmail.com> wrote:
> Hey Rob, for some reason when I click on your solution  http://www.satpacktravel.com/API/api_a29.html, it says that it's

Kevin Set

unread,
Jan 10, 2012, 7:24:42 PM1/10/12
to google-map...@googlegroups.com
No problem Rob, thanks for the links!

I looked at both http://www.mukaranga.com/map.html and http://code.google.com/apis/fusiontables/docs/samples/infowindow_driving_directions.html [infoWindow with Driving Directions], and they've been really helpful to my coding; though I have a question: I've been working on doing something similar to your "infoWindow with Driving directions" except I use both the google maps API V3 and Sencha Touch (my map is coded in a javascript file and it uses an index.html file to execute with it when I launch it on google chrome). Do you think you can take a look at my code and help me out? I have a similar infoWindow as yours on my map except on my infoWindow (which is activated when I press on my location2 marker on my map) it has the location name and an html button that says: "Route Me From Location1." The html button will show me an immediate route between Location1 and Location2 (for my code, I don't need to show the directions (not yet) on how to get from Location1 and Location2 (say for example, turn right on this street, turn left on that street, etc.); I just need to show the route between Location1 and Location2 when I click on my "Route Me From Location1" button in my infoWindow. [I pretty much want my html button to work like your "Route Me" html button in your http://www.mukaranga.com/map.html link that you've provided me] I would definitely love to paste code here on the forums here, but unfortunately I can't since I need to show a working demo (keep in mind that my program consists of an html file along with js files, and I don't know how to put all that into one website address executable). Hope to hear from you soon!

-Kevin
Reply all
Reply to author
Forward
0 new messages