From: Cameron S. <ca...@sh...> - 2004-03-28 22:18:27
|
On Monday 29 Mar 2004 7:33 am, Mike.Adair@CCRS.NRCan.gc.ca wrote: > I was thinking along the same lines, except I would call it just > mapbuilder.js. ok. > I would just include Modelbase and WidgetBase in here and not worry about > if it is already loaded or not. All mapbuilder apps will have a model, and > most will have widgets. Yes, that is true, I'm thinking more about objects like Extent which are only included by a few other objects. And if we solve the problem for one, then we can solve it for all. In loadScript() we can check to see if a script has already before loading it. (This avoids loading WidgetBase multiple times). > > Also, we should rename the config object as "mbConfig" instead of "config" > because "config" is more likely to be used by other javascript packages. ok. > > There is some clean up to do in Util.js - this probably shouldn't have any > geographic code. ok. > > Do we merge Sarissa into this file as well? No. I see Sarissa as an external library maintained by another project. At a later date we may want to import the latest Sarissa code and this will be easier to do if the library is stored seperately. > > -----Original Message----- > From: Cameron Shorter [mailto:ca...@sh...] > Sent: March 28, 2004 3:40 PM > To: mapbuilder > Subject: [Mapbuilder-devel] Initialisation and dependancies > > > I'd like to simplify the Config.xml file further and remove most of the > <script includes> from complete.html. > > I don't think that Config.xml or complete.html should know that MapPane.js > depends on WidgetBase.js and Listener.js. This information should be > stored > > inside MapPane.js. > > So I propose that complete.html only includes and initialises one script - > the > mapbuilderBootStrap.js script. > MapbuilderBootStrap will include all initial scripts (Util.js and > Config.js) > > then load all the scripts specified in the Config.xml (as it currently > does). > > Objects like MapPane, which have dependancies on other objects will need to > load these scripts at initialisation time. I assume that we can have > something like: > > if (! WidgetBase) loadScript($baseDir+"widget/WidgetBase.js") > > Any objections? -- Cameron Shorter |