OpenLayers OpenLayers

Changeset 1605

Show
Ignore:
Timestamp:
10/05/06 15:31:00 (2 years ago)
Author:
crschmidt
Message:

Documentation and tests to close #259 .

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/doc/Util.txt

    r1424 r1605  
    66 
    77 OpenLayers.Util.onImageLoadErrorColor -- A string to set img.style.backgroundColor to if the onerror event fires for the image (useful for 500 errors from WMS, for example).  
     8 OpenLayers.ImgPath -- A string to be used as the base for images for controls and the like. Should end with '/'.  
  • trunk/openlayers/tests/test_Util.html

    r1590 r1605  
    480480        t.eq(OpenLayers.Util.getScaleFromResolution(resolution), scale, "scale->resolution->scale works"); 
    481481    } 
    482  
     482    function test_14_Util_getImgLocation(t) { 
     483        t.plan(3); 
     484        OpenLayers.ImgPath = "foo/"; 
     485        t.eq(OpenLayers.Util.getImagesLocation(), "foo/", "ImgPath works as expected.");  
     486        OpenLayers.ImgPath = null; 
     487        t.eq(OpenLayers.Util.getImagesLocation().substr(OpenLayers.Util.getImagesLocation().length-4,4), "img/", "ImgPath works as expected when not set.");  
     488 
     489        OpenLayers.ImgPath = ''; 
     490        t.eq(OpenLayers.Util.getImagesLocation().substr(OpenLayers.Util.getImagesLocation().length-4,4), "img/", "ImgPath works as expected when set to ''.");  
     491    } 
    483492  // --> 
    484493  </script>