This commit is contained in:
bastianonm 2011-12-20 17:38:41 +00:00
parent 4f574f03b7
commit 774121e987
1 changed files with 21 additions and 16 deletions

View File

@ -10,28 +10,33 @@ var loc_it =
}; };
var loc = loc_en; var loc = loc_en;
function sleep(ms) var t;
{ var funqueue = [];
var dt = new Date(); var wrapFunction = function(fn, context, params) {
dt.setTime(dt.getTime() + ms); return function() {
while (new Date().getTime() < dt.getTime()); fn.apply(context, params);
};
} }
function wpgpxmaps(targhetId,mapType,mapData,graphData) function wpgpxmaps(targhetId,mapType,mapData,graphData)
{ {
var i = 0; funqueue.push( wrapFunction(_wpgpxmaps, this, [targhetId,mapType,mapData,graphData]));
while ((google == undefined || google.maps == undefined || google.visualization == undefined)) unqueue();
{
sleep(100);
i++;
if (i== 100)
{
return;
}
}
_wpgpxmaps(targhetId,mapType,mapData,graphData);
} }
function unqueue()
{
if ((google == undefined || google.maps == undefined || google.visualization == undefined))
{
t = setTimeout("unqueue()",200);
}
else
{
while (funqueue.length > 0) {
(funqueue.shift())();
}
}
}
function _wpgpxmaps(targhetId,mapType,mapData,graphData) function _wpgpxmaps(targhetId,mapType,mapData,graphData)
{ {