Mapstraction V2 Architecture Demo
Files for this demo (and suggested file name format):
mapstraction.js (loading library)
mapstraction.core.js (mapstraction core)
mapstraction.google.core.js (google core)
mapstraction.yahoo.core.js (yahoo core)
...
mapstraction.radius.js (radius module)
mapstraction.route.js (routing
module)
mapstraction.google.route.js (google routing)
mapstraction.yahoo.route.js (yahoo routing)
...
mapstraction.geocode.js (geocoding
module)
mapstraction.google.geocode.js (google geocoding)
mapstraction.yahoo.geocode.js (yahoo geocoding)
...
This demo incorporates the following:
- Script registering and push/pop methods from Derek Fowler
(see http://dfowler.geeksbox.co.uk/demos/mapstraction and http://dfowler.geeksbox.co.uk/demos/mapstraction/checkLoaded.htm)
- All functionality under the 'mxn' namespace
- Main library uses the YUI namespace pattern
- Scripts act as modules extending the base functions following the jQuery pattern
where '$' is used as an internal reference to the namespace
- Extensions to the mapstraction namespace can be writen by including another js
file with (function($){})(mxn) (no on-demand loading)
- Modules can be written in a similar way but require a function stub in the main
library and a register call at the bottom to enable on-demand loading (see mapstraction.core.js for an
example)
- Lightweight base library loads module scripts on-demand from the same directory as mapstraction as they are
required keeping the script footprint as small as possible
Missing functionality:
- IsLoaded checking on the main mapstraction library
- Check whether function firing order will be an issue
- Decide whether to use 'register' callback or 'onscriptload' event to fire
outstanding function invoking