2

I have js file like this and I have saved the ClusterLayer.js in all directories like

root --> ClusterLayer.js
root --> extras/ClusterLayer.js
root -->js/extras/ClusterLayer.js
root -->js/ClusterLayer.js

and the file is like

    require([
    "esri/map",
    "dojo/_base/array",
    "esri/layers/ArcGISDynamicMapServiceLayer",
    "esri/geometry/Geometry",
    "esri/geometry/Point",
    "esri/geometry/webMercatorUtils",
    "extras/ClusterLayer",
    "esri/graphic",
    "esri/symbols/SimpleMarkerSymbol",
    "esri/symbols/SimpleLineSymbol",
    "esri/symbols/SimpleFillSymbol",
    "esri/Color",
    "esri/InfoTemplate",
    "esri/dijit/HomeButton",
    "esri/dijit/OverviewMap",
    "dojo/parser",
    "esri/layers/GraphicsLayer",
    "esri/SpatialReference",
    "esri/dijit/PopupTemplate",

    "dijit/layout/BorderContainer", 
    "dijit/layout/ContentPane",
    "dojo/domReady!"
    ], function(Map, arrayUtils, ArcGISDynamicMapServiceLayer, Geometry, Point, webMercatorUtils, ClusterLayer, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Color, InfoTemplate, HomeButton, OverviewMap,   parser, GraphicsLayer, SpatialReference, PopupTemplate)

but still getting error

enter image description here

Can you please let me know why this is happening?

1 Answer 1

2

You have to tell Dojo where to find extras/ClusterLayer. You do this via dojoConfig. From the clustering sample, put this before the script tag that references js.arcgis.com to bring in the JS API:

    <script>
      // helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
      // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
      var dojoConfig = { 
        paths: {
          extras: location.pathname.replace(/\/[^/]+$/, "") + "/extras"
        }
      };
    </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.