Hi,First thing that I noticed is that your require statement is wrong.
require([
"esri/map",
"esri/dijit/BasemapToggle",
"dojo/domReady!",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/dijit/Popup",
"esri/arcgis/utils",
"esri/dijit/PopupMobile",
"dojo/dom-construct",
], function(
Map, ArcGISDynamicMapServiceLayer, arcgisUtils,
Popup
) {
Should be something like:
require([
"esri/map",
"esri/dijit/BasemapToggle",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/dijit/Popup",
"esri/arcgis/utils",
"esri/dijit/PopupMobile",
"dojo/dom-construct",
"dojo/domReady!",
],function(
Map,
BasemapToggle,
ArcGISDynamicMapServiceLayer,
Popup,
arcgisUtils,
PopupMobile,
domConstruct
) {
The modules and their namespace declarations need to be invoked in the same order.Your modules are being matched with the wrong namespace declarations. For example, you are matching ArcGISDynamicMapServiceLayer with "esri/dijit/BasemapToggle", and Popup with "esri/layers/ArcGISDynamicMapServiceLayer".Please read this article for the 'Hows and Whys':http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/