Link to home
Start Free TrialLog in
Avatar of ts84zs
ts84zs

asked on

javascript code - function in function

i am trying to understand this code-
in this code, a function is written inside a function -

   <script>
 
      require([
        "esri/map", "esri/layers/ArcGISTiledMapServiceLayer", 
        "esri/domUtils", "esri/request",
        "dojo/parser", "dojo/number", "dojo/json", "dojo/dom", 
        "dijit/registry", "modules/RasterLayer",

        "dijit/layout/BorderContainer", "dijit/layout/ContentPane", 
        "dijit/form/HorizontalSlider", "dojo/domReady!"
      ], function(
        Map, ArcGISTiledMapServiceLayer, 
        domUtils, esriRequest,
        parser, number, JSON, dom, 
        registry, RasterLayer
      ) {

        //some code 
        function mapLoaded() {
//code of maploaded
        }

        function getRasterData() {
       //code 
        }

        function setElevation() {
        //code 
         }
 
         function supports_canvas() {
                //code 
         }
      });
    </script>

Open in new window


Why the functions "setElevation()", "supports_canvas()", "getRasterData() ",  "mapLoaded()"  
are written within

 "function(
        Map, ArcGISTiledMapServiceLayer,
        domUtils, esriRequest,
        parser, number, JSON, dom,
        registry, RasterLayer
      ) "

 thanks so much

pl guide
ASKER CERTIFIED SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ts84zs
ts84zs

ASKER

thanks so much

actually i do not understand the whole code ,,,  I will open another question to explain the whole code....