Search code examples
mapquest

Calling Mapquest with an address


I'm looking for a simple way to bring up a MapQuest map with something like:

http://mkapquestapi.com?address=123 Mapel St. Mytown, CA&diameter=20 miles

All the MapQuest documentation I've found tries to put me through hundreds of pages that do much more than I want.

I came across the example below in another StackOverflow question:

 $.ajax({
    url: "http://www.mapquestapi.com/geocoding/v1/address?key=",
    dataType: 'json',
    type: 'POST',
    contentType:'json',
    data: {location: { "postalCode": "98765"}, options: { thumbMaps: false} },
    success: function(data) { log( data ) },
    error: function(data) { log( 'error occurred - ' + zipCode + ' - ' + data ) }
});

I could handle something like that if someone could point me to where MapQuest explains what it wants in the parameters.

Thanks for any help.


Solution

  • So you want to open MapQuest with an address, rather than lat/long coordinates?

    The parameter options are defined in the MapQuest geocoding parameters section. Try this:

    http://www.mapquestapi.com/geocoding/#parameters