On 24 February 2011 13:06, Tristan Parker <[email protected]> wrote: > Link to map is http://www.tristanparker.co.uk/testing/map/index.html
There are major problems with variable scope. var is the keyword which defines a variable, and gdir is defined within the function "initialize". This restricts its scope to that function. Variables which need to be shared between functions must be defined in global scope (outside any function); you can do that with the simple var gdir; Then you can assign something to that variable anywhere with gdir = new GDirections(...); and the global variable is altered. Getting the scope right may be sufficient to make it work, but I would also recommend removing the action="#" from the form since you don't want it to do anything. -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
