http://developer.mapquest.com/web/guest
MapQuest Developer Network
  • Sign In  |
  • Create Account  |
  • Contact Us
  •   |
  • Quick Start  |
    For Businesses For Developers For Easy Mapping Tools Get MapQuest AppKey
  • Business Solutions  |
    Enterprise Solutions Business Listings
  • APIs  |
    Licensed Data APIs Open Data APIs Licensed vs. Open Data
  • Mapping Tools  |
    Overview Map Builder Route Planner Link to MapQuest Link to Route Planner Distance Calculator Latitude/Longitude Finder Static Map Wizard
  • Resources  |
    Licensed vs. Open Data Developer Guides Terms Overview Terms of Use
  • Blog  |
    MapQuest Developer Blog MapQuest Blog
  • Support
    FAQ Forums Contact
Answer ( Unmark )
Mark as an Answer

How to use the API to search Nominatim

Forums

» SDKs - Open JavaScript Maps API » How to use the API to search Nominatim
Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How to use the API to search Nominatim Ben Logan 4/20/12 4:21 PM
RE: How to use the API to search Nominatim Ben Logan 4/20/12 7:05 PM
RE: How to use the API to search Nominatim Brian Coakley 4/24/12 9:37 AM
RE: How to use the API to search Nominatim Ben Logan 4/24/12 6:35 PM
RE: How to use the API to search Nominatim Brian Coakley 5/11/12 9:45 AM
Ben Logan
Ben Logan Rank: Neighborly Posts: 3
Join Date: 4/3/12

Recent Posts
How to use the API to search Nominatim
Answer (Unmark)
4/20/12 4:21 PM
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
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Ben Logan
Ben Logan Rank: Neighborly Posts: 3
Join Date: 4/3/12

Recent Posts
RE: How to use the API to search Nominatim
Answer (Unmark)
4/20/12 7:05 PM as a reply to Ben Logan.
Hello,

I just noticed that the address I used as an example returns an empty result if I use the web service to search. However, I get the same errors if I use a valid address. For example, just use "davidson,nc,usa".

Thanks,
Ben
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: How to use the API to search Nominatim
Answer (Unmark)
4/24/12 9:37 AM as a reply to Ben Logan.
Davidson, NC seems to be showing up in the Nominatum search now.

Have you verified that W old hwy 64 is in the osm data?
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Ben Logan
Ben Logan Rank: Neighborly Posts: 3
Join Date: 4/3/12

Recent Posts
RE: How to use the API to search Nominatim
Answer (Unmark)
4/24/12 6:35 PM as a reply to Brian Coakley.
Brian,

Thanks for the reply. Davidson does show up if I search with the web service, just not if I try to use the Javascript API to perform the search. The Old HWY 64 address didn't show up in either search, but some of the other addresses I tried did show up in the web service, but again not when searching via the API. I assume I am just using the Javascript API incorrectly--I just can't figure out how to do it correctly.

Thanks,
Ben
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: How to use the API to search Nominatim
Answer (Unmark)
5/11/12 9:45 AM as a reply to Ben Logan.
Is there a url where you have the different methods set up and we can see them?
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Platforms & Technologies
Quick Start for Developers
Quick Start for Easy Mapping Tools
Licensed Data APIs
Open Data APIs
Popular Products
JavaScript Maps API
Flex Map API
Geocoding API Web Service
Directions API Web Service
Search API Web Service
Support
Licensing
Developer Forums
Contact Us
FAQ
Products
MapQuest.com
Mobile Products
Route Planner
Gas Prices
Follow MapQuest
MapQuest Developer Blog
MapQuest Blog
MapQuest on Facebook
MapQuest on Twitter
Join our Mailing List

©2012 MapQuest, Inc. All rights reserved.    Privacy Policy | Terms of Use

Site Map | Help

Loading......