<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Multiple queries with one coordinate"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Multiple queries with one coordinate"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Multiple queries with one coordinate</title>
				<description><![CDATA[ I would like to click once on a map and determine if that location is an intersection (from the JSON data about distance) and the nearby streets.  What is the best way to do this?  I have some code that isn't working right now, but even if it's just a bug I am thinking there might be a better way to do this.

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>GEvent.addListener&#40;polyline, 'click', function&#40;latlng&#41; {
				var selectedWebService = getService&#40;&#41;;
				var script = document.createElement&#40;'script'&#41;;
                                document.body.appendChild&#40;script&#41;;
                                script.src = 'http://ws.geonames.org/' + selectedWebService + 'JSON?lat=' + latlng.lat&#40;&#41; + '&lng=' + latlng.lng&#40;&#41; + '&callback=loadJSON';
				var script2 = document.createElement&#40;'script2'&#41;;
				document.body.appendChild&#40;script2&#41;;
				script2.src = 'http://ws.geonames.org/findNearestIntersectionJSON?lat=' + latlng.lat&#40;&#41; + '&lng=' + latlng.lng&#40;&#41; + '&callback=isIntersection';
		}&#41;;</pre>
		</div>

Sort of along those lines, is the only way to access the JSON or XML data from the query with a callback function?  Or is there some way to return it simply to a variable?  For example, if I do 'http://ws.geonames.org/findNearestIntersectionJSON?lat=36&lng=-122' and only want to check the distance attribute--do I still have to use a callback function?

Thanks!!]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/987.page#4369</guid>
				<link>http://forum.geonames.org/gforum/posts/list/987.page#4369</link>
				<pubDate><![CDATA[Sat, 19 Jul 2008 02:25:22]]> GMT</pubDate>
				<author><![CDATA[ SURF-IT]]></author>
			</item>
	</channel>
</rss>