[OpenLayers-Dev] Error in SelectFeature with previous highlight? etc.

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Mon Jun 27 07:11:44 EDT 2011


Hi,
we use two SelectFeature controls one for highlight and the other for 
select. For the highlight control is hover and highlightOnly true, the 
select control selects by click, multiKey or boxKey. Now when I click 
one feature it's selected when I then click an other feature the first 
is highlighted and the other is selected.
I think the error could be in the outFeature- function of SelectFeature 
where only something happens when the control is the current highlighter 
(feature._lastHightlighter is set to this SelectFeature). I think the 
control should delete itself from the feature when it is the 
feature._prevHightlighter.
     outFeature: function(feature) {
         if(this.hover) {
             if(this.highlightOnly) {
                 // we do nothing if we're not the last highlighter of the
                 // feature
                 if(feature._lastHighlighter == this.id) {
                     // if another select control had highlighted the 
feature before
                     // we did it ourself then we use that control to 
highlight the
                     // feature as it was before we highlighted it, else 
we just
                     // unhighlight it
                     if(feature._prevHighlighter &&
                        feature._prevHighlighter != this.id) {
                         delete feature._lastHighlighter;
                         var control = this.map.getControl(
                             feature._prevHighlighter);
                         if(control) {
                             control.highlight(feature);
                         }
                     } else {
                         this.unhighlight(feature);
                     }
                 } *else if (feature._prevHighlighter == this.id) {
                     delete feature._prevHighlighter;
                 }*
             } else {
                 this.unselect(feature);
             }
         }
Is it a bug (ours or in OL) or a feature?
By the way, someone looked for these two tickets:
http://trac.osgeo.org/openlayers/ticket/1971
and
http://trac.osgeo.org/openlayers/ticket/3257
Regards
Slawomir

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20110627/42a5c1e6/attachment.html


More information about the Dev mailing list