Can you please take a look at this demo and let me know why I am getting this error
Uncaught ReferenceError: ArcGISDynamicMapServiceLayer is not defined
As you can see I have registered the "esri/layers/ArcGISDynamicMapServiceLayer", but still getting the error
var map; var layerOpacity = 0.25; require(["esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/parser", "dojo/dom", "dojo/on", "dojo/ready", "dojo/domReady!"], function ( Map, ArcGISDynamicMapServiceLayer, parser, dom, on, ready) { map = new Map("mapDiv", { center: [-126.687482, 54.793577], zoom: 5, basemap: "topo" }); }); var appLayer = new ArcGISDynamicMapServiceLayer("http://renewablestoolbox.biol.sfu.ca/rorapp/rest/services/RORApp/MapServer/22"); map.addLayer(appLayer);
Solved! Go to Solution.
The require function is closed just before where you initialize the var appLayer.
you need to write code within that block
The require function is closed just before where you initialize the var appLayer.
you need to write code within that block
Behrouz,
The issue is that your code has the new ArcGISDynamicMapServiceLayer outside the main code block (i.e. });)
EDIT: looks like thejus answered before I posted.