[OpenLayers-Dev] testing OL for being prepared at the ready event

Martin Saturka martin.saturka at sourcefabric.org
Wed Mar 16 07:17:51 EDT 2011


Hi,
we use OpenLayers at environments where we need to use JQuery based
"ready" event for the maps initialization, i.e.

$(document).ready(function() { do_map_init(); }

It fails for some situations, mostly and usually for MSIE. I have
found (for the current stable 2.10 version of OL) that it could be
checked via

OpenLayers.Util.test_ready = function() {
    var aux_layer = null;
    try {
        aux_layer = new OpenLayers.Layer.Vector("auxiliary");
    } catch (e) {
        return false;
    }
    return true;
};

I have a timer for checking it, until it is ok. Is there any plan for
having a regular checker? Am afraid that the thing above could be
wrong for next releases of OL.

M.

-- 
Martin Saturka
Software Engineer, Sourcefabric
www.sourcefabric.org


More information about the Dev mailing list