I wanted to clarify and make sure I wasn't missing something (i was surprised that I haven't seen a post on this already!)

There's currently no way to 'get directions' to a particular location mapped via openlayers, correct? Anyone have any tricks they use to implement something workable?


spgd01’s picture

We can't be the only ones who want to put Driving Directions into an openlayers map. Does anyone know how to do this. I am using the "get directions module" but i would like to have the functionality all in one map.

ifrik’s picture

Category: support » feature
bdevore’s picture

Here's my rather manual solution for directions.

I adding the geofield two additional times in my view, and formatting the output as latitude and longitude respectively. Then I rewrite the results in a global text layer with tokens to add http://maps.google.com/maps?q=[name_of_token]&f=d

It's a little more manual than I'd like and I had to fiddle with the way I was building the statement a couple of times to get the "&f=d" to attach at the end so google knows I want directions to this latitude and longitude.

This last text layer gets hidden and included as a token in the final Global text area, which is set as the description field under data source in the Format: OpenLayers Data Overlay | Settings

Scratch that. Seems like the rewrite is just pulling the first record rather than by row, so I'm getting all duplicates. I'll post if I find a workaround...

...Okay, the culprit seemed to be "exclude from display" leaving the elements displayed and using them as tokens seemed to work as expected. So the above works, but is fussier than it should be.

dmsmidt’s picture

Anybody got a good solution?

For now I just link to the external Google maps site: http://maps.google.com/maps?saddr={start_address}&daddr={destination_address}