OpenLayers OpenLayers

Changeset 5944

Show
Ignore:
Timestamp:
01/30/08 17:43:18 (10 months ago)
Author:
ahocevar
Message:

Cannot switch externalGraphic style on VML-rendered feature. r=tschaub (closes #1312)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Renderer/VML.js

    r5909 r5944  
    197197            if (!fill) { 
    198198                fill = this.createNode('v:fill', node.id + "_fill"); 
    199  
    200                 if (style.fillOpacity) { 
    201                     fill.setAttribute("opacity", style.fillOpacity); 
     199            } 
     200 
     201            if (style.fillOpacity) { 
     202                fill.setAttribute("opacity", style.fillOpacity); 
     203            } 
     204 
     205            if (node._geometryClass == "OpenLayers.Geometry.Point" && 
     206                    style.externalGraphic) { 
     207 
     208                // override fillOpacity 
     209                if (style.graphicOpacity) { 
     210                    fill.setAttribute("opacity", style.graphicOpacity); 
    202211                } 
    203  
    204                 if (node._geometryClass == "OpenLayers.Geometry.Point" && 
    205                         style.externalGraphic) { 
    206  
    207                     // override fillOpacity 
    208                     if (style.graphicOpacity) { 
    209                         fill.setAttribute("opacity", style.graphicOpacity); 
    210                     } 
    211                      
    212                     fill.setAttribute("src", style.externalGraphic); 
    213                     fill.setAttribute("type", "frame"); 
    214                     node.style.flip = "y"; 
    215                      
    216                     if (!(style.graphicWidth && style.graphicHeight)) { 
    217                       fill.aspect = "atmost"; 
    218                     } 
     212                 
     213                fill.setAttribute("src", style.externalGraphic); 
     214                fill.setAttribute("type", "frame"); 
     215                node.style.flip = "y"; 
     216                 
     217                if (!(style.graphicWidth && style.graphicHeight)) { 
     218                  fill.aspect = "atmost"; 
    219219                } 
    220                 node.appendChild(fill); 
     220                 
     221                if (fill.parentNode != node) { 
     222                    node.appendChild(fill); 
     223                } 
    221224            } 
    222225        }