Why does my code stop working if I add "esr/dijit/Geocoder" in my require section?

3025
2
Jump to solution
09-28-2014 02:56 PM
NewOutlaw
New Contributor

I have this in my code initially:

        require(["esri/Color",

          "esri/map",

  

          "esri/graphic",

          "esri/graphicsUtils",

          "esri/tasks/Geoprocessor",

          "esri/tasks/FeatureSet",

          "esri/symbols/SimpleMarkerSymbol",

          "esri/symbols/SimpleLineSymbol",

          "esri/symbols/SimpleFillSymbol",

    "dojo/domReady!"

    ], function ( ..etc..)

Now if I add one line in between map and graphic:

"esri/dijit/Geocoder",

my code stops working!

Any thoughts as to why this happens please??

0 Kudos
1 Solution

Accepted Solutions
OwenEarley
Occasional Contributor III

Have you added the Geocoder function parameter as well?

require(["esri/Color",

  "esri/map",

  "esri/dijit/Geocoder"

  "esri/graphic",

  "esri/graphicsUtils",

  "esri/tasks/Geoprocessor",

  "esri/tasks/FeatureSet",

  "esri/symbols/SimpleMarkerSymbol",

  "esri/symbols/SimpleLineSymbol",

  "esri/symbols/SimpleFillSymbol",

  "dojo/domReady!"

], function (Color, Map, Geocoder, Graphic, etc)

View solution in original post

2 Replies
AlexeiB
Occasional Contributor

If you 'define' it last (before domReady!), does it work?

0 Kudos
OwenEarley
Occasional Contributor III

Have you added the Geocoder function parameter as well?

require(["esri/Color",

  "esri/map",

  "esri/dijit/Geocoder"

  "esri/graphic",

  "esri/graphicsUtils",

  "esri/tasks/Geoprocessor",

  "esri/tasks/FeatureSet",

  "esri/symbols/SimpleMarkerSymbol",

  "esri/symbols/SimpleLineSymbol",

  "esri/symbols/SimpleFillSymbol",

  "dojo/domReady!"

], function (Color, Map, Geocoder, Graphic, etc)