On Mar 1, 4:55 pm, sandy037 <[email protected]> wrote:
> Hi all,
> I am trying to get the JSON output of directions between two points
> using the Directions API Web services. I am using an XmlHttpRequest
> (GET Method) in Javascript to get the results but gives me an error
> "XMLHttpRequest cannot 
> loadhttp://maps.googleapis.com/maps/api/directions/json?origin=43.0480556....
> Originhttp://localhost:51724is not allowed by Access-Control-Allow-
> Origin."

Why?  That web service is intended for servers, there is a native
directions service as part of the API.

Perhaps if you send it from public web server it would work, I could
see why localhost might not be allowed for the WebService (it is
allowed for testing from the native API).


> If I paste the URL in browser and access it, it gives me the result
> properly. I am using IIS 7 as the server and I included the custom
> header "Access-Control-Allow-Origin" as ' * ' to allow CORS (Cross
> Origin Request Security), but still could not access the result. I
> donot have a working link of my code sample, so I am pasting the
> source below

No thanks.

  -- Larry

> Please help me to sort out this.
> Thanks & Regards,
> SDee.

-- 
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.

Reply via email to