Thank you very much for this wonderful sample!
There's one question: if I click on the map it returns stop name like "204 E 90th St". Is it possible to make it also return city name, something like "204 E 90th St New York"?
you're very welcome.
as you can see from the code in that page, we aren't doing anything in the application itself to handle the reverse geocoding. based on your other post it sounds like you want to skip this part entirely, but if you really wanted to get that level of control i guess you could update the string manually using a method like updateStop()
Thanks, John!
We're using our own locator so we have solved this problem by editing 'reverse geocoding' section in the locator style file.
As for my other question - no, we don't want to skip geocoding... In fact we would be happy to use only geocoding but unfortunately we have many important roads with no names and no addresses nearby So now I see maybe 2 solutions: using Route Task or creating geolocator for every road segment. But we just hoped for the most convenient way out - to translate coordinates of the clicked point to Directions dijit stops even if 'location could not be found' by geocoder. This point could have a name 'unknown stop' of something like that.
Hey john,
I am going to try to integrate this with my code, hope it makes it into core eventually.
Two quick questions.
1. When i move a stop, the stop display turns to coordinates (I am using my own geocoding, geometry and routing services). A successful reverse geocode call is made with a single address, but the display never updates.. any ideas?
2. My print page is not printing an overview map. Not sure how to even troubleshoot.
Thanks!
Jeff
var geometryService = window.location.protocol+'//'+window.location.hostname+"/arcgis01/rest/services/Utilities/Geometry/GeometryServer"; var locatorUrl = window.location.protocol+'//'+window.location.hostname+"/arcgis01/rest/services/tools/AGSStreetOnly/GeocodeServer"; var locatorUrl2 = window.location.protocol+'//'+window.location.hostname+"/arcgis01/rest/services/tools/AGSParcel/GeocodeServer"; var routingUrl = window.location.protocol+'//'+window.location.hostname+"/arcgis02/rest/services/routing/routing/NAServer/Route"; var printUrl = window.location.protocol+'//'+window.location.hostname+"/arcgis01/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"; function createDirections() { var options = { autoComplete:true, arcgisGeocoder: false, geocoders:[{ url: locatorUrl , name:"centerlineLocator" } ] }; var directions = new Directions({ map: map, routeTaskUrl:routingUrl, printTaskUrl:printUrl, showSegmentPopup:false, directionsLengthUnits:"MILES", geometryTaskUrl:geometryService, geocoderOptions: options }, "directionsDiv"); directions.startup(); }
Jeff and John the ability to click on the map to add stops will be in the next release (due very soon) of the ArcGIS API for JavaScript (version 3.12) .
Thats awesome Kelly Hutchins!! Thank you.
Still not sure why my Stop is not updating the location with the reverse geocode address though, or why my overview map is not showing.
Help.
Jeff
Do you have a test app that shows the issue you are having with the overview map and reverse geocode?
Manatee County GIS Mobile Server
Directions are on the tools tab on the left. Add two addresses, for example
1112 Manatee Ave W, Bradenton
2027 Manatee Ave W, Bradenton
And then move one of the points. It will show coordinates. Fiddler and Firebug show the reverse geocode is called and that an address is returned, it just doesnt update the box.
Jeff,
I can reproduce the issue with your app but not with the Directions sample in the help. Are you able to reproduce with the sample? If not then maybe try adding some of your custom logic to the sample until it breaks. This will give us a small bit of code that easily allows us to reproduce the issue and troubleshoot the problem.