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??
Solved! Go to Solution.
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)
If you 'define' it last (before domReady!), does it work?
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)