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:
pgiraud
2008-10-24 08:29:01 +00:00
parent 58fc08d574
commit 33e5bd7d7d
2 changed files with 17 additions and 5 deletions

View File

@@ -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;