Sha256: 6e662dc8f1110657abe08c404c8bbc0b9a4fac562e13f0664d81378e72b5dd3b

Contents?: true

Size: 1.79 KB

Versions: 12

Compression:

Stored size: 1.79 KB

Contents

<html> 
<head> 
    <script src="OLLoader.js"></script> 
    <script type="text/javascript">

    function test_StyleMap_constructor(t) { 
        t.plan(6);
         
        var options = {'foo': 'bar'}; 
        var styleMap = new OpenLayers.StyleMap(null, options); 
        t.ok(styleMap instanceof OpenLayers.StyleMap, 
             "new OpenLayers.StyleMap returns object" ); 
        t.eq(styleMap.foo, "bar", "constructor sets options correctly"); 

        var style = new OpenLayers.Style();
        var styleMap = new OpenLayers.StyleMap(style);
        t.eq(styleMap.styles["default"].defaultStyle.strokeColor, style.defaultStyle.strokeColor, "default style set correctly from style object");

        var style = {strokeColor: "blue"};
        var styleMap = new OpenLayers.StyleMap(style);
        t.eq(styleMap.styles["default"].defaultStyle.strokeColor, "blue", "default style set correctly from style hash");
        
        var style = {
            "default": new OpenLayers.Style({strokeColor: "yellow"}),
            "select": {strokeColor: "blue"}};
        var styleMap = new OpenLayers.StyleMap(style);
        t.eq(styleMap.styles["default"].defaultStyle.strokeColor, "yellow", "default style set correctly from a mixed hash of renderIntents");
        t.eq(styleMap.styles["select"].defaultStyle.strokeColor, "blue", "select style set correctly from a mixed hash of renderIntents");
    }
    
    function test_StyleMap_destroy(t) {
        t.plan(2);
        var styleMap = new OpenLayers.StyleMap();
        t.ok(styleMap.styles["default"], "Got a default style after initialisation");
        styleMap.destroy();
        t.ok(!styleMap.styles, "StyleMap styles successfully destroyed");
    }
    
    </script> 
</head> 
<body> 
  <div id="map" style="width:500px;height:500px"></div>
</body> 
</html> 

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
postrunner-0.0.10 misc/openlayers/tests/StyleMap.html
postrunner-0.0.9 misc/openlayers/tests/StyleMap.html
postrunner-0.0.8 misc/openlayers/tests/StyleMap.html
postrunner-0.0.7 misc/openlayers/tests/StyleMap.html
postrunner-0.0.6 misc/openlayers/tests/StyleMap.html
postrunner-0.0.5 misc/openlayers/tests/StyleMap.html
postrunner-0.0.4 misc/openlayers/tests/StyleMap.html
gb_mapfish_appserver-0.0.5 vendor/assets/javascripts/openlayers/tests/StyleMap.html
gb_mapfish_appserver-0.0.4 vendor/assets/javascripts/openlayers/tests/StyleMap.html
gb_mapfish_appserver-0.0.3 vendor/assets/javascripts/openlayers/tests/StyleMap.html
gb_mapfish_appserver-0.0.2 vendor/assets/javascripts/openlayers/tests/StyleMap.html
gb_mapfish_appserver-0.0.1 vendor/assets/javascripts/openlayers/tests/StyleMap.html