From field is disabled once clicking the get directions button. The only way to reenable the field appears to be returning to the previous page and then going back into the get directions form. Is this by design? I would like the user to be able to enter other addresses without having to leave and then come back. How to do that?

Comments

hutch’s picture

The From or To boxes are disabled not so much 'by design' as 'by necessity', I could not find a way to re-initialise the javascript from within itself.

apmsooner’s picture

Ahh got ya, but the javascript reinitialization you speak of is for the advanced settings google autocomplete or is it necessary without that feature? I liked the autocomplete feature but found some inaccuracies with the results (different issue i should post).

hutch’s picture

It applies in particular to the Google maps API v3 maps.

The Autocomplete feature is as you say very nice but sometimes inaccurate, this is beyond the control of Getdirections as it is supplied by Google, all Getdirections does is set it up. I might add that the Autocomplete feature (known as the 'Places' library) seems to be improving all the time, that's typical of Google, their software learns from the users.

apmsooner’s picture

Got ya. I can live with it obviously as it is. Thanks for the contribution... very useful! I'll keep the request open in case someone else may be able to contribute to figuring out a solution unless you would like to keep the issue queu clean and thus feel free to close this.

m-si’s picture

+1 for theat functionality.

greetings

m-si

coredumperror’s picture

I'd like to point out that, as long as advanced features aren't enabled, there doesn't appear to be any broken functionality if the fields are left enabled, even with Google Maps API v3. I set up a bit of JS to re-enable the fields after the submit action is triggered, and afterword I can input new locations to get directions for, and it works fine. Maybe Google improved their API at some point to fix the original problem?

However, certain advanced options will still break the ability to enter new coordinates without reloading the page. So maybe a patch that only disables the fields if advanced mode is turned on would work?

hutch’s picture

I have removed disable for non-advanced mode for the 'to' and 'from' textfields, it seems to work OK.
Commited to dev.