Reverse Geocode

2928
5
Jump to solution
04-29-2015 11:11 AM
KellyZiegenfuss2
New Contributor

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.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

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.

View solution in original post

5 Replies
TimWitt2
MVP Alum

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

KellyZiegenfuss2
New Contributor

Thanks so much! I have matched the order, but it still doesn't work. Is there anything else you notice?

0 Kudos
TimWitt2
MVP Alum

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.

TimWitt2
MVP Alum

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">

StevenGraf1
Occasional Contributor III

  "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