On 2 March 2011 15:05, sandy037 <[email protected]> wrote: > I know that DirectionsService() is there, but I want to know if there > is some way to access the Web Services API and get the result.
Not from the client, because the browser stops it happening. The Javascript specification prevents cross-domain access with XMLHttpRequest. If you're using directions client-side, you should use the client-side tools provided. The standard workaround for cross-domain requests is to implement a proxy on your own domain. Note: even though you have used Access-Control-Allow-Origin, it is set on *your* server, not Google's, only IE8/9 will recognise it; and it requires XDomainRequest, not XMLHttpRequest. Google's servers may respond to XDomainRequests from arbitrary clients, but you can't force that. http://msdn.microsoft.com/en-us/library/dd573303%28v=vs.85%29.aspx -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
