AnsweredAssumed Answered

"esri/toolbars/Draw" and multipleDefine Error in API v.3.4

Question asked by endre.stoksethgeodata-no-esridist Employee on Apr 4, 2013
Latest reply on Apr 5, 2013 by DSwingley-esristaff
After updating to v3.4 I do get an "Error: multipleDefine" from dojoLoader on esri/toolbars/Draw.
I tried to update the Esri JS-API Draw example to use AMD, and I got the same error.

Also got the same Error using "esri/toolbars/Navigation".

Is Draw and Navigation included in other items like Map, using another namestyle (like "draw" instead of "Draw")?

Any idea what is going on?
-Endre

Draw example using AMD that fails:
<!DOCTYPE html> <html>   <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <title>Maps Toolbar</title>          <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">     <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">     <style>       html, body {         height: 100%; width: 100%; margin: 0; padding: 0;       }     </style>          <script></script>     <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script>     <script>         define([   "dojo/ready",   "esri/map",   "esri/toolbars/Draw",   "esri/graphic",   "esri/symbols/SimpleMarkerSymbol",   "esri/symbols/SimpleLineSymbol",   "esri/symbols/SimpleFillSymbol",   "dojo/_base/Color",   "dojo/_base/connect",   "dijit/layout/ContentPane",   "dijit/layout/BorderContainer",   "dijit/form/Button",   "dojo/parser"     ],function(ready, Map, Draw, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Color, connect){     ready(function () {     var map, toolbar, symbol, geomTask;      function init() {    map = new Map("map", {      basemap: "streets",      center: [-15.469, 36.428],      zoom: 3    });        connect.connect(map, "onLoad", createToolbar);     }            function createToolbar(themap) {    toolbar = new Draw(map);    connect.connect(toolbar, "onDrawEnd", addToMap);     }      function addToMap(geometry) {    toolbar.deactivate();    map.showZoomSlider();    switch (geometry.type) {      case "point":     var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 1), new Color([0,255,0,0.25]));     break;      case "polyline":     var symbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255,0,0]), 1);     break;      case "polygon":     var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25]));     break;      case "extent":     var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25]));     break;      case "multipoint":     var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_DIAMOND, 20, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,0,0]), 1), new Color([255,255,0,0.5]));     break;    }    var graphic = new Graphic(geometry, symbol);    map.graphics.add(graphic);     }     init();         })        });             </script>   </head>   <body class="claro"> <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" style="width:100%; height:100%;">     <div id="header" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'" style="height:75px;text-align:left;font-weight:bold;font-size:14px;color:#400D12;overflow:hidden;">       <span>Draw:<br /></span>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POINT);map.hideZoomSlider();}">Point</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.MULTI_POINT);map.hideZoomSlider();}">Multipoint</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.LINE);map.hideZoomSlider();}">Line</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POLYLINE);map.hideZoomSlider();}">Polyline</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.POLYGON);map.hideZoomSlider();}">Polygon</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYLINE);map.hideZoomSlider();}">Freehand Polyline</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.FREEHAND_POLYGON);map.hideZoomSlider();}">Freehand Polygon</button>       <!--The Arrow,Triangle,Circle and Ellipse types all draw with the polygon symbol-->       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.ARROW);map.hideZoomSlider();}">Arrow</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.TRIANGLE);map.hideZoomSlider();}">Triangle</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.CIRCLE);map.hideZoomSlider();}">Circle</button>       <button data-dojo-type="dijit/form/Button" data-dojo-props="onClick:function(){toolbar.activate(esri.toolbars.Draw.ELLIPSE);map.hideZoomSlider();}">Ellipse</button>     </div>     <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">     </div> </div>   </body> </html>

Outcomes