[OpenLayers-Users] renderintent not persistent
Frank Broniewski
brfr at metrico.lu
Thu May 20 10:33:11 EDT 2010
Hi,
I have a modified ModifyFeature.handleKeypress function for deleting
features from a layer. There I set the feature's state to deleted just
as I do it with the renderIntent of the feature. Whenever I click into
the map after deleting a feature, it appears back on the map because the
renderIntent is somewhere set back to default. Unfortunately I can't
find where or why.
My code so far (ModifyFeature.prototype.handleKeypress):
...
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",
{feature: this.feature});
} else {
if(confirm("Do you want to delete the selected feature?")){
var feature = this.feature;
if(feature.id == undefined) {
this.layer.destroyFeatures([feature]);
}
feature.state = OpenLayers.State.DELETE;
this.layer.drawFeature(feature, 'delete');
feature.renderIntent = "delete";
}
}
I could set the feature.style to
OpenLayers.Feature.Vector.style["delete"] and this is persistent, but I
wonder why the renderintent does not keep its state.
Frank
--
Frank BRONIEWSKI
METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN
tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
More information about the Users
mailing list