Project

General

Profile

« Previous | Next » 

Revision 3119

Added by perry almost 18 years ago

Fixed mapbuilder loading image when wms is down .. bug 2695

View differences:

lib/spatial/mapbuilder/lib/widget/MapPane.js
277 277
  // preload image
278 278
  newImg.id = imgDiv.imgId;
279 279
  newImg.hidden = layerHidden;
280
  newImg.title = layerNode.selectSingleNode("wmc:Title").firstChild.nodeValue;  
280 281
  newImg.fixPng = false;
281 282
  if (_SARISSA_IS_IE && imageFormat=="image/png") newImg.fixPng = true;
282 283
  newImg.onload = MapImgLoadHandler;
284
  newImg.onerror = MapImgErrorHandler;
285
  newImg.onfail = MapImgFailHandler;
283 286
  newImg.src = newSrc;
284 287
}
285 288

  
......
315 318
  } else {
316 319
    this.objRef.model.setParam("modelStatus");
317 320
  }
321
  var legendText = document.getElementById( this.title + "_legendText" );
322
  legendText.style.textDecoration = "none";
318 323

  
319 324
  if (_SARISSA_IS_IE) oldImg.parentNode.parentNode.style.visibility = "visible";
320 325
  if (this.fixPng) {
......
334 339
    }
335 340
  }
336 341
}
342

  
343
function MapImgFailHandler() {
344
  --this.objRef.layerCount;
345
  if (this.objRef.layerCount > 0) {
346
    var message = "loading " + this.objRef.layerCount + " map layer" + ((this.objRef.layerCount>1)?"s":"");
347
    this.objRef.model.setParam("modelStatus", message);
348
  } else {
349
    this.objRef.model.setParam("modelStatus");
350
  }
351
  var legendText = document.getElementById( this.title + "_legendText" );
352
  legendText.style.textDecoration = "line-through";
353
}
354

  
355
function MapImgErrorHandler() {
356
  --this.objRef.layerCount;
357
  if (this.objRef.layerCount > 0) {
358
    var message = "loading " + this.objRef.layerCount + " map layer" + ((this.objRef.layerCount>1)?"s":"");
359
    this.objRef.model.setParam("modelStatus", message);
360
  } else {
361
    this.objRef.model.setParam("modelStatus");
362
  }
363
  var legendText = document.getElementById( this.title + "_legendText" );
364
  legendText.style.textDecoration = "line-through";
365
}
366

  
lib/spatial/mapbuilder/lib/widget/Legend.xsl
104 104
        </xsl:if>
105 105
      </td>
106 106
  <!-- Title -->
107
      <td class="legendText">
107
      <td id="{wmc:Title}_legendText" class="legendText">
108 108
        <xsl:choose>
109 109
          <xsl:when test="wmc:Title/@xml:lang">              
110 110
            <xsl:value-of select="wmc:Title[@xml:lang=$lang]"/>

Also available in: Unified diff