Using http://thedirt.org/node/3560 as an example, everything works wonderfully with the map but can't seem to figure out how to allow users to click on the point and get the Google Maps pop-up that includes the how to get directions to or from this location. Any suggestions?

Comments

skjalf’s picture

/subscribe

I'd also be interested to know how to have the user navigate to the google maps homepage with locative data already entered in to plan their own trip using the trip planner (outside of the site)

Bartezz’s picture

subscribing

someone_cooler’s picture

subscribing

zdean’s picture

subscribing

Bartezz’s picture

This is a macro workaround I use;

[gmap markers=small blue::52.358016103138866, 4.891340732574463:Heineken Experience<br />Stadhouderskade 78<br />Amsterdam<br /><a href="http://maps.google.com/maps?saddr=&daddr=Stadhouderskade 78, Amsterdam, Nederland" target="_blank">Route</a>|zoom=14 |center=52.358016103138866, 4.891340732574463|width=428px |height=240px |control=Small |type=Map]

Not the ideal, yet a working situation :)

scott4ravens’s picture

Assigned: Unassigned » scott4ravens

subscribing

emagus’s picture

subscribing

biohabit’s picture

Thank you scott4ravens for assigning this to yourself.

mizerydearia’s picture

mizerydearia’s picture

http://tasteofthaiinc.com/drupal/directions

I didn't use the GMap module to implement the content on that page, however, it would be nice if I were able to use the module to create such content. I provided reference to it so that if it is helpful it could be used to aid in the development of this module to offer such capability.

scott4ravens’s picture

Assigned: scott4ravens » Unassigned
tonycpsu’s picture

Subscribe

yrre7’s picture

subscribe

melchior’s picture

subscribe

butler360’s picture

This is working well enough for me for now:

[gmap markers=alt small red::33.44060944370356,-117.61825561523437%autoclick:<form action="http://maps.google.com/maps" method="get" target="_blank"><b>Get Directions to SCBA</b><br /><span class="descriptor">Start address:</span><br /><input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="Street, City, State, Zip" class=descriptor onFocus="this.value=\'\';" /><br><INPUT value="Get Directions" TYPE="SUBMIT" class=descriptor><input type="hidden" name="daddr" value="33.44060944370356, -117.61825561523437"/></form> |align=Center |zoom=14 |center=33.44060944370356,-117.61825561523437 |width=555px |height=325px |control=Small |type=Map]

Combined a few things from a few threads.

Bartezz’s picture

Thanx for that!

baaj’s picture

subscribe

NWOM’s picture

I was looking to do the same thing, but I think I've come up with the best fix until the module actually supports it.

Keep in mind that I'm using Views to do this.

Basically, add a view like you normally would with all your desired fields etc.

Next, you want every type of address field there is, but exclude it from display, so that way views can use it, but for another field afterward. You can't use the address field since it's made up of divs, you instead have to add every address type field individually.

As an example, add the following:

Street,
City,
Province (also works for state),
Postal Code.

If you have any of the above already, you don't need to add it again, however the ones you don't have, add them and check exclude from display.

Next, make a new Node:Link field. Remove Label, Check "Rewrite the output of this display"..

Copy and paste: <a href="http://maps.google.com/?q=to+[street]+[city]+[province]+[postal_code]" target="_blank">Driving Directions</a>

Done, now you have a dynamic driving directions link for every single node. Gotta love views :P

monotaga’s picture

NWOM, thanks for this tip; it works well.

It'd be nice to have this as an option in the module.

tyabut’s picture

I created a module to add driving directions to google maps. Maybe some of you will find it useful.

Bartezz’s picture

@NWOM #18

I'm using this:

<a href="http://maps.google.com/maps?saddr=&daddr=[street]+[postal_code]+[city]" target="_blank">Driving Directions</a>

This will call the directions interface directly...

Cheers

tonyyarusso’s picture

subscribe

TechnoBuddhist’s picture

I use this in my module;

href="http://maps.google.com/?saddr=51.910410,-2.109574([street],+[city],+[province_name],+[postal_code])&daddr=51.889613,-2.193290([street],+[city],+[province_name],+[postal_code])

I found the directions using address alone weren't very accurate, so a bit of digging around in the google api, showed I could use the lat/lon and 'notate' them with the actual address. This gives accurate directions, but also gives the user the addresses that they want to see(lat/lon is uselss to them).

Don't forget to urlencode each element as you build up the link like this...

...
urlencode(check_plain($from[0]['city'])) . ',+' . 
urlencode(check_plain($from[0]['province_name'])) . ',+' . 
urlencode(check_plain($from[0]['postal_code'])) . ')&daddr=' .
...

Hope it helps.

hutch’s picture

Yet another module supporting google driving directions: Get Directions

Hope this helps someone.

elally’s picture

/subscribe

SweeneyTodd’s picture

Subscribing

As a temporary fix, #18 solution using Views was fantastic. I added this link in a couple of minutes with no custom code.

msathesh’s picture

#18 solution worked for me .. thanks very much..

jeuelc’s picture

#18 solution also worked for me... thanks.

i'm on drupal 7 by the way

lyosef’s picture

bulter360, how nice for you. Would you mind sharing how you did that?

koppie’s picture

Status: Active » Closed (duplicate)

@lyosef, your tone came off as snarky. I'm sure that wasn't intentional.

This issue has been discussed elsewhere, so I'm going to close it as a duplicate. Please see #151005: Driving directions?. Per the maintainer, neither 5.x nor 6.x versions are supported any more.

rwilson0429’s picture

Issue summary: View changes

This is an old issue but, for me, it is still relevant. It may be still relevant for others too. So, I've created a documentation page that shows how to do this using a custom content type, Views with an Eva display. The documentation was inspired by #18 and #21.

Hope it helps someone.

BleuBi’s picture

Well i still think it should be in the gmap module as an option.