Rob wrote: > I am trying to contact the Google server to return driving directions, > but I do not want a map returned (just the text). Is there a way to do > this?
I think it's not possible directly, because you need to instantiate a GMap2()-object before you can use GDirections() on it. But you could show the map outside the visible area of the screen: -------------------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=XXX"> </script> <script type="text/javascript"> var map; var gdir; function init() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById('map')); gdir = new GDirections(map, document.getElementById('dir')); GEvent.addListener(gdir, 'error', handleErrors); map.setCenter(new GLatLng(50,5),6); } } function handleErrors() { alert('The address could not be found.'); } </script> </head> <body onload="init();" onunload="GUnload();"> <div id="map" style="position: absolute; width: 100px; height: 100px; top: -200px; left: -200px;"> </div> <form action="#" onsubmit=" gdir.load('from: ' + this.from.value + ' to: ' + this.to.value, { 'getSteps':true} ); return false; "> From: <input name="from"><br> To: <input name="to"><br> <input type="submit" value="Show route without map"> </form> <div id="dir"> </div> </body> </html> -------------------------------------------------------------------- XXX should be replaced by your API key Hope this helps, -- Bart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
