Sorry that that is so vague but I don't know AJAX well enough to track what is going on down to something more specific. However, I am a programmer so with some help I am sure I can work out what is going wrong. It could be as simple as not setting up gmap properly (being my first time) or a bug in gdriving. However, I have gone over my setup with gmap more than once and it does produce maps so I am currently leaning towards gdriving having an issue.

All that said, the best I can do, and I hope it helps, is give you some attachments with my tracing of the code outputs and your source so you can see where the tracing is coming from.

Here is the setup: I've added tracing code in gdrving.module. The code is basically a call at the entry and exit of each routine along with the occasional printout of a variable and you get nice log file of indented trace calls to see what is happing.

In the JavaScript I put calls to console.log('...') in gdriving.js and facebox.js so we can see where the code is going. That's probably not enough for you to know what is happening but I am hoping it is enough for you to know what to get me to do next to track this down.

I also commented out that css that hides the map in the block so that I could see the map while debugging. It is in the block but it does not have my location details -- it's set in Europe somewhere from what I can tell.

The files in attached the tar file are as follows:
gdriving.module - your module with the tracing code in it. It's dead easy... you'll look at it for 5 secs. and go "ah, that's what he's doing". All you need to do is to see the resulting "lg.trace.gdriving" file at the same time.
lg.trace.gdriving - the tracing of the php code.

jquery.facebox.js - this code with the console.log() entries
gdriving.js - this code with the console.log() entries
trace.js - the result of the console.log() entries in the js.

The css and js of facebox are in the same folders as your css & js. the image directory is on the same level as the css & js. That is, there is no facebox subdir. I did start out with one but reading further it seemed that that was the wrong setup and looking through the code confirms it.

Again, sorry I couldn't offer more upfront but I will track it down if you give me some direction on what to test/look for.

CommentFileSizeAuthor
gdriving-trace.tar_.gz10.38 KBReg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tyabut’s picture

I'm sorry you're having issues getting gdriving to work. Do you happen to have a live site where I can see the problem in action? It's a little hard to debug without being able to see the problem.

tyabut’s picture

Oops forgot to address your other statements. The hidden gdriving map will not show your location at first. Only after directions are generated will the map show the right location and route. What happens when you try to get directions?

Reg’s picture

Sure, I can give you the login info. too but I'll send you all the details via your contact info. rather than here which would make login info. public. Will send within a couple of minutes of this post so if you don't get it please let me know.

tyabut’s picture

Forgive this obvious question, but where is the Google Map that contains the locations you want directions for? I can see that you want to use gdriving on your homepage, but I don't see a Google Map for gdriving to interact with (and get the locations from) on that page.

Reg’s picture

I had that setup at one stage but in playing around went back to "bare bones" and disabled everything but gmap itself as I didn't see anything in the instructions that said you needed locations or other modules with gmap. I'll re-enable "locations" & "gmap locations" and setup a map on the home page using those. Is that all the pieces needed?

Reg’s picture

I'm setting up a page called "test" now and will let you know when done.

Reg’s picture

Ok, I have a Google map on the left panel and changed the page to "test" for gdriving. Actually, I would like it to work for all but admin. pages but that is trivial stuff to make happen. I just used "front" as part of my testing at some point. Sorry, you were just seeing where I left off and gave up for the night.

Reg’s picture

Not sure if this is related but I moved a block to the footer of a theme that didn't have it (the footer block) and this notice came up:

"The block GDriving Map Directions Block was assigned to the invalid region content_bottom and has been disabled."

Not on the website I gave you to look at, this is on my internal 'dev' version of the same website.

tyabut’s picture

Here are the things I did so you can reverse them if need be: 1) turned off Google Maps Locations 2) set the marker manager to none

If you look at the Node Locations page and click on the marker, you can see gdriving flash before the ajax call to load the node. I'll have to modify GDriving to work better with that module. For now, if you install Views and create a View to display the location(s) on a map, GDriving should display a form at the bottom of each info window.

Reg’s picture

Cool, I was going to install views anyway so I'll do this tonight and get back to you. Thanks.

One thing I noticed when going through several themes and making them do what I wanted is that many of the more complex ones use a region called "bottom_content" and I know this is what you use to put gdriving outside existing regions. You might want to use a region name that no one will ever make by themselves.

Reg’s picture

Just wanted to let you know that it works now. I set up a view of type "location" using the style "gmap" at the URL "our-location" and it all worked from there.

In trying to keep things as simple as possible I avoided the views module which was the main downfall. Usually I use the views for all sorts of things because it's so useful but I guess in this case not having done anything with gmap (or anything to do with maps) before and seeing that there seemed to be several ways to do things (and modules to do them with) I went for the "keep it simple stupid" approach. I guess this shows that when it comes to technology that's not necessarily a good way to start.

Anyway, for anyone else starting from scratch like me -- don't go too simple instead:

  • Enable: Gmap, GMap Location, Location, Node Locations (at a minimum) and of course gdriving
  • It's worth creating a new "Content Type" for better control in the future, I just called my "location" although you can have more than one location on a node so "locations" might be more appropriate.
  • Make sure you change the Max value of allowed locations on the new node type to something other than zero. In this case zero doesn't mean unlimited, it means zero and unless you change it you won't see what you need to see in one of the steps.
  • Get your Google API key and for simplicity don't use 'www' unless you have to. This way the same API key will work on all your subdomains (I have dev, stage and www for example).
  • For the Gmap settings, make the map bigger as at it's default size you might not even see enough to tell that gdriving is working.
  • Setup a location using the location type
  • Setup a view of type location. If you don't see the type "location" it means there is something you haven't enabled or setup yet that needs to be. You probably want to include some text like "Click on the icon to get directions on your view setup" since the page will be little more than a map with an icon otherwise.

For anyone reading this please note that these are not comprehensive step by step instructions. They are instead notes that would have got me past "not so obvious" stuff if I had them and probably prevented me from bugging the developer who by the way has done great job so far and I am sure with time his module will just keep getting better.

Reg’s picture

I've been playing around with it and it's working great. The only thing I see now that's not quite right is that no matter what changes I make to the "marker" settings I always get the Drupal marker. Not sure though if this it at your stage or something before. Any ideas? It's still setup so you are welcome to look at the go into my website again.

tyabut’s picture

If you go to admin/build/views and edit your "our_location" view, you'll see an icon that's shaped like a cog across from "Style: GMap" under Basic Settings. If you click that icon, a field called "Marker / fallback marker to use:" will show towards the bottom of the page. Change it to whatever you like (I made it blue), and click Update and then Save. Then a refresh of the map should show the marker you want.

Edit: Forgot to mention I was looking at the settings for Page display.

Reg’s picture

I missed that one, it was right in views.

Thanks for everything, great module!

tyabut’s picture

Status: Active » Closed (fixed)