jsn

Coding differences between API 1.6 and 3.6

Discussion created by jsn on Sep 25, 2013
Latest reply on Dec 27, 2014 by Guzhongren
Hi all

In API 1.6 the javascript source code started with:

<script type="text/javascript">
      dojo.require("esri.map");

      var myMap, myTiledMapServiceLayer;
      function init() {
    



Now in version 3.6 I see that the same code stars in a different way, with a require that covers the whole script. Why?

I find the 1.6 way easier to read.

<script src="http://js.arcgis.com/3.6/"></script>
    <script>
      var map;
      require([
        "esri/map", "esri/layers/FeatureLayer", 
        "esri/tasks/query", "esri/tasks/QueryTask", 
        "esri/tasks/GeometryService", "esri/tasks/BufferParameters",
        "esri/graphic", "esri/InfoTemplate", "esri/symbols/SimpleMarkerSymbol",
        "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", 
        "esri/config", "dojo/_base/Color", "dojo/dom", "dojo/domReady"
      ], function(

Outcomes