Hello,
I am trying to use Reverse Geocode with ArcGIS API for Javascript. I am very new to this API and Javascript in general, I have attached my code and if somebody could tell me what is wrong that breaks my map, I would greatly appreciate it! Thanks in advance.
Solved! Go to Solution.
This will get you a little closer. I have removed some things you didn't need and there was a typo with a task you tried to call.
Hey Kelly,
First thing I noticed is that whatever you put in your require needs to be in the same order as in your function:
require([ "dojo/parser", "dojo/ready", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/dom", "esri/map", "esri/dijit/Directions", "esri/dijit/HomeButton", "esri/urlUtils", "esri/arcgis/utils", "esri/dijit/Legend", "esri/dijit/LocateButton", "esri/dijit/Scalebar", "esri/task/locator", "esri/graphic", "esri/geometry/webMercatorUtils", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLinesSymbol", "esri/InfoTemplate", "esri/Color", "dojo/number", "dijit/registry", "dojo/domReady!" ], function( parser, ready, BorderContainer, ContentPane, dom, Map, Locator, Graphic, webMercatorUtils, SimpleMarkerSymbol, SimpleLineSymbol, InfoTemplate, Color, number, registry, Directions, HomeButton, urlUtils, arcgisUtils, Legend, LocateButton, Scalebar ) {
Everything looks good but once you hit esri/dijit/Directions, you are out of order.
Tim
Thanks so much! I have matched the order, but it still doesn't work. Is there anything else you notice?
One more thing, I have removed the following line of code for testing. You might want to put it back in
<link rel="stylesheet" href="css/layout.css">
"esri/task/locator",
should be this
"esri/tasks/locator",
and
"esri/symbols/SimpleLinesSymbol",
should be
"esri/symbols/SimpleLineSymbol",
Just a start to debugging. Found these issues using the Chrome developer tools