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


    ], 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


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:

      // 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"

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.