This demo shows a fully on-demand loading system for mapstraction.

Unfortunately it doesn't work when invoked functions need to return a value.

This is due to execution continuing when a return variable is needed from a queued function awaiting execution.

The alert box forces the program to wait for scripts to load allowing the 'getBounds' method to return an object. Without the alert box, it would fail.

Only way I can think of getting round this is to use callback functions, making the user script very complicated.

Files:

script/mapstraction.js
script/mapstraction.core.js
script/mapstraction.google.core.js
script/mapstraction.yahoo.core.js
script/geocode.core.js
script/mapstraction.route.js
script/mapstraction.radius.js