the test to check if layer is drawn before we draw feature is moved to drawFeature method so that it doesn't fail when called directly at the application level r=elemoine,crschmidt (Closes #1785)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8189 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -491,9 +491,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
||||
this.preFeatureInsert(feature);
|
||||
}
|
||||
|
||||
if (this.drawn) {
|
||||
this.drawFeature(feature);
|
||||
}
|
||||
this.drawFeature(feature);
|
||||
|
||||
if (notify) {
|
||||
this.events.triggerEvent("featureadded", {
|
||||
@@ -612,6 +610,12 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
|
||||
* style - {Object} Symbolizer hash or {String} renderIntent
|
||||
*/
|
||||
drawFeature: function(feature, style) {
|
||||
// don't try to draw the feature with the renderer if the layer is not
|
||||
// drawn itself
|
||||
if (!this.drawn) {
|
||||
return
|
||||
}
|
||||
|
||||
if (typeof style != "object") {
|
||||
var renderIntent = typeof style == "string" ?
|
||||
style : feature.renderIntent;
|
||||
|
||||
Reference in New Issue
Block a user