Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wicket-arcgis AMD update #74

Closed
steveoh opened this issue Oct 5, 2015 · 3 comments
Closed

wicket-arcgis AMD update #74

steveoh opened this issue Oct 5, 2015 · 3 comments

Comments

@steveoh
Copy link
Contributor

steveoh commented Oct 5, 2015

this component only works with the global esri namespace instead of the AMD modules which is the not recommended route for working with esri js.

My take is that it doesn't really fit nicely into your project because you are not on the AMD train and new objects are being created from the global namespace. In AMD land you would need to require that class in to create instances of it. It could come in as a parameter or a property of your global though.

What are your thoughts on this?

@steveoh steveoh changed the title wicket-arcgis wicket-arcgis AMD update Oct 5, 2015
@ffflabs
Copy link
Contributor

ffflabs commented Jan 6, 2016

Lol, I commented on your PR without reading this first. Now it makes a lot more sense.

Could you provide an example of the provider reccomended way of loading esri components?

@steveoh
Copy link
Contributor Author

steveoh commented Jan 6, 2016

From the docs.

require(["esri/map"], function(Map) { /* code goes here */ });

You would reference dojo.js which creates the require global.

@arthur-e
Copy link
Owner

arthur-e commented May 3, 2016

I'm not sure why the Dojo AMD loader isn't able to load wicket.js. I was updating the gh-pages branch today and I saw in the console that Wkt is undefined. Not sure why this issue hasn't come up before! We have AMD support in the first lines of wicket.js:

(function(root, factory) {

    if (typeof define === "function" && define.amd) {
        // AMD (+ global for extensions)
        define(function() {
            return factory();
        });

I've tried to work with the Dojo require() function in wicket-arcgis.js. This works (but is obviously not a real solution):

require(['esri/map', 'https://arthur-e.github.io/Wicket/wicket.js'], function (Map) {

However, what we need is this, which does not work:

require(['esri/map', 'wicket.js'], function (Map) {

But, again, since the <script> tag for wicket.js is included in the header, and wicket.js has AMD module definition, I'm not sure why this is a problem at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants