[Mapbender-commits] r2532 -
branches/beck_dev/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jun 23 10:31:46 EDT 2008
Author: christoph
Date: 2008-06-23 10:31:46 -0400 (Mon, 23 Jun 2008)
New Revision: 2532
Modified:
branches/beck_dev/mapbender/http/javascripts/map.js
Log:
reverted to 2517
Modified: branches/beck_dev/mapbender/http/javascripts/map.js
===================================================================
--- branches/beck_dev/mapbender/http/javascripts/map.js 2008-06-23 14:17:40 UTC (rev 2531)
+++ branches/beck_dev/mapbender/http/javascripts/map.js 2008-06-23 14:31:46 UTC (rev 2532)
@@ -120,10 +120,6 @@
}
}
}
-
-var imagesToLoad = 0;
-
-
function setMapRequest(frameName){
var functionName = 'setMapRequest';
@@ -140,9 +136,6 @@
continue;
}
- imagesToLoad += currentMapObject.wms.length;
- currentMapObject.firstWmsLoaded = false;
-
var newMapRequest = "";
for (var ii = 0; ii < currentMapObject.wms.length; ii++){
var currentWms = currentMapObject.wms[ii];
@@ -151,61 +144,15 @@
}
myMapIds.push("map_"+ii);
-// newMapRequest += getLayerHtmlCode(frameName, i, ii);
+ newMapRequest += getLayerHtmlCode(frameName, i, ii);
-
-// console.log("frameName: %s, wms: %s", i, ii);
- (function () {
- var img = new Image();
- img.src = mb_mapObj[i].getMapUrl(i, ii);
- var frameName = mb_mapObj[i].frameName;
- var elementName = mb_mapObj[i].elementName;
- var currentRequest = getLayerHtmlCode(frameName, i, ii);
- var mapIndex = i;
- var wmsIndex = ii;
- mb_mapObj[i].wms[ii].writeMapTimeout = setTimeout(function () {
- writeMap(img, frameName, elementName, currentRequest, mapIndex, wmsIndex);
- }, 100);
- })();
}
-// writeTag(mb_mapObj[i].frameName, mb_mapObj[i].elementName, newMapRequest);
+ writeTag(mb_mapObj[i].frameName, mb_mapObj[i].elementName, newMapRequest);
}
eventAfterMapRequest.trigger({
"frameName": frameName,
"myMapIds": myMapIds.join(",")
});
-
-
- function writeMap (image, frameName, elementName, html, i, ii) {
-// console.log("wms URL %s (%s)", image.src, frameName);
- if (image.complete) {
-// console.log("success!");
-// mb_mapObj[i].completeHtml += html;
- imagesToLoad --;
-// console.log("searching for %s in frame %s", "#"+elementName, "window.frames['"+frameName+"']")
-// console.log("found #%s elements.", $("#"+elementName, window.frames[frameName].document).size());
- if (!mb_mapObj[i].firstWmsLoaded) {
- mb_mapObj[i].firstWmsLoaded = true;
- $("#"+elementName, window.frames[frameName].document).children().remove();
- $("#"+elementName, window.frames[frameName].document).append($(html));
- }
- else {
- $("#"+elementName, window.frames[frameName].document).append($(html));
- }
- if (imagesToLoad === 0) {
-// console.log("all images loaded (%s)", frameName);
-// writeTag(frameName, elementName, completeHtml);
-// completeHtml = "";
- eventAfterMapImagesReady.trigger();
- }
- }
- else {
-// console.log("failed, will retry...");
- mb_mapObj[i].wms[ii].writeMapTimeout = setTimeout(function () {
- writeMap(image, frameName, elementName, html, i, ii);
- }, 100);
- }
- }
/*
for(var i=0; i<mb_MapRequestSubFunctions.length; i++){
eval(mb_MapRequestSubFunctions[i]);
More information about the Mapbender_commits
mailing list