See http://groups.google.com/group/Google-Maps-API/web/suggested-posting-guidelines
(you should ignore the word 'suggested' in the page title, its really 'required' reading) On Wed, Oct 29, 2008 at 1:19 PM, Francesco <[EMAIL PROTECTED]> wrote: > > Hi! > I write this code: > > <html> > <head> > <title>Trova strada</title> > <script src="http://maps.google.com/maps?file=api&v=2&key=myKey" > type="text/javascript"></script> > </head> > <body> > <div id="form1"> > <form action="#" onsubmit="vai(this.saddr.value, this.daddr.value)" > <input type="text" name="saddr" size="50" />Indirizzo partenza<br> > <input type="text" name="daddr" size="50" />Indirizzo arrivo<br> > <input name="submit" type="submit" value="Get Directions!" /> > </div> > <div id="map" style="width: 800px; height: 600px"></div> > <div id="directions"></div> > > <script type="text/javascript"> > > var map = new GMap2(document.getElementById("map")); > var geocoder = new GClientGeocoder(); > geocoder.getLatLng("Padova",function(point) { > if (!point) { > alert(address + " not found"); > } else { > map.setCenter(point,11); > } > } > ); > > > var gdir = new GDirections(map,document.getElementById("directions")); > GEvent.addListener(gdir, "load", onGDirectionsLoad); > > function onGDirectionsLoad(){ > } > > function vai(fromAddress,toAddress){ > gdir.load("from: " + fromAddress + " to: " + toAddress, > {travelMode:G_TRAVEL_MODE_WALKING}); > } > > </script> > > </body> > </html> > > When I click on submit button the form's fields are reset, and the > page doesn't generate the trip plan; I must recompiling form's fields > (with the same address as before) and so, finally, the page return the > trip plan as I want. > I don't understand why the code works not fine. Anybody can help me? > Thanks, Francesco > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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 -~----------~----~----~----~------~----~------~--~---
