OpenLayers OpenLayers

Ticket #565: LinearRing.toString.patch

File LinearRing.toString.patch, 1.1 kB (added by openlayers, 2 years ago)
  • tests/Geometry/test_LinearRing.html

    old new  
    9090        t.eq(ring.getArea(), 100, "getArea works lovely"); 
    9191    } 
    9292 
     93    function test_05_LinearRing_toString(t) { 
     94        t.plan(1); 
     95         
     96        ring = new OpenLayers.Geometry.LinearRing(components); 
     97        t.eq( ring.toString(), components.toString() + ',' + components[0].toString(), "toString output is ok"); 
     98    } 
     99 
    93100  // --> 
    94101  </script> 
    95102</head> 
  • lib/OpenLayers/Geometry/LinearRing.js

    old new  
    108108        return area; 
    109109    }, 
    110110 
     111 
     112    /** 
     113     * @returns The coordinates components as a string 
     114     * @type String 
     115     */ 
     116    toString: function() { 
     117        return this.components.toString(); 
     118    }, 
     119 
    111120    /** @final @type String */ 
    112121    CLASS_NAME: "OpenLayers.Geometry.LinearRing" 
    113122});