Ticket #1042: renderer.patch
| File renderer.patch, 4.5 kB (added by tschaub, 1 year ago) |
|---|
-
lib/OpenLayers/Renderer/Elements.js
old new 127 127 node._featureId = featureId; 128 128 node._geometryClass = geometry.CLASS_NAME; 129 129 node._style = style; 130 this.root.appendChild(node);131 130 132 131 //now actually draw the node, and style it 133 this.drawGeometryNode(node, geometry); 132 node = this.drawGeometryNode(node, geometry); 133 this.root.appendChild(node); 134 134 }, 135 135 136 136 /** … … 180 180 181 181 //set style 182 182 //TBD simplify this 183 this.setStyle(node, style, options, geometry);183 return this.setStyle(node, style, options, geometry); 184 184 }, 185 185 186 186 /** -
lib/OpenLayers/Renderer/VML.js
old new 157 157 var _featureId = node._featureId; 158 158 var _geometryClass = node._geometryClass; 159 159 var _style = node._style; 160 this.root.removeChild(node);161 160 162 161 // create new image node 163 varnode = this.createNode("v:rect", id);162 node = this.createNode("v:rect", id); 164 163 var fill = this.createNode("v:fill", id+"_image"); 165 164 node.appendChild(fill); 166 165 node._featureId = _featureId; 167 166 node._geometryClass = _geometryClass; 168 167 node._style = _style; 169 this.root.appendChild(node);170 168 171 169 fill.src = style.externalGraphic; 172 170 fill.type = "frame"; … … 202 200 } 203 201 } 204 202 205 //fill 206 var fillColor = (options.isFilled) ? style.fillColor : "none"; 207 node.setAttribute("fillcolor", fillColor); 203 // fill 204 if (options.isFilled) { 205 node.setAttribute("fillcolor", style.fillColor); 206 } else { 207 node.setAttribute("filled", "false"); 208 } 208 209 var fills = node.getElementsByTagName("fill"); 209 210 var fill = (fills.length == 0) ? null : fills[0]; 210 211 if (!options.isFilled) { … … 227 228 } 228 229 229 230 230 //stroke 231 var strokeColor = (options.isStroked) ? style.strokeColor : "none"; 232 node.setAttribute("strokecolor", strokeColor); 233 node.setAttribute("strokeweight", style.strokeWidth); 231 // stroke 232 if (options.isStroked) { 233 node.setAttribute("strokecolor", style.strokeColor); 234 node.setAttribute("strokeweight", style.strokeWidth); 235 } else { 236 node.setAttribute("stroked", "false"); 237 } 234 238 var strokes = node.getElementsByTagName("stroke"); 235 239 var stroke = (strokes.length == 0) ? null : strokes[0]; 236 240 if (!options.isStroked) { … … 249 253 if (style.cursor) { 250 254 node.style.cursor = style.cursor; 251 255 } 256 return node; 252 257 }, 253 258 254 259 -
lib/OpenLayers/Renderer/SVG.js
old new 179 179 setStyle: function(node, style, options) { 180 180 style = style || node._style; 181 181 options = options || node._options; 182 183 182 if (node._geometryClass == "OpenLayers.Geometry.Point") { 184 183 if (style.externalGraphic) { 185 184 // remove old node … … 189 188 var _featureId = node._featureId; 190 189 var _geometryClass = node._geometryClass; 191 190 var _style = node._style; 192 this.root.removeChild(node);193 191 194 192 // create new image node 195 varnode = this.createNode("image", id);193 node = this.createNode("image", id); 196 194 node._featureId = _featureId; 197 195 node._geometryClass = _geometryClass; 198 196 node._style = _style; 199 this.root.appendChild(node);200 197 201 198 // now style the new node 202 199 if (style.graphicWidth && style.graphicHeight) { … … 247 244 if (style.cursor) { 248 245 node.setAttributeNS(null, "cursor", style.cursor); 249 246 } 247 return node; 250 248 }, 251 249 252 250 /**
