Make it possible to change the filter in handlers

Trigger the 'select'-event earlier, this way any handlers for the event can
change both the filter and the resulting SLD inside the callback.
This commit is contained in:
Marc Jansen
2012-09-06 13:29:59 +02:00
parent 97b75578ba
commit 1063a4cd19
2 changed files with 58 additions and 1 deletions

View File

@@ -533,12 +533,13 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
}
var selectionLayer = this.createSelectionLayer(layer);
var sld = this.createSLD(layer, filters, geometryAttributes);
this.events.triggerEvent("selected", {
layer: layer,
filters: filters
});
var sld = this.createSLD(layer, filters, geometryAttributes);
selectionLayer.mergeNewParams({SLD_BODY: sld});
delete this._queue;