2009/4/8 Aude <aude.wiki(a)gmail.com>
I would like to test if a user has JavaScript enabled, which can be done
with an Ajax call or other way. If they don't, then don't load all the
external JavaScript, so as to keep the code lightweight and fast. If the
user does have JavaScript enabled, then load the map.js script.
If JavaScript is not enabled, the browser won't load scripts, no need to
test for it.
As for where to have the OpenLayers code, I would like to have our own copy
which we can keep up-to-date as possible. It would not be good to reference
the OpenLayers.js directly from OpenLayers or OSM, since those will get
changed as others see fit. It could be that some change will break our
extension. When we do update our copy of OpenLayers.js, we can test it with
our extension and make sure everything is okay.
The SlippyMap extension requires a small change to the original OpenLayers
code. At the very end of the file, it sets a variable to "true", so that the
JavaScript can be loaded asynchronously. The part of the JavaScript that
creates the map polls for these variables. If they are not yet set, the
function calls itself using alarm() and a ~0.5s delay. Without this hack,
the loading of the page would stall at the map in many browsers when using
slow links or slow CPUs
Regards,
jens