Esri / esri-system-js

Load ArcGIS API for JavaScript modules using SystemJS
Apache License 2.0
23 stars 5 forks source link

How to register a plugin? #9

Closed coreyog closed 8 years ago

coreyog commented 8 years ago

I want to require a third party plugin: http://www.arcgis.com/home/item.html?id=a8f78cc6adea48cb8e962d7e36b9d010

Their examples use old non-Angular, non-esriSystem ways to import the custom layer by using djConfig.

How can esriSystem let me configure for the import of this layer?

jwasilgeo commented 8 years ago

@coreyog I am working on a plnkr to try to illustrate how this can be done. I'll update this thread when I have a working example.

jwasilgeo commented 8 years ago

Check out this plnkr using the "Esri/cluster-layer-js" repo on a map: http://plnkr.co/edit/bZNzdI?p=preview

The way that I've put this together, @coreyog, is that one can register plugins / packages to inform Dojo how to load external resources (see index.html dojoConfig). Then, in esri-system-js, you can register these packages just like any other module in the Esri JSAPI (see app/esriLoad.js).

jwasilgeo commented 8 years ago

Does anyone else have other possible solutions in mind or feedback on the above?

tomwayson commented 8 years ago

Nice work @jwasilgeo. That's exactly how I would have done it.

coreyog commented 8 years ago

It seems to be working. Now I'm getting an error about dojo.provide not existing but that may be the plugin to blame.

EDIT: By "seems to be working" I mean that it is requesting the plugin and running it or else I wouldn't be getting the dojo.provide error. I'm also not getting any other errors which is why I think it's just an out of date plugin.

tomwayson commented 8 years ago

Thanks @coreyog. Based on your comment, I'm closing this issue for now. Feel free to re-open if needed.