i want to use this web service (Find nearby place name / reverse geocoding)
to display adress information in the infowindow of a marker located with its lat/lng(i'm using google map api). i've seen that i must send a HTTP request to get an XML file but i have no idea how to integrate it to my site: http://missokhay.alwaysdata.net/animation.htm any help is welcome
You cannot use our XML service from your javascript code, you will have to use XML via you server. This restriction comes from a browser 'security' feature. The browser does not allow XML calls to third party servers.
You can overcome this problem and use the JSON version of the same service.
thanks a lot for reply!
what do you mean by third part server?
i'll try to use the example you mentioned but i still have question why JSON version is allowed? i'm really newbie and want to understand how things are running!!
Lets say a user comes to your site www.yoursite.com than the browser of this user will refuse to load xml data from the server geonames.org. There is no such security restriction for JSON data.
i'm just wondering: if i use php to parse the XML file; my browser won't be able to detect that i'm iloading an XML file as php script is executed in the server side. what do you think?
i'm really admiring: you don't hesitate to reply any question. thanks a lot!!! the code of the example is very useful and well commented.
can you tell me about the jData parameter how the function getLocation got it and what is the callback?
can you tell me about the jData parameter how the function getLocation got it and what is the callback?
the jData is the result GeoNames is returning. When you add the 'callback' parameter to the web service call GeoNames will return the result in a way that the function you pass as 'callback' will automatically be called and you can process the data in your own function. Cool, isn't it?