OpenLayers OpenLayers

Ticket #1042: renderer.2.patch

File renderer.2.patch, 3.3 kB (added by pgiraud, 1 year ago)

same patch as crschmidt but with changes also for vml

  • lib/OpenLayers/Renderer/Elements.js

    old new  
    127127        node._featureId = featureId; 
    128128        node._geometryClass = geometry.CLASS_NAME; 
    129129        node._style = style; 
    130         this.root.appendChild(node); 
    131130         
    132131        //now actually draw the node, and style it 
    133         this.drawGeometryNode(node, geometry); 
     132        node = this.drawGeometryNode(node, geometry); 
     133        this.root.appendChild(node); 
    134134    }, 
    135135 
    136136    /** 
     
    180180 
    181181        //set style 
    182182        //TBD simplify this 
    183         this.setStyle(node, style, options, geometry); 
     183        return this.setStyle(node, style, options, geometry); 
    184184    }, 
    185185     
    186186    /** 
  • lib/OpenLayers/Renderer/SVG.js

    old new  
    179179    setStyle: function(node, style, options) { 
    180180        style = style  || node._style; 
    181181        options = options || node._options; 
    182  
    183182        if (node._geometryClass == "OpenLayers.Geometry.Point") { 
    184183            if (style.externalGraphic) { 
    185184                // remove old node 
     
    189188                var _featureId = node._featureId; 
    190189                var _geometryClass = node._geometryClass; 
    191190                var _style = node._style; 
    192                 this.root.removeChild(node); 
    193191                 
    194192                // create new image node 
    195                 var node = this.createNode("image", id); 
     193                node = this.createNode("image", id); 
    196194                node._featureId = _featureId; 
    197195                node._geometryClass = _geometryClass; 
    198196                node._style = _style; 
    199                 this.root.appendChild(node); 
    200197 
    201198                // now style the new node 
    202199                if (style.graphicWidth && style.graphicHeight) { 
     
    247244        if (style.cursor) { 
    248245            node.setAttributeNS(null, "cursor", style.cursor); 
    249246        } 
     247        return node; 
    250248    }, 
    251249 
    252250    /**  
  • lib/OpenLayers/Renderer/VML.js

    old new  
    157157                var _featureId = node._featureId; 
    158158                var _geometryClass = node._geometryClass; 
    159159                var _style = node._style; 
    160                 this.root.removeChild(node); 
    161160                 
    162161                // create new image node 
    163                 var node = this.createNode("v:rect", id); 
     162                node = this.createNode("v:rect", id); 
    164163                var fill = this.createNode("v:fill", id+"_image"); 
    165164                node.appendChild(fill); 
    166165                node._featureId = _featureId; 
     
    166165                node._featureId = _featureId; 
    167166                node._geometryClass = _geometryClass; 
    168167                node._style = _style; 
    169                 this.root.appendChild(node); 
    170168                 
    171169                fill.src = style.externalGraphic; 
    172170                fill.type = "frame"; 
     
    249247        if (style.cursor) { 
    250248            node.style.cursor = style.cursor; 
    251249        } 
     250        return node; 
    252251    }, 
    253252 
    254253