I've taken a basic webmap 'ESRI HomeButton' and I'm trying to create a modularized webmap setup from it. I want to break down this simple webmap to have it utilizing a module system with config files and more. Then I can take other single-use webmaps and breakout the widgets into separate files much more easily and approach everything very much like the FlexViewer environment.
The problem I am having is that in my widgetHomeButton.js file, I took the HomeButton.js code and added in three lines...
In my require, I added "widgets/homebutton/config" to point to my config.js file. I should mention I have a package.js file that sets up the folders so that 'widgets' points to package_path + "path/to/widgets" just like in the example.
In my function, I added widgetConfig as the variable to store the config.js file contents, which happen to be JSON style data.
Then in the HomeButton widget code I added a single line of code that reads...
console.log( widgetConfig );And all I get are errors. Any ideas what I am doing wrong?
أكثر...
The problem I am having is that in my widgetHomeButton.js file, I took the HomeButton.js code and added in three lines...
In my require, I added "widgets/homebutton/config" to point to my config.js file. I should mention I have a package.js file that sets up the folders so that 'widgets' points to package_path + "path/to/widgets" just like in the example.
In my function, I added widgetConfig as the variable to store the config.js file contents, which happen to be JSON style data.
Then in the HomeButton widget code I added a single line of code that reads...
console.log( widgetConfig );And all I get are errors. Any ideas what I am doing wrong?
أكثر...