diff --git a/lib/OpenLayers/Renderer/VML.js b/lib/OpenLayers/Renderer/VML.js index bad2036853..c4d5fedee0 100644 --- a/lib/OpenLayers/Renderer/VML.js +++ b/lib/OpenLayers/Renderer/VML.js @@ -196,28 +196,31 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, { } else { if (!fill) { fill = this.createNode('v:fill', node.id + "_fill"); + } - if (style.fillOpacity) { - fill.setAttribute("opacity", style.fillOpacity); + if (style.fillOpacity) { + fill.setAttribute("opacity", style.fillOpacity); + } + + if (node._geometryClass == "OpenLayers.Geometry.Point" && + style.externalGraphic) { + + // override fillOpacity + if (style.graphicOpacity) { + fill.setAttribute("opacity", style.graphicOpacity); } - - if (node._geometryClass == "OpenLayers.Geometry.Point" && - style.externalGraphic) { - - // override fillOpacity - if (style.graphicOpacity) { - fill.setAttribute("opacity", style.graphicOpacity); - } - - fill.setAttribute("src", style.externalGraphic); - fill.setAttribute("type", "frame"); - node.style.flip = "y"; - - if (!(style.graphicWidth && style.graphicHeight)) { - fill.aspect = "atmost"; - } + + fill.setAttribute("src", style.externalGraphic); + fill.setAttribute("type", "frame"); + node.style.flip = "y"; + + if (!(style.graphicWidth && style.graphicHeight)) { + fill.aspect = "atmost"; + } + + if (fill.parentNode != node) { + node.appendChild(fill); } - node.appendChild(fill); } }