[OpenLayers-Trac] [OpenLayers] #1588: (OpenLayers.Layer.Vector) drawFeature does not function correctly when feature.style is set.
OpenLayers
trac at openlayers.org
Tue Jun 17 09:21:25 EDT 2008
#1588: (OpenLayers.Layer.Vector) drawFeature does not function correctly when
feature.style is set.
------------------------+---------------------------------------------------
Reporter: openlayers | Owner:
Type: bug | Status: new
Priority: minor | Milestone:
Component: general | Version: 2.6
Keywords: | State:
------------------------+---------------------------------------------------
The optional style argument is not used when the feature's style is set.
We modified the code as follows.
/**
* APIMethod: drawFeature
* Draw (or redraw) a feature on the layer. If the optional style
argument
* is included, this style will be used. If no style is included, the
* feature's style will be used. If the feature doesn't have a style,
* the layer's style will be used.
*
* Parameters:
* feature - {<OpenLayers.Feature.Vector>}
* style - {Object} Symbolizer hash or {String} renderIntent
*/
drawFeature: function(feature, style) {
if (typeof style != "object") {
var renderIntent = typeof style == "string" ? style :
feature.renderIntent;
if (renderIntent == "default") {
style = feature.style || this.style;
if (!style) {
style = this.styleMap.createSymbolizer(feature,
"default");
}
}
else {
style = this.styleMap.createSymbolizer(feature,
renderIntent);
}
}
this.renderer.drawFeature(feature, style);
},
--
Ticket URL: <http://trac.openlayers.org/ticket/1588>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list