Reverse geocoding return an address string

Discussion created by louchios on Jun 30, 2014
Hello. I am following the reverse geocoding example here: https://developers.arcgis.com/javascript/jssamples/locator_reverse.html

My application does geocoding fine. I want to also do reverse geocoding by clicking a point on the map. I really just need a string of the address so I can pass this as a parameter into a new url. I don't want the address in a new infowindow. Is there a way to do this? thank you!

        locator = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
        locator.on("address-to-locations-complete", showResults);
 //locatorReverse = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
 locator.on("location-to-address-complete", function(evt) {
 if (evt.address.address) {
            var address = evt.address.address;
            var location = webMercatorUtils.geographicToWebMercator(evt.address.location);
 map.on("click", function(evt) {
          locator.locationToAddress(webMercatorUtils.webMercatorToGeographic(evt.mapPoint), 100);
 // listen for Locate button click then geocode
        registry.byId("locate").on("click", locate);