Ben Logan
Rank: Neighborly Posts: 3 Join Date: 4/3/12 Recent Posts | Hello,
I am just getting my feet wet with the API, and I have run into a problem I don't know how to get around. I want to do a simple Nominatim search via the API instead of directly calling the web service with AJAX. I've tried a few different methods and none work. I must be doing something stupid.
First I tried the Nominatim.search method:
MQA.Nominatim.search("6422 W old hwy 64,davidson,nc,usa",callback=function(junk) {document.getElementById("junk").innerHTML=junk;});
This doesn't return an error, but it doesn't seem to do anything at all--my callback doesn't seem to get called.
Then I tried the NominatimIO.search method. It returns a different error for each format I try to get the response in.
For XML:
MQA.withModule('nominatim', function() { io = new MQA.NominatimIO(); io.search("6422 W old hwy 64,davidson,nc,usa",nominatimOptions={format:"xml"},callback=function(junk) {document.getElementById("junk").innerHTML=junk;}); });
I get this error:
missing ; before statement http://open.mapquestapi.com/nominatim/v1/search?q=6422%20W%20old%20hwy%2064%2Cdavidson%2Cnc%2Cusa&format=xml&json_callback=MQA.NominatimIO.CALLBACKS.c13349532008891 Line 2
For HTML, I get this:
missing } in XML expression http://open.mapquestapi.com/nominatim/v1/search?q=6422%20W%20old%20hwy%2064%2Cdavidson%2Cnc%2Cusa&format=html&json_callback=MQA.NominatimIO.CALLBACKS.c13349532344021 Line 13
For JSON, I get this:
M is not a function http://open.mapquestapi.com/sdk/js/v6.1.0/mqa.module.nominatimio.js Line 1
Can anyone help me understand how to go about doing what I want to do?
Thanks, Ben
|