Hello!
At first, Thanks for this module, its very very useful!

I'm developing a ride-sharing site and I'm having difficulties on how to proceed in the best way. Basically my website must have two functions:

1) I want to create a node, where I put a starting address, an arrival address and Drupal saves the node, displaying a map with the route with this route being obtained with our beautiful module GetDirection.

2) I want to do a search where I tell the point of arrival in the search field and Drupal returns me nodes which have the same arrival point or a point near a radius of 100m (or other distances).

Now my Questions:

(a) Is possible to save "GetDirections" searches as nodes? I can't do this...
(b) Is possible to create a new Content type and define two fields in CCK called Start e Arrive points and obtain a map whith the route using GetDirections?
(c) Is my this idea a distant dream or possible to implement using, for exemple Locale, Gmap and GetDirections modules?

Thanks!
Wescley

Comments

hutch’s picture

a)
As it stand GetDirections does not send anything back to the server so no it can't save searches.
see http://drupal.org/project/gmap_direx. This module attempts to save the search results but looks unsupported.
b)
It is certainly possible to create a node type as you describe but getting GetDirections to write is another matter.
One possible route would be to send the 'to' and 'from' details back to the server by hacking the js function mygetDirections() so that it uses jquery's 'get' function. You would need a menu path for the http query to go to and a function to collect the data and write it to the node programmatically thus creating the node. This will require some php and javascript skills.
To show the map with directions again would require a call to one of the GetDirections functions that return a complete result fetched from google. See the API file for details
Or you could fix gmap_direx so that it works the way you want, it does need work but contains the javascript stuff to fetch a directions result in a saveable way and send it back to the server for processing.
c)
Yes it's doable but requires some skills.

Hope this helps.

wescleyteixeira’s picture

Hi Bob, thanks for the answer

I make the first item work, just yesterday
I used Gmap+Location modules

Gmaps module is an interface to Drupal for the Google Maps APIs, With Gmap we only can make a map with one marked point. It's good for an single address.

When we install Location module, there's a sub-module called "location cck". So, I configured a new content type and added this location field for this new content and works!! I put the zip-codes of starting point and ending point and Drupal saves this points and it generates the map with the points typed by me in a map and in an enabled block.

The item 2 is also possible and is also ready but works just when you enter the latitude and Longitude data, still not possible typing the zip-code only.

Thanks
Wescley

wescleyteixeira’s picture

Hi again Bob!

I found a tutorial showing how to to solve my problem number 2 !

Howto: zip code proximity search using Location Module:
http://drupal.org/node/359463

Now I'm sure that a can build a ride-sharing portal using Drupal :) !!!

Best Regards,

Wescley

hutch’s picture

Status: Active » Closed (works as designed)
Sinan Erdem’s picture

Version: 6.x-2.1 » 7.x-2.x-dev
Category: support » feature
Status: Closed (works as designed) » Active

Hello hutch,

I found a good tutorial to save routes to database:

http://vikku.info/programming/google-maps-v3/draggable-directions/saving...

Would you consider adding that kind of functionality? So that users can save their searches as a field to a node they create.

hutch’s picture

Although the idea is doable, I am somewhat pushed for time so I can't devote any time to this at the moment but contributions towards this would be welcome.